Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 130366

Summary: ivman-0.6.11 tries to mount allready mounted devices
Product: Gentoo Linux Reporter: f5d8fd51ed1e804c9e8d0357e8614e0493b06e96
Component: [OLD] UnspecifiedAssignee: Stefan Schweizer (RETIRED) <genstef>
Status: RESOLVED UPSTREAM    
Severity: normal CC: abhay.ilugd, furlongm, ignoreme, joliveirinha, rohan, sanchan
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description f5d8fd51ed1e804c9e8d0357e8614e0493b06e96 2006-04-18 07:31:10 UTC
here the scenario:
I boot my gentoo from an external USB harddisk - thus I have it allready mounted when ivman gets started.

result:
therion aaron # /etc/init.d/ivman start
 * Starting Automounter ...
Warning: device /dev/sda3 is already handled by /etc/fstab, supplied label is ignored
mount: /dev/sda3 is allready mounted or / is allready in use
mount: According to mtab /dev/sda3 is allready mounted at /
Comment 1 Rohan McGovern 2006-04-18 15:42:01 UTC
Try adding this to /etc/ivman/IvmConfigActions.xml, right before the final "</ivm:ActionsConfig>":

    <ivm:Match name="hal.volume.is_mounted" value="true">
        <ivm:Option name="mount" value="false" />
    </ivm:Match>

By the way, does this ever actually harm anything, or just result in some unwanted output? :-)
Comment 2 f5d8fd51ed1e804c9e8d0357e8614e0493b06e96 2006-04-18 23:10:10 UTC
Your suggested change to the config fixes the issue.

If the problem causes any harm besides unwanted output?
IMHO it does - it causes a 10-15 second delay while starting up ivman.
Comment 3 Rohan McGovern 2006-04-18 23:16:53 UTC
OK, thanks.  I will either hardcode this behaviour or stick it in the default configs for the next version of Ivman.
Comment 4 Abhay Kedia 2006-04-19 14:30:05 UTC
(In reply to comment #1)
The solution didn't work for me. I don't know why.
Instead I had to change 
    <ivm:Match name="ivm.mountable" value="true">
to
    <ivm:Match name="hal.volume.mountable" value="true">
where it says "try to mount any mountable volume at all".

Why does the actions file ask ivm about the mountable state of volumes instead of HAL? Wouldn't asking HAL be the better choice, or am I thinking on wrong lines?
Comment 5 Rohan McGovern 2006-04-19 18:32:52 UTC
(In reply to comment #4)
> (In reply to comment #1)
> The solution didn't work for me. I don't know why.
> Instead I had to change 
>     <ivm:Match name="ivm.mountable" value="true">
> to
>     <ivm:Match name="hal.volume.mountable" value="true">
> where it says "try to mount any mountable volume at all".

Where did you get volume.mountable from?  I do not have that property defined for any of my devices, nor is it in the HAL spec at 
http://webcvs.freedesktop.org/*checkout*/hal/hal/doc/spec/hal-spec.html .  If it did exist in some version of HAL, it's been removed now, so the above rule would do nothing.

> 
> Why does the actions file ask ivm about the mountable state of volumes instead
> of HAL? Wouldn't asking HAL be the better choice, or am I thinking on wrong
> lines?
> 

Asking HAL would be better, but AFAIK there is no property which clearly and concisely indicates if a volume is mountable.  In fact, with the newer releases of HAL removing volume.policy.* and storage.policy.*, programs like Ivman are being forced to implement policies themselves, which is not fun.
Comment 6 Abhay Kedia 2006-04-19 23:18:40 UTC
(In reply to comment #5)
>
> Where did you get volume.mountable from?  I do not have that property
> defined for any of my devices, nor is it in the HAL spec at
> http://webcvs.freedesktop.org/*checkout*/hal/hal/doc/spec/hal-spec.html . 
> If it did exist in some version of HAL, it's been removed now, so the above
> rule would do nothing.
>
I don't know where it came from but ivm.volume.mountable has always been there 
in the actions file. The solution you provided didn't work for me, so it was 
more of a guess work that changing ivm to hal might work. If this rule 
doesn't mean anything then I don't know what took the errors away. If you 
want, I can provide actions file for you to check (though it doesn't have anything but this one rule).
Comment 7 Rohan McGovern 2006-04-19 23:32:46 UTC
Your change would take the errors away, but would disable automounting altogether; it is equivalent to deleting or commenting out the original lines.

The only defined properties beginning with 'hal.*' are those which appear in the HAL spec, and the only relevant ones are those which appear in the output of 'lshal'.  Properties beginning with 'ivm.*' are handled by logic internal to Ivman, and they are all documented in the man pages for the config files (man IvmConfigActions.xml).
Comment 8 Abhay Kedia 2006-04-20 00:23:32 UTC
Oh! Then may be KDE is doing the job of automounting for me right now. After your comment I have commented the whole part and it still works. I'll keep it that way for the time being then. Thanks.
Comment 9 Marcus Furlong 2006-04-20 09:00:27 UTC
Here is what I get with ivman-0.6.11:

parnell furlongm # /etc/init.d/ivman start]
 * Starting Automounter ...
Error: device /dev/sda6 is not removable                    

sda6 is a partition on my hard disk that I use for playing with filesystems, mounting on /var/tmp/portage if I run out of space, etc. it's not in fstab because I don't want it automounted. With 0.6.10 there was no problem. There is also a 10 second wait now when starting ivman.
Comment 10 Rohan McGovern 2006-04-20 17:14:15 UTC
Please try Ivman 0.6.12, just released.  You can bump the ebuild version by simply renaming it to ivman-0.6.12.ebuild.  Olaf, this should fix the problem you are experiencing without needing any extra lines in IvmConfigActions.xml.

Comment #9 (Marcus): I think your problem is different.  Ivman believes that you want /dev/sda6 mounted, but this has never been a problem in the past because you never attached/removed it while Ivman is running.
Is /dev/sda a removable hard disk?  If so, you need to blacklist /dev/sda6 in IvmConfigActions.xml (you just need to uncomment and change the /dev/camera example in that file).  Not having an fstab entry for /dev/sda6 does NOT tell Ivman that you don't want it mounted.
If /dev/sda is NOT removable, then there is probably a problem with your HAL configs, as HAL is already supposed to tell Ivman that non-removable disks shouldn't be mounted.  if you are using HAL 0.5.5, then try upgrading to HAL 0.5.7, and if you are using HAL 0.5.7, then please show the output of the following command:

  lshal -lu $(hal-find-by-property --key block.device --string /dev/sda6)

Also, as a workaround, you can comment/remove the following line in IvmConfigActions.xml to return to Ivman 0.6.10 behaviour of not mounting anything on startup:

  <ivm:Option name="checkOnInit" value="true" />

Comment 11 Marcus Furlong 2006-04-20 18:31:00 UTC
> Is /dev/sda a removable hard disk?  If so, you need to blacklist /dev/sda6 in
> IvmConfigActions.xml (you just need to uncomment and change the /dev/camera
> example in that file).  Not having an fstab entry for /dev/sda6 does NOT tell
> Ivman that you don't want it mounted.

It is not removable, it's my main disk.

> If /dev/sda is NOT removable, then there is probably a problem with your HAL
> configs, as HAL is already supposed to tell Ivman that non-removable disks
> shouldn't be mounted.  if you are using HAL 0.5.5, then try upgrading to HAL
> 0.5.7, and if you are using HAL 0.5.7, then please show the output of the
> following command:
> 
>   lshal -lu $(hal-find-by-property --key block.device --string /dev/sda6)

Upgraded to hal 0.5.7 and the problem is still there unfortunately. Here's the lshal output:
udi = '/org/freedesktop/Hal/devices/volume_uuid_ab2088a0_063b_48e8_a8b2_c0a126e030c3'
  volume.unmount.valid_options = {'lazy'} (string list)
  volume.mount.valid_options = {'ro', 'sync', 'dirsync', 'noatime', 'nodiratime', 'noexec', 'quiet'} (string list)
  org.freedesktop.Hal.Device.Volume.method_execpaths = {'hal-system-storage-mount', 'hal-system-storage-unmount', 'hal-system-storage-eject'} (string list)
  org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'} (string list)
  org.freedesktop.Hal.Device.Volume.method_names = {'Mount', 'Unmount', 'Eject'} (string list)
  info.interfaces = {'org.freedesktop.Hal.Device.Volume'} (string list)
  volume.ignore = true  (bool)
  volume.policy.desired_mount_point = 'scsidisk'  (string)
  volume.policy.mount_filesystem = 'reiserfs'  (string)
  volume.policy.should_mount = true  (bool)
  info.udi = '/org/freedesktop/Hal/devices/volume_uuid_ab2088a0_063b_48e8_a8b2_c0a126e030c3'  (string)
  volume.partition.msdos_part_table_type = 131  (0x83)  (int)
  info.product = 'Volume (reiserfs)'  (string)
  volume.size = 7065483264  (0x1a522b800)  (uint64)
  volume.num_blocks = 13799772  (0xd2915c)  (int)
  volume.block_size = 512  (0x200)  (int)
  volume.partition.number = 6  (0x6)  (int)
  info.capabilities = {'volume', 'block'} (string list)
  info.category = 'volume'  (string)
  volume.is_partition = true  (bool)
  volume.is_disc = false  (bool)
  volume.is_mounted = false  (bool)
  volume.mount_point = ''  (string)
  volume.label = ''  (string)
  volume.uuid = 'ab2088a0-063b-48e8-a8b2-c0a126e030c3'  (string)
  volume.fsversion = '3.6'  (string)
  volume.fsusage = 'filesystem'  (string)
  volume.fstype = 'reiserfs'  (string)
  storage.model = ''  (string)
  block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_SATA_TOSHIBA_MK8026G_X51G2677T'  (string)
  block.is_volume = true  (bool)
  block.minor = 6  (0x6)  (int)
  block.major = 8  (0x8)  (int)
  block.device = '/dev/sda6'  (string)
  linux.hotplug_type = 3  (0x3)  (int)
  info.parent = '/org/freedesktop/Hal/devices/storage_serial_SATA_TOSHIBA_MK8026G_X51G2677T'  (string)
  linux.sysfs_path_device = '/sys/block/sda/sda6'  (string)
  linux.sysfs_path = '/sys/block/sda/sda6'  (string)

> Also, as a workaround, you can comment/remove the following line in
> IvmConfigActions.xml to return to Ivman 0.6.10 behaviour of not mounting
> anything on startup:
> 
>   <ivm:Option name="checkOnInit" value="true" />

Should this not be the default behaviour? Part of the 10-second wait while booting is due to mounting external hard disks/pendrives if they are plugged in already.

Also, I now have a problem with a FAT32 partition that mounts at boot time, but I cannot access as a user without unmounting (as root) and then disconnecting/reconnecting USB. Could that be something to do with the volume label containing a '|' character? Directory permissions are as follows:

drwxrwx--- 15 root root 49152 1970-01-01 01:00 /media/Backup|FDOS
Comment 12 Marcus Furlong 2006-04-20 18:47:16 UTC
(In reply to comment #11)

> Also, I now have a problem with a FAT32 partition that mounts at boot time, but
> I cannot access as a user without unmounting (as root) and then
> disconnecting/reconnecting USB. Could that be something to do with the volume
> label containing a '|' character? Directory permissions are as follows:
> 
> drwxrwx--- 15 root root 49152 1970-01-01 01:00 /media/Backup|FDOS

OK, this seems to be just a result of automounting things at boot, I get the same thing from a usb pen drive, I just hadn't checked it. ivman at boot gives these errors with a pen drive and an external hard disk attached. 

* Starting Automounter ...
Error: device /dev/sda6 is not removable
Error: directory /media/usbdisk is not empty
mount: unknown filesystem type 'jfs'                                                                                      [ ok ]

Seems it's trying to reuse the usbdisk directory, and the pen drive doesn't get mounted. So I didn't notice the above, as I was mounting the second pen drive as user from the DE.
Comment 13 Rohan McGovern 2006-04-20 19:05:54 UTC
(In reply to comment #11)
> Upgraded to hal 0.5.7 and the problem is still there unfortunately. Here's the
> lshal output:
> udi =
> '/org/freedesktop/Hal/devices/volume_uuid_ab2088a0_063b_48e8_a8b2_c0a126e030c3'
<snip>

Yes, you definitely have HAL config issues.  See the line:
 volume.policy.should_mount = true

This says that automounters should mount this volume.  This property should definitely not be present on HAL 0.5.7.  Please make sure you have done etc-update correctly and restarted hald afterwards.  Also check /etc/hal/fdi/policy and /usr/share/hal/fdi/policy for outdated rules and remove them; I think the location of the HAL config directory changed at one point, which could result in outdated rules hanging around.

> 
> > Also, as a workaround, you can comment/remove the following line in
> > IvmConfigActions.xml to return to Ivman 0.6.10 behaviour of not mounting
> > anything on startup:
> > 
> >   <ivm:Option name="checkOnInit" value="true" />
> 
> Should this not be the default behaviour? Part of the 10-second wait while
> booting is due to mounting external hard disks/pendrives if they are plugged in
> already.
It should be the default if and only if most users want that feature, and I have no idea if that is the case or not, so I guessed.  The 10 second wait should not occur in Ivman 0.6.12, please let me know if it does.  Also the code can be refactored to remove any delay even if mounts fail; I will probably do that for Ivman 0.6.13.

(In reply to comment #11)
> Seems it's trying to reuse the usbdisk directory, and the pen drive doesn't
> get mounted. So I didn't notice the above, as I was mounting the second pen
> drive as user from the DE.

Hmm, that is odd.
1) do you have an fstab entry for either of those USB disks?  If so, try commenting it out.
2) it looks like Ivman is not using pmount for some reason; please check if this is the case by running 'ivman --nofork -d' as root and looking at the first few lines of output, which have to do with pmount detection.

Comment 14 Marcus Furlong 2006-04-21 06:16:03 UTC
(In reply to comment #13)
> (In reply to comment #11)
> > Upgraded to hal 0.5.7 and the problem is still there unfortunately. Here's the
> > lshal output:
> > udi =
> > '/org/freedesktop/Hal/devices/volume_uuid_ab2088a0_063b_48e8_a8b2_c0a126e030c3'
> <snip>
> 
> Yes, you definitely have HAL config issues.  See the line:
>  volume.policy.should_mount = true
> 
> This says that automounters should mount this volume.  This property should
> definitely not be present on HAL 0.5.7.  Please make sure you have done
> etc-update correctly and restarted hald afterwards.  Also check
> /etc/hal/fdi/policy and /usr/share/hal/fdi/policy for outdated rules and remove
> them; I think the location of the HAL config directory changed at one point,
> which could result in outdated rules hanging around.

Yeah, that was the problem. I deleted the /usr/share/hal directory and reinstalled hal. There was a file from an earlier hal called 10-storage-policy.fdi that isn't in 0.5.7

It works fine now, but I guess when people upgrade to hal 0.5.7 they'll get bitten by the same thing (unless there is another directory change, that should get around it).

> > > Also, as a workaround, you can comment/remove the following line in
> > > IvmConfigActions.xml to return to Ivman 0.6.10 behaviour of not mounting
> > > anything on startup:
> > > 
> > >   <ivm:Option name="checkOnInit" value="true" />
> > 
> > Should this not be the default behaviour? Part of the 10-second wait while
> > booting is due to mounting external hard disks/pendrives if they are plugged in
> > already.
> It should be the default if and only if most users want that feature, and I
> have no idea if that is the case or not, so I guessed.

It'll mean unmounting any already attached external drives as root and remounting them, so I guess it'll be a pain for plenty of people..

The 10 second wait
> should not occur in Ivman 0.6.12, please let me know if it does.  Also the code
> can be refactored to remove any delay even if mounts fail; I will probably do
> that for Ivman 0.6.13.

The delay is partly due to mounting big partitions with journalling filesystems. I can actually hear the journal replay on a couple of large reiserfs partitions at boot time now (and ivman waits for them).

> (In reply to comment #11)
> > Seems it's trying to reuse the usbdisk directory, and the pen drive doesn't
> > get mounted. So I didn't notice the above, as I was mounting the second pen
> > drive as user from the DE.
> 
> Hmm, that is odd.
> 1) do you have an fstab entry for either of those USB disks?  If so, try
> commenting it out.

No, no fstab entry.

> 2) it looks like Ivman is not using pmount for some reason; please check if
> this is the case by running 'ivman --nofork -d' as root and looking at the
> first few lines of output, which have to do with pmount detection.

It does seem to be using using pmount:

manager.c:1357 (do_startup_configure) Directory /etc/ivman/ will be used for configuration files.
manager.c:259 (set_mount_command) No mount command was specified in IvmConfigBase.xml.  Ivman will try to automatically detect the command to use. If Ivman incorrectly detects the program(s) available on your system, first make sure the program(s) are in the default shell PATH, then please report it as a bug.
manager.c:291 (set_mount_command) pmount-hal detection skipped, as we are a root instance of Ivman.  pmount-hal is only used for user instances.
manager.c:333 (set_mount_command) pmount accepts -u <umask>
manager.c:336 (set_mount_command) pmount was found on your system. It will be used for mounting.
Comment 15 Marcus Furlong 2006-04-21 09:31:16 UTC
I uninstalled hal ivman pmount dbus hotplug coldplug and udev along with all their old config files and directories, then reinstalled everything from scratch. (hal 0.5.7,ivman 0.6.12)

No error messages on startup now, although with the pen drive and external drive, only only the pen drive gets mounted at boot. I take it there is a bug somewhere as the expected behaviour would be to mount all partitions on all of those disks. It doesn't matter too much for me, as I'll be using

<ivm:Option name="checkOnInit" value="true" />

but I can help track down the problem if you want.
Comment 16 Marcus Furlong 2006-04-21 13:06:43 UTC
(In reply to comment #15)

> <ivm:Option name="checkOnInit" value="true" />

value="false"

doh..
Comment 17 Sandro Bonazzola (RETIRED) gentoo-dev 2006-04-21 14:05:25 UTC
ivman try to mount also mount points marked as noauto in /etc/fstab and says they aren't removable media.
Comment 18 Stefan Schweizer (RETIRED) gentoo-dev 2006-06-06 02:33:56 UTC
this bug has nothing to do with gentoo, and will be solved UPSTREAM eventually
just cleaning my buglist ;)