fstab entries for removable hard drives
As proof I'm still relatively inexperienced, I booted my Ubuntu 8.04 fileserver without two drives that normally reside in a four-bay hot-swap SATA device and then spent two days trying to figure out why I was getting dropped to the shell with instructions to "manually repair filesystem." I finally realized that simply replacing the two missing drives resolved the problem.
Anyway, I have no real need to use the actual hot-swap ability, but I do want to be able to change drives around as needed (with the machine turned off) without different configurations causing a problem on boot up. I have UUID entries for all HDDs in the fstab: Code:
# /dev/sda1 I'd like to configure the fstab such that the system will mount removable drives it recognizes when they're present, but not stumble when they're not. Any advice appreciated! |
Try changing "UUID=xxxxxxxxx /media/sdd1 ext3 defaults,relatime 0 2" to
"/dev/sdd1 /media/sdd1 ext3 defaults,relatime 0 2" and the similar with the other drive. I found this my ubuntu server didn't complain recently when i removed a hdd mounted in this way. |
Will this approach bungle the fact that one of the physical drives needs to always be sdd and the other sde? Reversing that will screw me up. How will the system assign the dev names?
|
I would keep the UUID, but add the noauto option. This will keep it from mounting at boot. Of course, then you may have to manually mount each drive if hal or udev don't take care of it automagically.
I believe you can edit either HAL or udev config files to make it automount if plugged in, but I haven't messed with that. |
Thanks!
As in:
Code:
UUID=xxxxxxxxx /media/sdd1 ext3 defaults,relatime,noauto 0 2 |
Could I also execute a simple script that goes something like,
Code:
IF EXISTS UUID=xxxxxxxxx |
Probably. I'm lazy, I would just type mount /media/sdd1 and be done with it...
|
You know, in this case I think lazy is good, because it's also simple. At my level of expertise, I need to keep things as simple as I can. I appreciate your advice.
|
No problem. Oh yeah, if you also add the "user" option to fstab you can even mount it as your normal user. Although I think you have to have rw access to the mount point.
|
Quote:
I suggest you take a quick read through how to write udev rules: http://www.reactivated.net/writing_udev_rules.html because one day you'll need a udev rule, and if you don't know about them, or appreciate the concept ... .. . |
All times are GMT -5. The time now is 09:47 PM. |