usbmount doesn't auto-mount external harddrive anymore in oneiric

Bug #875636 reported by e-frog
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
usbmount (Ubuntu)
Fix Released
Undecided
Unassigned
Oneiric
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
usbmount doesn't auto-mount external hard drive in Oneiric. This is considered a regression as it used to work in natty.
usbmount relies on /sbin/blkid to determine the file system type. blkid output is different in Oneiric and the regex fails to catch the file system type.

[Development Fix]
This was fixed in Debian package 0.0.22 and is meanwhile sync’d to Precise.

[Stable Fix]
The attached patch back ports the fix from Debian.

[Test Case]
Please see original report below.

[Regression Potential]
The patch itself is relatively small and unlikely to introduce regression.

[Original Report]
$: lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

$: apt-cache policy usbmount
usbmount:
  Installed: 0.0.21
  Candidate: 0.0.21
  Version table:
 *** 0.0.21 0
        500 http://de.archive.ubuntu.com/ubuntu/ oneiric/universe i386 Packages
        100 /var/lib/dpkg/status

usbmount uses '/sbin/blkid -p /dev/sdb1' to determine the filesystem type. It seems that the output of blkid changed from natty to oneiric:

natty:
$:/sbin/blkid -p /dev/sdb1
/dev/sdb1: UUID="ff3637e4-2a20-4a81-a276-93bea80e1bfa" VERSION="1.0" TYPE="ext3" USAGE="filesystem"

oneiric:
$:/sbin/blkid -p /dev/sdb1
/dev/sdb1: UUID="ff3637e4-2a20-4a81-a276-93bea80e1bfa" VERSION="1.0" TYPE="ext3" USAGE="filesystem" PART_ENTRY_SCHEME="dos" PART_ENTRY_TYPE="0x83" PART_ENTRY_FLAGS="0x80" PART_ENTRY_NUMBER="1"

The regexp in

FSTYPE=$(echo "$DEVINFO" | sed 's/.* TYPE="\([^"]*\)".*/\1/g; s/[[:blank:]]*//g;')

triggers on PART_ENTRY_TYPE which finds '0x83' as file system type and prevents it from being mounted.

Attached patch fixes this for me.

Logs before the patch:

Oct 15 19:39:33 eeebox usbmount[814]: loaded usbmount configurations
Oct 15 19:39:33 eeebox usbmount[814]: trying to acquire lock /var/run/usbmount/.mount.lock
Oct 15 19:39:33 eeebox usbmount[814]: acquired lock /var/run/usbmount/.mount.lock
Oct 15 19:39:33 eeebox usbmount[814]: /dev/sdb1 contains filesystem type 0x83
Oct 15 19:39:33 eeebox usbmount[814]: usbmount execution finished

Logs after applying the patch:

Oct 16 12:28:33 eeebox usbmount[4309]: loaded usbmount configurations
Oct 16 12:28:33 eeebox usbmount[4309]: trying to acquire lock /var/run/usbmount/.mount.lock
Oct 16 12:28:33 eeebox usbmount[4309]: acquired lock /var/run/usbmount/.mount.lock
Oct 16 12:28:33 eeebox usbmount[4309]: /dev/sdb1 contains filesystem type ext3
Oct 16 12:28:33 eeebox usbmount[4309]: mountpoint /media/usb0 is available for /dev/sdb1
Oct 16 12:28:33 eeebox usbmount[4309]: executing command: mount -text3 -onoexec,nodev,noatime,nodiratime /dev/sdb1 /media/usb0
Oct 16 12:28:33 eeebox usbmount[4309]: executing command: run-parts /etc/usbmount/mount.d
Oct 16 12:28:33 eeebox usbmount[4309]: usbmount execution finished

Revision history for this message
e-frog (e-frog) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in usbmount (Ubuntu):
status: New → Confirmed
Revision history for this message
savetbw (savetbw) wrote :

Affects me as well.
Patch works for me too.
Since you beat me on reporting it and fixing it first I'll give a slightly cleaner solution instead:

FSTYPE=$(echo "$DEVINFO" | sed 's/.*\<TYPE="\([^"]*\)".*/\1/g; s/[[:blank:]]*//g;')

Using \< instead of a space will work even if TYPE= is at the beginning on the line in blkid's output (in the case it will change again in the future).
I would also suggest to change UUID and USAGE lines below in this manner for the same reason.
Keep up the good work!

Revision history for this message
e-frog (e-frog) wrote :

Found a debian bug report regarding the same issue:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636991

Seems like it is fixed in usbmount package version 0.0.22 in debian already.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "type_detection_fix.diff" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

Fixed in 0.22 for Precise. Opening a task for Oneiric.

Changed in usbmount (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

Hi,

I'd rather sponsor a backport of the debian's fix.
@e-frog: would you mind updating your patch to match the fix done in Debian. Also, could you please add the documentation describe at https://wiki.ubuntu.com/StableReleaseUpdates#Procedure ?

thanks for your contribution!

Fabrice

Revision history for this message
e-frog (e-frog) wrote :

Attached is a new patch back porting the fix from debian package 0.0.22.

description: updated
e-frog (e-frog)
description: updated
Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

subscribing again sponsors: I won't have time to review it this week

sorry,
Fabrice

Revision history for this message
Evan Broder (broder) wrote :

e-frog: Thanks for tracking down this patch. I've uploaded the fix to oneiric-proposed; someone from the SRU team should process it within the next few days.

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello e-frog, or anyone else affected,

Accepted usbmount into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in usbmount (Ubuntu Oneiric):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
e-frog (e-frog) wrote :

Hello All,

I can confirm that the package in -proposed fixes this bug. Please see below:

$: apt-cache policy usbmount
usbmount:
  Installed: 0.0.21ubuntu0.1
  Candidate: 0.0.21ubuntu0.1
  Version table:
 *** 0.0.21ubuntu0.1 0
        400 http://archive.ubuntu.com/ubuntu/ oneiric-proposed/universe i386 Packages
        100 /var/lib/dpkg/status
     0.0.21 0
        500 http://de.archive.ubuntu.com/ubuntu/ oneiric/universe i386 Packages

It now detects the filesystem (vfat in this case) correctly:

Dec 5 19:03:05 eeebox usbmount[19465]: loaded usbmount configurations
Dec 5 19:03:05 eeebox usbmount[19465]: trying to acquire lock /var/run/usbmount/.mount.lock
Dec 5 19:03:05 eeebox usbmount[19465]: acquired lock /var/run/usbmount/.mount.lock
Dec 5 19:03:05 eeebox usbmount[19465]: /dev/sdc does not contain a filesystem or disklabel
Dec 5 19:03:05 eeebox usbmount[19488]: loaded usbmount configurations
Dec 5 19:03:05 eeebox usbmount[19488]: trying to acquire lock /var/run/usbmount/.mount.lock
Dec 5 19:03:05 eeebox usbmount[19488]: acquired lock /var/run/usbmount/.mount.lock
Dec 5 19:03:05 eeebox usbmount[19488]: /dev/sdc1 contains filesystem type vfat
Dec 5 19:03:05 eeebox usbmount[19488]: mountpoint /media/usb1 is available for /dev/sdc1
Dec 5 19:03:05 eeebox usbmount[19488]: executing command: mount -tvfat -onoexec,nodev,noatime,nodiratime /dev/sdc1 /media/usb1
Dec 5 19:03:06 eeebox usbmount[19488]: executing command: run-parts /etc/usbmount/mount.d
Dec 5 19:03:06 eeebox usbmount[19488]: usbmount execution finished

Thanks a lot for getting this pushed to the archive!

Regards,
e-frog

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package usbmount - 0.0.21ubuntu0.1

---------------
usbmount (0.0.21ubuntu0.1) oneiric-proposed; urgency=low

  * Fix regex for parsing output from blkid (LP: #875636). Patch from
    Debian. Thanks to e-frog for identifying the patch.
 -- Evan Broder <email address hidden> Sat, 03 Dec 2011 11:34:50 -0800

Changed in usbmount (Ubuntu Oneiric):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.