LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-20-2011, 04:10 AM   #1
mike11
Member
 
Registered: Apr 2009
Posts: 222

Rep: Reputation: 17
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)
Here is the udev rule I've put in /etc/udev/rules/60-local.rules:
Code:
ATTRS{vendor}=="I-O DATA", ATTR{partition}=="1", ACTION=="add", OWNER="mike", GROUP="mike", RUN="/bin/mount -o user /dev/%k /media/myusb"
Although I'm running mount with the user option, and specifying my group and user on the udev rule, I still cannot unmount the drive.

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.
 
Old 06-20-2011, 04:47 AM   #2
zakotsi
LQ Newbie
 
Registered: Jun 2011
Distribution: debian lenny, arch
Posts: 15

Rep: Reputation: Disabled
Quote:
Originally Posted by mike11 View Post
Hi,

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.
I try to avoid using automounts for removable disks as some times had similar problems.

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..

Last edited by zakotsi; 06-20-2011 at 04:57 AM.
 
Old 06-20-2011, 09:53 PM   #3
mike11
Member
 
Registered: Apr 2009
Posts: 222

Original Poster
Rep: Reputation: 17
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.
Normally,  only the superuser can mount filesystems.  However, when fstab contains the user option on a line, anybody can mount the corresponding system. Thus, given a line
/dev/cdrom  /cd  iso9660  ro,user,noauto,unhide
any user can mount the iso9660 filesystem found on his CDROM using the command
It seems the problem is that umount looks for an entry in fstab, but there is none, as udev is used for hotplugging.
A few webpages mention fstab is intended for non-removable disks, and the manpage says:
Code:
fstab - static information about the filesystems
so it's desgined for non-changing disks.

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.
 
Old 11-09-2011, 07:33 AM   #4
zakotsi
LQ Newbie
 
Registered: Jun 2011
Distribution: debian lenny, arch
Posts: 15

Rep: Reputation: Disabled
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....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian - Manually (command line) disabling USB automounts armandino Linux - General 5 02-01-2011 02:34 AM
How to manually install a debian file for debian? tekipepi Linux - Newbie 5 09-17-2009 09:19 AM
debian testing vs debian stable with testing repositories? wanas Debian 5 02-28-2009 11:23 PM
How to configure a wireless network manually in Debian Testing whistlenut Linux - Wireless Networking 4 10-24-2008 09:34 AM
Setup as getting debian testing files from ftp - will it stay with testing BrianHenderson Debian 2 09-02-2004 07:06 PM


All times are GMT -5. The time now is 07:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration