Change Label on ext3 drive

Might be something really simple, but I’ve looked around in forums with no luck.

I had a winXP cpu with 2 drives. I installed openSUSE 11.0 in one of them (completely reformatted it to ext3) and then proceeded to do the same with the 2nd drive once openSUSE was installed. All is well… BUT the label on the 2nd drive still has the old winXP label, even after I erased all the partitions and reformatted to ext3.

Is there a way to change the LABEL of the drive that shows up on the desktop and Nautilus sidebar to something else. I thought it would be something as simple as an ‘F2’ on the selected drive on the desktop but no luck. Anybody know how to do this?

In Yast partitioner you can edit your partitions and add a Volume label
be careful, but it’s fairly straight forward.

Hi
It’s called e2label, have a read of the man page. You could also use
YaST partitioner as well via highlighting the partition and then edit
and press on the fstab button.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.0 x86 Kernel 2.6.25.16-0.1-default
up 3:29, 2 users, load average: 0.01, 0.03, 0.07
GPU GeForce 6600 TE/6200 TE - Driver Version: 173.14.12

Okay. Weird thing. I’ve done both ways now. Tried going through Yast Partitioner first. Changed the Volume Label no problems. But name on desktop persists and also in Nautilus.

I went ahead and tried ‘e2label’ and this is the output:

chepolinux:/home/chepoxxx # e2label /dev/sdb1
Docs-Pics

‘Docs-Pics’ is the name I want for the drive. BUT again when I look into Nautilus and my desktop same WinXp label remains (something like ‘Post Programas’ or something that makes no sense to me now).

Any suggestions?

Post your /etc/fstab
here please

also
fdisk -l

and indicate which parts you want to change

This is my fstab file (which I have been fiddling with).

chepoxxx@chepolinux:~> sudo cat /etc/fstab
/dev/disk/by-id/scsi-SATA_SAMSUNG_SP0802NS00JJ40Y582673-part1 swap                 swap       defaults              0 0
/dev/disk/by-id/scsi-SATA_SAMSUNG_SP0802NS00JJ40Y582673-part2 /                    ext3       acl,user_xattr        1 1
/dev/disk/by-id/scsi-SATA_SAMSUNG_SP0802NS00JJ40Y582673-part3 /home                ext3       acl,user_xattr        1 2
/dev/sdb1	/home/chepoxxx/Docs						   ext3	      users,auto	    1 2
/dev/disk/by-id/scsi-SATA_WDC_WD800BB-22FWD-WMAJ93570724-part1 /windows/D           ntfs-3g    users,gid=users,fmask=133,dmask=002,locale=en_US.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

And this is the fdisk -l output:

chepolinux:/home/chepoxxx # fdisk -l

Disk /dev/sda: 80.0 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe74ae74a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         262     2104483+  82  Linux swap / Solaris
/dev/sda2   *         263        2873    20972857+  83  Linux
/dev/sda3            2874        9733    55102950   83  Linux

Disk /dev/sdb: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x261742cd

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       10011    80413326   83  Linux

Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x70d5d43c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        9729    78148161    7  HPFS/NTFS

Disk /dev/sdd: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1f5834aa

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        9729    78148161    c  W95 FAT32 (LBA)

The drive partition I am trying to change the label of is ‘/dev/sdb1’:

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       10011    80413326   83  Linux

Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x70d5d43c

I found this page, scroll down part way http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/ref-guide/s1-filesystem-ext3-create.html

Assigning a Label with e2label

Once you have created and formated a partition, you should assign it a 	  label using the e2label command. This allows you to 	  add the partition to /etc/fstab using a label 	  instead of using a device path, thereby making the system more robust. 	  [1] 	  To add a label to a partition, type the following command as root: 	

/sbin/e2label /dev/hdb**X /mount/point Where hdb is the drive letter, X is the partition number, and /mount/point is the mount point you intend to use for the partition.
Once you have assigned each partition a label, add the partitions to /etc/fstab. To do this, log in as root and type:
pico -w /etc/fstab Then add a line to /etc/fstab for each labeled partition similar to this:
LABEL=/mount/point /mount/point ext3 defaults 1 2 In the above entry in /etc/fstab, replace each occurrence of /mount/point with the mount point you intend to use for the partition.
If you need more information on the various options available to you in /etc/fstab, type man fstab.
If there are partitions whose label you are unsure of, type the following command:
/sbin/tune2fs -l /dev/hdb**X |grep volume In the above command, replace hdb with the drive letter and X with the partition number.
This will return something similar to the output below:
Filesystem volume name: /mount/point In this output, /mount/point is the volume label.

Personally I would use Yast, it’s always worked for me.

YEAH!!! I got it. It was something really dumb on my part… I guess I had to restart the computer in order for the changes to take effect in GNOME. Now it correctly shows the label I want. Right on! Thanks guys for your help!

Yeah, you need a restart - obviously.
Well done

In any case what program does one use to label a drive in OpenSUSE ?
I don’t see any way to label from YaST and there is no e2label in repos…?..

Thanks for any help

In Yast partitioner go to the fstab options

or install gparted and with that just right click the partition in question and you’ll see the label option

On 2012-11-12 20:56, MavGuardian wrote:
>
> In any case what program does one use to label a drive in OpenSUSE ?
> I don’t see any way to label from YaST and there is no e2label in
> repos…?..


minas-tirith:~ # which e2label
/sbin/e2label
minas-tirith:~ # rpm -qf /sbin/e2label
e2fsprogs-1.41.14-5.1.x86_64
minas-tirith:~ #

and yast partition module.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

So how do I use this ?

e2fsprogs -L /dev/md0 DriveName

???
thanks

MavGuardian wrote:
> So how do I use this ?

man e2label

> # e2fsprogs -L /dev/md0 DriveName
>
> ???
> thanks
>
>

On 2012-11-12 22:06, MavGuardian wrote:

> So how do I use this ?
> # e2fsprogs -L /dev/md0 DriveName
>
> ???

No. e2fsprogs is the package, not the program. The program has a man
page, so look it up, it is very easy.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))