How labels saved my life

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


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!

Author: Donncha

Donncha Ó Caoimh is a software developer at Automattic and WordPress plugin developer. He posts photos at In Photos and can also be found on Google+ and Twitter.

4 thoughts on “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. 🙂

Leave a Reply