Cannot umount ntfs-3g without root prvilege.

Eric L. Chen d9364104 at mail.nchu.edu.tw
Mon Feb 9 00:46:07 PST 2009


Hi,

I followed http://www.freebsd.org/gnome, try to mount usb disk (ntfs
formatted).
It can be mounted, but cannot umount.
We need ntfs usb disk for large file, since fat cannot support file that
greater than 2GiB.
BTW, I am using ntfs-3g for NTFS read/write support.

#
cat /usr/local/share/hal/fdi/policy/20thirdparty/20-storage-ntfs-3g.fdi 
<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
  <device>
      <!-- allow these mount options for ntfs-3g -->
      <match key="volume.fstype" string="ntfs">
        <match key="@block.storage_device:storage.hotpluggable"
bool="true">
          <append key="volume.mount.valid_options"
type="strlist">force</append>
	  <append key="volume.mount.valid_options"
type="strlist">remove_hiberfile</append>
	  <append key="volume.mount.valid_options" type="strlist">uid=</append>
	  <append key="volume.mount.valid_options" type="strlist">gid=</append>
	  <append key="volume.mount.valid_options"
type="strlist">umask=</append>
	  <append key="volume.mount.valid_options"
type="strlist">fmask=</append>
	  <append key="volume.mount.valid_options"
type="strlist">dmask=</append>
	  <append key="volume.mount.valid_options"
type="strlist">streams_interface=</append>
	</match>
      </match>
  </device>
</deviceinfo>

------------------ sysctl -b kern.geom.conftxt
----------------------------------------
# sysctl -b kern.geom.conftxt
0 DISK da0 20003880960 512 hd 255 sc 63
1 MBR da0s1 19995623424 512 i 0 o 32256 ty 7
2 LABEL ntfs/usbdisk 19995623424 512 i 0 o 0
0 DISK cd0 0 2048 hd 0 sc 0
0 DISK ad0 60011642880 512 hd 16 sc 63
1 PART ad0p3 57327188480 512 i 3 o 2684437504 ty freebsd-ufs xs GPT xt
516e7cb6-6ecf-11d6-8ff8-00022d09712b
1 PART ad0p2 2684354560 512 i 2 o 82944 ty freebsd-swap xs GPT xt
516e7cb5-6ecf-11d6-8ff8-00022d09712b
1 PART ad0p1 65536 512 i 1 o 17408 ty freebsd-boot xs GPT xt
83bd6b9d-7f41-11dc-be0b-001560b84f0f
0 MD md0 67108864 512 u 0 s 512 f 0 fs 0 l 67108864 t swap

------------------ output of gnome-mount
----------------------------------------
# gnome-mount -v -n -b
-h /org/freedesktop/Hal/devices/volume_uuid_0A803ABD803AAF57
gnome-mount 0.8
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
** (gnome-mount:9685): DEBUG:
Mounting /org/freedesktop/Hal/devices/volume_uuid_0A803ABD803AAF57
** (gnome-mount:9685): DEBUG: read default option 'umask=007' from gconf
strlist key /system/storage/default_options/ntfs-3g/mount_options
** (gnome-mount:9685): DEBUG: read default option 'dmask=002' from gconf
strlist key /system/storage/default_options/ntfs-3g/mount_options
** (gnome-mount:9685): DEBUG: read default option 'fmask=117' from gconf
strlist key /system/storage/default_options/ntfs-3g/mount_options
** (gnome-mount:9685): DEBUG: read default option 'remove_hiberfile'
from gconf strlist
key /system/storage/default_options/ntfs-3g/mount_options
** (gnome-mount:9685): DEBUG:
Mounting /org/freedesktop/Hal/devices/volume_uuid_0A803ABD803AAF57 with
mount_point='usbdisk', fstype='ntfs-3g', num_options=4
** (gnome-mount:9685): DEBUG:   option='umask=007'
** (gnome-mount:9685): DEBUG:   option='dmask=002'
** (gnome-mount:9685): DEBUG:   option='fmask=117'
** (gnome-mount:9685): DEBUG:   option='remove_hiberfile'

------------------ output of hald
----------------------------------------
16:07:20.101 [I] hald_dbus.c:5127: OK for method 'Mount' with signature
'ssas' on interface 'org.freedesktop.Hal.Device.Volume' for UDI
'/org/freedesktop/Hal/devices/volume_uuid_0A803ABD803AAF57' and execpath
'hal-storage-mount'
16:07:20.101 [I] hald_dbus.c:4018: no need to enqueue
Run started hal-storage-mount (0) (1) 
!  full path is '/usr/local/libexec/hal-storage-mount', program_dir is
'/usr/local/libexec'
9686: XYA attempting to get lock on /media/.hal-mtab-lock
9686: XYA got lock on /media/.hal-mtab-lock
device                           = /dev/ntfs/usbdisk
invoked by uid                   = 1001
invoked by system bus connection = :1.130
 label 'usbdisk'  uuid '0A803ABD803AAF57'
Looking at /etc/fstab entry '/dev/ad0p2'
/etc/fstab: device /dev/ad0p2 -> /dev/ad0p2 
Looking at /etc/fstab entry '/dev/ad0p3'
/etc/fstab: device /dev/ad0p3 -> /dev/ad0p3 
Looking at /etc/fstab entry 'proc'
/etc/fstab: device proc -> proc 
Looking at /etc/fstab entry 'linproc'
/etc/fstab: device linproc -> linproc 
mount_point    = 'usbdisk'
mount_fstype   = 'ntfs-3g'
mount_options  = 'umask=007	dmask=002	fmask=117	remove_hiberfile	'
trying dir /media/usbdisk
given_options[0] = 'umask=007'
given_options[1] = 'dmask=002'
given_options[2] = 'fmask=117'
given_options[3] = 'remove_hiberfile'
allowed_options[0] = 'ro'
allowed_options[1] = 'noexec'
allowed_options[2] = 'noatime'
allowed_options[3] = '-u='
allowed_options[4] = '-g='
allowed_options[5] = '-m='
allowed_options[6] = '-a'
allowed_options[7] = '-i'
allowed_options[8] = '-C='
allowed_options[9] = '-W='
allowed_options[10] = 'force'
allowed_options[11] = 'remove_hiberfile'
allowed_options[12] = 'uid='
allowed_options[13] = 'gid='
allowed_options[14] = 'umask='
allowed_options[15] = 'fmask='
allowed_options[16] = 'dmask='
allowed_options[17] = 'streams_interface='
using action org.freedesktop.hal.storage.mount-removable for uid 1001,
system_bus_connection :1.130
passed privilege
9686: XYA creating /media/.hal-mtab~
9686: XYA closing /media/.hal-mtab~
16:07:20.160 [I] device.c:1894: Removing locks from ':1.132'
9686: XYA done renaming /media/.hal-mtab~ to /media/.hal-mtab
9686: XYA released lock on /media/.hal-mtab-lock
pid 9686: rc=0 signaled=0: /usr/local/libexec/hal-storage-mount
16:07:20.809 [I] device.c:1894: Removing locks from ':1.131'
16:07:20.810 [I] hald_dbus.c:4042: No more methods in queue
16:07:20.817 [I] ci-tracker.c:212: Removing CICallerInfo object
for :1.130
16:07:20.817 [I] device.c:1894: Removing locks from ':1.130'

------------------ output of gnome-mount
----------------------------------------
# gnome-mount -v -u -n -b
-h /org/freedesktop/Hal/devices/volume_uuid_0A803ABD803AAF57
gnome-mount 0.8
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
Xlib:  extension "Generic Event Extension" missing on display ":0.0".
** (gnome-mount:9698): DEBUG:
Unmounting /org/freedesktop/Hal/devices/volume_uuid_0A803ABD803AAF57
** (gnome-mount:9698): DEBUG: Setting up 750ms timer for Flushing Cache
dialog
** (gnome-mount:9698): DEBUG: in unmount_done : user_data = 0x0
** Message: Unmount failed
for /org/freedesktop/Hal/devices/volume_uuid_0A803ABD803AAF57:
org.freedesktop.Hal.Device.Volume.NotMounted : According to HAL, the
volume is not mounted

------------------ output of hald
----------------------------------------
16:08:10.744 [I] hald_dbus.c:5127: OK for method 'Unmount' with
signature 'as' on interface 'org.freedesktop.Hal.Device.Volume' for UDI
'/org/freedesktop/Hal/devices/volume_uuid_0A803ABD803AAF57' and execpath
'hal-storage-unmount'
16:08:10.744 [I] hald_dbus.c:4018: no need to enqueue
Run started hal-storage-unmount (0) (1) 
!  full path is '/usr/local/libexec/hal-storage-unmount', program_dir is
'/usr/local/libexec'
9699: XYA attempting to get lock on /media/.hal-mtab-lock
9699: XYA got lock on /media/.hal-mtab-lock
unmount_options  = ''
device                           = /dev/ntfs/usbdisk
invoked by uid                   = 1001
invoked by system bus connection = :1.133
pid 9699: rc=1 signaled=0: /usr/local/libexec/hal-storage-unmount
16:08:10.805 [I] device.c:1894: Removing locks from ':1.134'
16:08:10.805 [I] hald_dbus.c:4042: No more methods in queue
16:08:10.805 [I] hald_dbus.c:4050: Refreshing mount state
for /org/freedesktop/Hal/devices/volume_uuid_0A803ABD803AAF57 since
Unmount() completed
16:08:10.805 [I] hald_dbus.c:4105: failed with
'org.freedesktop.Hal.Device.Volume.NotMounted' 'According to HAL, the
volume is not mounted'
16:08:10.833 [I] ci-tracker.c:212: Removing CICallerInfo object
for :1.133
16:08:10.833 [I] device.c:1894: Removing locks from ':1.133'

It can umount with root privilege, for example:
# sudo umount /media/usbdisk && sudo rm -r /media/usbdisk

# df
Filesystem    Size    Used   Avail Capacity  Mounted on
/dev/ad0p3     52G     22G     26G    46%    /
devfs         1.0K    1.0K      0B   100%    /dev
procfs        4.0K    4.0K      0B   100%    /proc
linprocfs     4.0K    4.0K      0B   100%    /usr/compat/linux/proc
/dev/md0       62M     18K     57M     0%    /tmp
/dev/fuse0      0B      0B      0B   100%    /home/lihong/.gvfs
/dev/fuse1     19G    6.0G     13G    32%    /media/usbdisk

The 'df' command shows that "media/usbdiak" is mounted from /dev/fuse1
not /dev/ntfs/usbdisk, I think this is why I cannot umount it.

/Eric




More information about the freebsd-gnome mailing list