August 24th, 2007

How labels saved my life

Linux, by Donncha.

Well, they made it easier. Saved might be a little strong. When using a Unix based system you use a file called /etc/fstab to designate all the hard drives and external storage like flash cards and where they will mount or live on your filesystem. It’s not quite like the Windows world where everything has a drive letter, although you can use SUBST to get a similar effect on that operating system.

/etc/fstab is easy to maintain when all your drives stay in one place, but since I’m using 3 external drives and a card reader, sometimes the device name /dev/sdX changes for each. It’s horribly frustrating changing entries in fstab just because the card reader wasn’t plugged in when the computer booted into Ubuntu Linux

That all changed when I assigned labels to each drive. Now fstab entries reference those labels instead of devices! The following line,

/dev/sdc1 /media/disk auto rw,user,noauto 0 0

becomes

LABEL=DATA /media/disk auto rw,user,noauto 0 0

So, even if the device changes from sdc1 to sdd1 /media/disk will always mount!

Here’s a great tutorial on how to assign labels to disks, and how to modify your /etc/fstab to support them. It might seem like a pain at first but it’s well worth it!

You might also like

If you like this post then please subscribe to my full RSS feed. You can also click here to subscribe by email. There are also my fabulous photos and funny videos to explore too!

Back Top

Responses to “How labels saved my life”

  1. What always used to annoy me was how you couldn’t label swap through installer tools. I haven’t checked it lately but there was a time when you could label standard FS partitions but when you added SCSI devices and rebooted the bloody swap partition would jump targets and the system would have a crap attack on boot.

  2. I’ve just started downloading the latest Ubuntu Ultimate Virtual Appliance via a torrent. I’ll run it in VMware Player and see what I think. :)

  3. I think you’ll like it!

  4. Ubuntu from edgy upwards uses UUIDs to do the same thing.

    Liam Bedford at August 26, 2007 9:28 pm
  1. No trackbacks yet.

Leave a Reply

Back Top


Holy Shmoly! is Digg proof thanks to caching by WP Super Cache