udisks is the new gnome-mount

21.03.2011 19:54

Two years ago I ranted about how gnome-mount insults the user by giving absolutely no feedback on whether the operation was successful or not. Since then a lot of things changed and now the preferred way of mounting filesystems without root access seems to be udisks. This is what appears to be used by GNOME these days to mount things from the GUI and there is also an udisks command line tool.

After re-installing Debian last week mounting external USB drives no longer worked. GNOME stubbornly said Error mounting: mount exited with exit code 1: helper failed for all plugged-in drives while mounting them manually as root with the trusty old mount worked flawlessly.

Going to the command-line didn't improve the situation much:

toybox$ udisks --mount /dev/sdb1
Mount failed: Error mounting: mount exited with exit code 1: helper failed with:
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Ok, so it's trying to mount the drive using a wrong filesystem. dmesg output confirmed that, saying kernel was trying to use UDF-FS, while this drive has a plain old VFAT on it.

No problem, I'm going to specify the filesystem type myself:

toybox$ udisks --mount /dev/sdb1 --mount-fstype=vfat
Mount failed: Error mounting: mount exited with exit code 1: helper failed with:
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

That's weird. Maybe some internal detection is overriding my type specification (even though it shouldn't - all command-line interfaces I've seen give the command-line arguments priority over any configuration file or autodetection). Let's see what udisks thinks about the filesystem type.

toybox$ udisks --show-info /dev/sdb1|grep vfat
  type:                        vfat

Right. It knows without my help that it's a VFAT formatted disk. So why does it try to mount it using UDF? udisks offers no option to increase the verbosity or to enable debug output. It doesn't write anything helpful into syslog. How exactly is one expected to find a problem? Or even file a meaningful bug report that won't immediately be rejected for the lack of information?

In the end, it turned that the culprit was the Debian installer that for some reason put the following line into /etc/fstab. Removing it restored normality.

/dev/sdb1       /media/cdrom1   udf,iso9660 user,noauto     0       0

Don't get me wrong. udisks is light years ahead of gnome-mount in terms of usability. But what is it with these wrappers around mount? Must they always actively derail any and all attempts to find out why they aren't working correctly?

Posted by Tomaž | Categories: Code

Comments

I think that this has to be with the installation method. It happended the same to me. I've installed debian via a usb key, so, it first mounts it as a udf device .... pure intuition..... regards....

Posted by Esteban

I also installed Debian from an USB key using the new hybrid bootable images, so that might really be the cause. I'll check if it is a known bug with debian-installer.

Posted by Tomaž

I had the exact same problem, and I've installed via a usb key also, but the funny thing is that I had a usb cd drive plugged in during the install, so I thought it was related. Looks like it wasn't.

Thanks a million.

Posted by Tazouk

Thanks, been wondering for a couple of days now - so glad its working again :)

Posted by vooshy

Same problem here, since I recently BusinessCard installed Debian from a USB.

Commented out that line and my USB backups are now working again :-)

Posted by Dude

Many thanks for this. Removing the /sdb1 reference in fstab worked fine. It was a clean install of Debian Squeeze, made from a memory stick using expert text installation mode. Can only be an error in the installer, I think.

Kindest regards,

Vic

Posted by Vic

Cool, thx!
You saved my pendrive! :]

Posted by G

Thanks a lot!!

I completely forgot about my fstab to correct it after install from usb-pendrive. :)

You made my day! :D

Posted by Sergey Sarbash

Add a new comment


(No HTML tags allowed. Separate paragraphs with a blank line.)