[Techtalk] disk labels and external drives

Joana Botto joana.botto at gmail.com
Mon Jun 28 21:13:23 UTC 2010


Hi Miriam,

The UUID of a hard disk can be used to identify a device independent of its
device name or mount point and you can have a static entry on your fstab.
You can get the UUID with $ ls -l /dev/disk/by-uuid

I hope this helps.

Regards,
Joana Botto

On Mon, Jun 28, 2010 at 9:53 PM, Miriam English <mim at miriam-english.org>wrote:

> 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?
>
> Cheers,
>
>        - Miriam
>
> --
> If you don't have any failures then you're not trying hard enough.
>  - Dr. Charles Elachi, director of NASA's Jet Propulsion Laboratory
> -----
> Website: http://miriam-english.org
> Blog: http://miriam_e.livejournal.com
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/techtalk
>


More information about the Techtalk mailing list