[Techtalk] disk labels and external drives
mim at miriam-english.org
Mon Jun 28 20:53:59 UTC 2010
Nowadays I've begun using cheap external drives for archiving material.
This works well, but there is a problem. I have to be extremely careful
that I'm referring to the correct drive when handling data. Internal
drives are easy. I can refer to them as /dev/something or /mnt/something
but external drives are attached via the USB port and can be any of
several device names or mount names based, it seems, on when they were
plugged into the port.
The command e2label lets you change the disk label on a device, so I'm
wondering if there is a way to use common shell commands to access a
drive based on its disklabel. For instance, instead of
cp -a /mnt/text/linux-howtos /mnt/usb1/text
I might be able to refer to the second (or first) drive by its label.
Is that possible?
I've tried setting the disk label using gparted and it warned me that it
would delete the contents of the disk if I went ahead. Eeek! That seems
weird. I can't find anything about whether e2label deletes data on a
disk or partition, but backed up all the data on one of my smallest
internal drive partitions and tried it. It doesn't hurt the data.
(Whew!) That also answers whether it can be used on partitions as well
as just drives.
I used to be able to refer to disks (even floppy disks) by their labels
all the time on the Amiga (once upon a time). It was a nicely
human-oriented way to do things. I've been okay with the human having to
think like a machine in linux because having access to all the cool,
new, powerful tools has been well worth the compromise, but I've often
wondered about being able to access disks via their labels in linux.
These days with flash drives and external hard drives it would seem a
logical thing to be able to do.
Am I just overlooking something obvious?
If you don't have any failures then you're not trying hard enough.
- Dr. Charles Elachi, director of NASA's Jet Propulsion Laboratory
More information about the Techtalk