Mount a hdd by label?

Red Squirrel

No Lifer
May 24, 2003
70,690
13,844
126
www.anyf.ca
Is there a way I can set a label on a HDD and mount it to a certain location by label, through a script?

Normally to mount you have to specify like /dev/sdb1 or what not, but I want to go by label in case the order changes.

The idea is I want to use a drive docking station for backups so I want to label all my backup drives the same, and I want to be able to put one in, run a script and it will automaticly go to THAT drive, even if there is already another drive plugged in or that the order changed for some reason.

Is this doable?
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
Oh yea, I should of remembered that, I used that once in fstab to force the mounting of a usb device at boot.