Fedora Linux Support Community & Resources Center
  #1  
Old 9th February 2011, 10:31 PM
rossman_2 Offline
Registered User
 
Join Date: Dec 2008
Posts: 48
linuxchrome
Ejecting USB NTFS drives

Not sure where to put this so please let me know if this does not belong here.

I recently noticed that the "eject" command will not work on NTFS formatted USB drives. It errors out with something like:

umount: <path to mount point> is not in fstab (and you are not root)

It works if you are root. I can also eject the drive from the nautilus desktop as an unprivileged user. This command also works if the drive is FAT formatted and I am an unprivileged user.

I only started to notice this behavior after I switch to F14. F11, F12, and F13 did not seem to have this issue.

Anyone have any clues as to how to fix this?

BTW, auto-mounting works just fine, just plug the drive in (no "mount" command necessary). I'm only having issues with the "eject" command as an unprivileged user.
Reply With Quote
  #2  
Old 15th February 2011, 01:57 AM
rossman_2 Offline
Registered User
 
Join Date: Dec 2008
Posts: 48
linuxchrome
Re: Ejecting USB NTFS drives

Giving this a bump, just so I don't have to repost.

Is this a known problem?
Reply With Quote
  #3  
Old 15th February 2011, 02:31 AM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,101
linuxfedorafirefox
Re: Ejecting USB NTFS drives

Try "eject -v <device>" to see what is going on. I think it must be
the real device and not the mount point.

It is possible that because disks (even when used through the USB) do
not support the eject directly. I know I have had problems with eject
not working, but would work fine if the device is dismounted (well... there
would be nothing to do in this case).
Reply With Quote
  #4  
Old 15th February 2011, 07:15 AM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
linuxfedorafirefox
Re: Ejecting USB NTFS drives

Quote:
Originally Posted by rossman_2 View Post
Giving this a bump, just so I don't have to repost.

Is this a known problem?
Try it and I will delete it
Reply With Quote
  #5  
Old 15th February 2011, 08:18 PM
rossman_2 Offline
Registered User
 
Join Date: Dec 2008
Posts: 48
linuxchrome
Re: Ejecting USB NTFS drives

When I run eject with a -v on the mount point I get the following:

Code:
$ eject -v /media/SmallDisk/
eject: device name is `/media/SmallDisk'
eject: expanded name is `/media/SmallDisk'
eject: `/dev/sdb1' is mounted at `/media/SmallDisk'
eject: checking if device "/dev/sdb1" has a removable or hotpluggable flag
eject: unmounting device `/dev/sdb1' from `/media/SmallDisk'
umount: /media/SmallDisk is not in the fstab (and you are not root)
eject: unmount of `/media/SmallDisk' failed
When I run eject with a -v on the actual device I get this:

Code:
$ eject -v /dev/sdb1
eject: device name is `/dev/sdb1'
eject: expanded name is `/dev/sdb1'
eject: `/dev/sdb1' is mounted at `/media/SmallDisk'
eject: checking if device "/dev/sdb1" has a removable or hotpluggable flag
eject: unmounting device `/dev/sdb1' from `/media/SmallDisk'
umount: /media/SmallDisk is not in the fstab (and you are not root)
eject: unmount of `/media/SmallDisk' failed
Again this only happens if I run eject as a regular user. Also, the ejecting the drive with the nautilus menu works fine as a regular user. And this only seems to happen with NTFS file systems, as far as I can tell.
Reply With Quote
  #6  
Old 15th February 2011, 09:00 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,101
linuxfedorafirefox
Re: Ejecting USB NTFS drives

No, it happens with other types of mounts too.

The requirement is that the drive be dismounted. If the filesystem layer
takes too long, or, the application doesn't know how to dismount, an
eject SHOULD fail.

In this case, it doesn't know how to dismount (not in fstab). It also can't
dismount as you are not root - which is the other way to dismount.
The root restriction is because if any user could unmount a filesystem
(when not the owner of the device) then you get a security problem -
all the way from a denial of service, to hijacking data on someone elses
disk.

How did you mount the disk? Manually?
Reply With Quote
  #7  
Old 15th February 2011, 09:28 PM
rossman_2 Offline
Registered User
 
Join Date: Dec 2008
Posts: 48
linuxchrome
Re: Ejecting USB NTFS drives

I'm logged into the desktop locally (through gnome) so I just plugged the drive in (it's USB) and it auto mounts. I've tried this with 2 different NTFS formatted drives and they give the same result, so I'm pretty sure it's not the drive. However, FAT32 formatted USB drives do not have this problem (I can use "eject" as an unprivileged user to unmount the drive).
Reply With Quote
  #8  
Old 15th February 2011, 09:28 PM
rossman_2 Offline
Registered User
 
Join Date: Dec 2008
Posts: 48
linuxchrome
Re: Ejecting USB NTFS drives

I'm logged into the desktop locally (through gnome) so I just plugged the drive in (it's USB) and it auto mounts. I've tried this with 2 different NTFS formatted drives and they give the same result, so I'm pretty sure it's not the drive. However, FAT32 formatted USB drives do not have this problem (I can use "eject" as an unprivileged user to unmount the drive).
Reply With Quote
  #9  
Old 15th February 2011, 09:43 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,101
linuxfedorafirefox
Re: Ejecting USB NTFS drives

I now suspect this is a bug, since it seems to be only NTFS related.

I thought it might have been mounted as root, but automounting on
connection should make it owned by the GUI logged in user.

Out of curiosity, what does "mount" show for this drive? if it shows
something like "mode=777", then it quite possibly is mounted as root,
but it should show something like "uid=<nnn>,gid=<nnn>", which would
allow you to dismount it using eject (at least it does for me).
Reply With Quote
  #10  
Old 15th February 2011, 10:04 PM
rossman_2 Offline
Registered User
 
Join Date: Dec 2008
Posts: 48
linuxchrome
Re: Ejecting USB NTFS drives

Not sure what you mean by "mount" as when I run the "mount" command it doesn't display anything like what you're describing.

I can tell you that when I "ls" the mount point it shows it as being owned by me (unprivileged user and group) and that the mode is "700" or "drwx------".
Reply With Quote
  #11  
Old 15th February 2011, 10:04 PM
rossman_2 Offline
Registered User
 
Join Date: Dec 2008
Posts: 48
linuxchrome
Re: Ejecting USB NTFS drives

Not sure what you mean by "mount" as when I run the "mount" command it doesn't display anything like what you're describing.

I can tell you that when I "ls" the mount point it shows it as being owned by me (unprivileged user and group) and that the mode is "700" or "drwx------".
Reply With Quote
  #12  
Old 15th February 2011, 10:08 PM
scott32746 Offline
Registered User
 
Join Date: Jun 2007
Location: Lake Mary, Florida
Age: 48
Posts: 1,082
windows_xp_2003firefox
Re: Ejecting USB NTFS drives

Hello,

Never used eject on nfs mounts.
Only used eject on my DVD drive and umount on mounted FS
Reply With Quote
  #13  
Old 15th February 2011, 10:28 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,101
linuxfedorafirefox
Re: Ejecting USB NTFS drives

The mount command will list all mounted partitions, with device, filesystem
and mount options.

I was just curious what it showed for the NTFS system.

---------- Post added at 05:28 PM ---------- Previous post was at 05:25 PM ----------

Quote:
Originally Posted by scott32746 View Post
Hello,

Never used eject on nfs mounts.
Only used eject on my DVD drive and umount on mounted FS
The only reason to use it is for external USB drives. For that
you SHOULD get the equivalent action that occurs with the
CD/DVD - the filesystem is unmounted, and buffers released.

Just some USB drives (such as flash, or USB disk adapters) don't
have a physical function for eject, doesn't prevent the command
from trying. But to do it, the user must have ownership of the
device...
Reply With Quote
  #14  
Old 16th February 2011, 05:31 AM
Mariusz W Offline
Registered User
 
Join Date: Nov 2007
Location: Berkeley, California
Posts: 690
windows_vistaarora
Re: Ejecting USB NTFS drives

Quote:
Originally Posted by rossman_2 View Post
I'm logged into the desktop locally (through gnome) so I just plugged the drive in (it's USB) and it auto mounts. I've tried this with 2 different NTFS formatted drives and they give the same result, so I'm pretty sure it's not the drive. However, FAT32 formatted USB drives do not have this problem (I can use "eject" as an unprivileged user to unmount the drive).
I do not use eject to dismount USB drives so I cannot say whether what you are reporting is a bug or not. Your disk is most likely being mounted by udisks. This is the latest incarnation of DeviceKit, so this may explain why the behavior you are observing now differs from previous Fedora releases. You can unmount USB disks, which are automounted when you plug them in – by executing

Code:
udisks --umount /dev/sd<letter>1

Last edited by Mariusz W; 16th February 2011 at 07:12 AM.
Reply With Quote
Reply

Tags
fstab, ntfs, usb

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting NTFS drives madpro Installation and Live Media 3 10th April 2009 02:49 PM
NTFS External Drives sven_henson Hardware & Laptops 6 14th March 2007 01:53 AM
Mounting NTFS drives lazerid Using Fedora 17 8th March 2007 07:51 PM
Cant Mount NTFS Drives! NTFS driver not working? borbs Hardware & Laptops 6 29th November 2006 09:36 PM
Shares and NTFS drives ybnorml Using Fedora 5 18th August 2005 02:59 AM


Current GMT-time: 03:18 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat