Renaming volumes

Kay Sievers kay.sievers at vrfy.org
Fri Mar 23 10:50:32 PDT 2007


On 3/23/07, Richard Hughes <hughsient at gmail.com> wrote:
> Today my friend gave me a usb key and asked me to rename the volume name
> of the disk so it got mounted with a sensible name.
>
> <bzzz>Nope, I can't do that in the GUI.
>
> What about adding to the .Volume namespace in HAL to support renaming
> volumes? I appreciate we don't want to rename partitions on fixed disks,
> but what about just removable volumes?

You can only set the label of a fat filesystem while it's not mounted,
otherwise you can't be sure that the directory will not be corrupted
during that operation. The only sane solution would be kernel
filesystem-support for setting such labels.

I don't know what Linux tool can change the directory volume-name for
fat. Some of the old tools just write to the fat header, which is
ignored when a directory volume-name is already set (Windows uses
directory volume-names).

So, if you find a tool that can change the fat directory volume-name,
you may unmount the volume, make sure it's nowhere else mounted,
change the label, trigger a udev-event, so that current symlinks get
updated, ask hal to reprobe() the device and then remount it.

With other filesystems, you may be able to change the label while its
mounted, but it's still a bit unsafe to write to the raw block device
of a mounted filesytem.

Kay


More information about the hal mailing list