How to mount harddrives via label
24 Dec 2009I followed an outdated tutorial to mount my hardrives in the fstab
with their assigned names (like /dev/hda1
). I found out the hard way that those names can change at any time, e.g. when plugging the harddrive into a different slot on the controller. I learned that it’s much safer to do this by labelling the harddrives and referencing those labels when mouting them.
First give your harddrive or partition a name:
Now you can use the label in your /etc/fstab
(Add other parameters as needed):
An uglier solution would be to reference the drives by their UUIDs but it will make fstab
a lot less readable and editing it after a while might get confusing.
The upside of this is: If you hook up a new harddrive to your controller or if you swap them, the system will still mount them into the right directories.