udev automounts but I cannot manually unmount: Debian Testing
Hi,
I'm using udev to automount an external usb HDD to a fixed location. This works fine, but when I try to unmount the drive, as a user, I'm getting the error: Code:
umount: /media/myusb is not in the fstab (and you are not root) Code:
ATTRS{vendor}=="I-O DATA", ATTR{partition}=="1", ACTION=="add", OWNER="mike", GROUP="mike", RUN="/bin/mount -o user /dev/%k /media/myusb" Adding an entry to /etc/fstab doesn't make sense since, as I understand, fstab is supposed to be for non-removable drives only. Any ideas?. TIA. |
Quote:
No /etc/fstab is not only for non-removable devices. If you like check my fstab for a removable usb stick (fat32): <file system>||<mount point>||<type>||<options>||<dump>||<pass> /dev/sdX||/mnt/usb_sdX||auto||rw,user,noatime,noauto||0||0 (sorry for the very bad quoting but using || as a separator was the best I could make up). I have made myself member of group user and mount is done as simple as: mount /dev/sdX If you have ext2,ext3,ext4 or any other filesystem just replace auto (in <type>) Unmount with: umount /dev/sdX I use openbox so I have no automounter running in the background, but I think using an entry similar to mine (mount point could be anything you want i.e. /mnt/sdX which you create as root but i thing you know all these...) You can also try to just make yourself member of user group and replace owner (delete group?) with "user". It might do the trick. Good luck.. |
Thanks for replying. I think "user" is not a group, but an option for the mount command, from the mount manpage:
Code:
The non-superuser mounts. A few webpages mention fstab is intended for non-removable disks, and the manpage says: Code:
fstab - static information about the filesystems So this seems like a broken end: udev can dynamically mount the device without an entry in fstab, but then I cannot unmount the device as a user since there is no entry in the fstab. I can unmount as su, but that's tedious. Any ideas?. TIA. |
Hi,
again after a long long time. If you have found a solution I am happy for you. The problem is as you say that udev gets in your way. I chose to not use it at all and solved the problem (many many times I couldn't copy content as I saw "permission denied" notifications). Unfortunately even if you enter the info I suggested in fstab If you have udev automounting the device you will not be able to unmount it (it seems udev gets the upper hand on this). A suggestion (I have not tried this): make your user member of udev group (if it exists). Best of lack.... |
All times are GMT -5. The time now is 04:49 PM. |