PDA

View Full Version : command to change label



tbl
25th November 2005, 08:21 PM
hi all,
I am looking for the command to change/display the label of partitions :
swap and vfat.
For ext2 it is e2label (change and display)
For ntfs ntfslabel (comes with ntfsprogs) (display)

But fot swap and vfat, i can't find :-/

Maybe i could format swap with a -L : mkswap -L SWAP /dev/hda5
Idem for vfat : mkfs.vfat -n NAME /dev/hda3

But is there any way to DISPLAY label of those partitions ?

Any idea, please ?

thx

Firewing1
25th November 2005, 08:41 PM
you have to edit /etc/mtools.conf, make C: drive be /dev/hdx#
then
mlabel C: newlabel
Firewing1

creiter
25th November 2005, 09:01 PM
For swap use this:


mkswap -L MyLabel /dev/MyDevice

Maybe you need to turn off swap prior, or you could do this in rescue mode.

chris

tbl
25th November 2005, 09:52 PM
you have to edit /etc/mtools.conf, make C: drive be /dev/hdx#
then
mlabel C: newlabel
Firewing1

Excuse me Firewing1, but i don't really anderstand what you told :-[
What do you mean by
make C:drive be
please ?

tbl
25th November 2005, 09:53 PM
For swap use this:


mkswap -L MyLabel /dev/MyDevice

Maybe you need to turn off swap prior, or you could do this in rescue mode.

chris

Thx criter, but this is not a display, isn't it. This is a format .... Or am i wrong ?

creiter
25th November 2005, 10:51 PM
Sorry tbl, i didn't read the last line of your posting...

chris

Firewing1
26th November 2005, 01:43 AM
This is my /etc/mtools.conf:
drive f: file="/dev/hdb2"
drive c: file="/dev/sda2"
drive d: file="/dev/sda2"
drive e: file="/dev/sda3"
As you can see f: drive represents /dev/hdb2
add or remove lines as you need, or change them
then run
mlabel drive: "newlabel"
for example, if I wanted to label my FAT32 partition /dev/hdb2 "MyName" then I'd run this:
mlabel f: "MyName"
Firewing1

tbl
26th November 2005, 08:23 AM
thx Firewing1 : very interesting ! I gonna try.
:)

tbl
26th November 2005, 05:02 PM
Firewing1 : stil a question :)
How do you add label to the fstab ?
If i type LABEL=KEEP vfat auto,users,umask=0 0 0
at boot prompt i get an error message : LABEL=KEEP doesn't exist.
But it exists ! >:o :-D

So maybe my syntax is incorrect ? :-/
LABEL is for ext and swap, is it somethink spacial for vfat ?

thx

Firewing1
26th November 2005, 05:34 PM
LABEL in fstab is only for ext2/3 partitions. Sorry. You'll have to put the drive letter/number (eg /dev/hdx#) in manually.
Firewing1

tbl
26th November 2005, 06:33 PM
Hey : in fact it works very well with FC4 : my first test with onto centos 4 !
FC4 mounts a vfat label partition as well as /dev/hdxx.

I wonder why centos can't do it, and fc4 can :-/