Mounting USB Drive to a user defined point
I would like to be able to have my portable usb drive to be mounted to a defined location ... /RemStorage.
I put the following line into fstab .. /dev/sde2 /RemStorage ext3 defaults 1 2 This works fine if I boot with the usb drive connected, if its not then everything goes pearshaped and the system goes into some repair ? mode Without that line in fstab the drive gets mounted at /mnt/sde2 and will also automount as /mnt/sde2 I know this is a bit trivial but is there some way ..hotplug configuration maybe ... to make the system mount the usb drive to the point I want .../RemStorage ? And how does it get mounted to /mnt/sde2 anyway? I could make /RemStorage a symlink to /mnt/sde2 I know but ;-))) All thoughts gratefully received Im using opensuse 12.2 64 bit |
Hotplug events are controlled by udev rules. The rules are located somewhere like /etc/ude/udev.conf, or in /etc/udev/rules.d. Do some research in your Opensuse documentation on how to write udev rules that identify the device by uuid instead of /dev/sde6. The uuid is unique to the device, whether it be disk partition are removable device.
Once the udev rule is written to identify the device, you can then write the entry in /etc/fstab, using the same uuid instead of /dev/sde6, and your desired mount point. I hope this helps. |
Do you have something on your device that the system needs and is looking for when booting? I ask, because this might explain why things are going wrong when the disk is not there.
Anyway, in order to have your device unequivocally identified by the system you should put its UUID in fstab, instead of /dev/sde2. You can see such identifier using the blkid command. Like: Code:
#~ blkid /dev/sde2 Code:
/dev/sde2: UUID="<some-ID>" TYPE="ext3" Best regards, Philip |
Thanks for the replies Philip and bigrigdriver.
Ill have a look at the udev documentation. I used blkid and started to create a fstab entry. But then I saw there was already an entry in my fstab to mount a device to /mnt/sde2! lol! Not put there by me! What is interesting though is that there was also a flag "nofail" in place of "defaults" for that entry. So I think that flag is preventing the absence of the usb drive causing a boot failure. Ive now changed that entry to mount to /RemStorage and all is well! :-) Thanks again for your replies. |
All times are GMT -5. The time now is 07:51 PM. |