LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How Do You Edit Disk Labels? (https://www.linuxquestions.org/questions/linux-software-2/how-do-you-edit-disk-labels-573077/)

Ceran 07-28-2007 10:43 PM

How Do You Edit Disk Labels?
 
Most flash drives use the FAT filesystem, and this allows them to store a "disk label". When you plug a flash drive into your computer, and Gnome/KDE shows its icon, this is the name it'll use with the icon. In Windows you can edit this name just by right-clicking on the drive. As far as I can tell, Linux has no similar feature. This doesn't sound like a very complicated task, but I get nothing from Google.

Note, I'm not asking how to edit fstab, or the device's mount folder, as changing these doesn't change the name stored on the physical device. Does anyone know what I'm talking about? This seems like such a simple stupid little thing, but hours of Googling have brought me nothing.

{BBI}Nexus{BBI} 07-28-2007 11:37 PM

Quote:

Originally Posted by Ceran
Most flash drives use the FAT filesystem, and this allows them to store a "disk label". When you plug a flash drive into your computer, and Gnome/KDE shows its icon, this is the name it'll use with the icon. In Windows you can edit this name just by right-clicking on the drive. As far as I can tell, Linux has no similar feature. This doesn't sound like a very complicated task, but I get nothing from Google.

Note, I'm not asking how to edit fstab, or the device's mount folder, as changing these doesn't change the name stored on the physical device. Does anyone know what I'm talking about? This seems like such a simple stupid little thing, but hours of Googling have brought me nothing.

Right click your flash drive and select Properties, change the name to anything you want, then click ok. Although this does not store the new label on the device, everytime you plug that device into the same computer, it will retain that change and display the new label you chose for that flash drive. I hope this helps.

Ceran 07-29-2007 01:00 AM

Quote:

Originally Posted by {BBI}Nexus{BBI}
Right click your flash drive and select Properties, change the name to anything you want, then click ok. Although this does not store the new label on the device, everytime you plug that device into the same computer, it will retain that change and display the new label you chose for that flash drive. I hope this helps.

There's nothing in Properties that lets you change the name (at least in Gnome). However, with the help of a guy on Freenode, I figured out how to do it. With the mlabel program included in the mtools package, I can edit the label of any device that's using a DOS partition.

syg00 07-29-2007 01:18 AM

"mkfs.msdos -n pick-a-name /dev/????" perhaps.
Never tried it, but it's likely to already be on your distro.

Ceran 07-29-2007 01:41 AM

Quote:

Originally Posted by syg00
"mkfs.msdos -n pick-a-name /dev/????" perhaps.
Never tried it, but it's likely to already be on your distro.

My drive is at /dev/sdd2. If I try 'mkfs.msdos -n "Some New Label" /dev/sdd2' I get the error:
mkfs.msdos: /dev/sdd2 contains a mounted file system.

But of course if I unmount the drive, I then get:
/dev/sdd2: No such file or directory

syg00 07-29-2007 01:59 AM

Quote:

Originally Posted by Ceran
But of course if I unmount the drive, I then get:
/dev/sdd2: No such file or directory

Umount command (against the mount point), or (physically) remove the drive ???.

Ceran 07-29-2007 11:37 AM

Quote:

Originally Posted by syg00
Umount command (against the mount point), or (physically) remove the drive ???.

Just umount. I get that error with the drive still physically connected.

Ceran 07-29-2007 11:47 AM

Quote:

Originally Posted by Ceran
Just umount. I get that error with the drive still physically connected.

I just tried using the /dev/disk/by-label/<drivelabel> path instead and that changes the label, but it also wipes out everything on the drive.

GregLee 07-29-2007 06:11 PM

If you want to stick with the msdos filesystem on the usb drive, here is a reference for how to add or change a label:
http://bradthemad.org/tech/notes/sandisk_sdmx1.php

If you want to put a linux filesystem on the device, here is an account of doing that: http://ubuntuforums.org/showthread.php?t=125990


All times are GMT -5. The time now is 09:53 AM.