Persistent drive naming/ID for hot swappable SATA drives
I almost had a catastrophe after pulling some SATA drives, rebooting and using my FSTAB that auto mounts sba, sbc, sbd and sbe. In my samba setup sbe is always "TB4" but when I rebooted the drive order got messed up and changed around so I almost overwrote a TB of data that I could not loose.
So, I want to identify the drive with either a folder or a specific /dev location. Is this possible? To make things easy, I created folders sba1, sbc1, sbd1, sdd1, sde1, etc in the /media folder and then I just mount the corresponding drive to that folder. They are then shared with samba with full R/W access on my windows machines. Now, I often pull drives to hook up to other machines because I can transfer 1TB of data much faster on an internal connection than on a network connection. So does anyone have any suggestions on what I should do here? Thanks for any suggestions on this! |
|
Quote:
Quote:
|
Quote:
Quote:
Look in /dev/disk for other options. Only works if you know in advance which/how many drives - which appears to be the case here. Else you're up for some udev rule writing. |
You can also use labels in fstab.
The same caveat with duplicated labels applies, as with UUID's, but with the advantage that they are human readable and can have meaning. |
But udev rules let you identify the hardware in advance and ensure what mount point it will be assigned to every time it's plugged in. Do fstab labels or UUIDs allow for that?
|
Yes, because you set the mount point in the fstab.
And the label or UUID is unique to that device (provided you set it so). For devices connected at boot anyway, it seems to achieve the same result, just in a more cryptic fashion. :) Or am I missing something magical about udev rules? I use a udev rule to automount my backup drive to it's proper mountpoint on plug in, and I don't think that can be done via just fstab without some other automount tool. |
I'm not really sure. I need to learn about the UUID method though. I use udev for all of my USB drives, etc. and it works great.
|
All times are GMT -5. The time now is 03:05 PM. |