Automounting not prevented with GParted in Ubuntu 10.04

Bug #588530 reported by Curtis Gedak
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GParted
Fix Released
Medium
gparted (Ubuntu)
Fix Released
High
Martin Pitt
Lucid
Fix Released
High
Martin Pitt
Maverick
Fix Released
High
Martin Pitt

Bug Description

Binary package hint: gparted

While running GParted using the Ubuntu 10.04 Live CD, automounting of partitions is not prevented. This can result in gparted failing to complete partition editing actions successfully.

The root cause of the problem is that Ubuntu 10.04 now uses udisks, and not just hal.

A patch for this problem has been committed to the upstream git repository.
For the relevant commit, please refer to the following link:
http://git.gnome.org/browse/gparted/commit/?id=4168794e8e80d2d6457d87f33983cee2d836f527

This problem with Ubuntu 10.04 was first reported by upstream in the following bug report:
https://bugzilla.gnome.org/show_bug.cgi?id=324220#c62

SRU Test Case:
 - Insert an USB stick and ensure that it gets automounted (output in "mount" and nautilus window popping up)
 - Start gparted
 - Insert an USB stick and check that it does not get automounted (does not appear in /media and "mount" output). With the current lucid package it does get automounted, which interferes with gparted.

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks Curtis! Indeed this should be applied as an SRU for lucid, so that it'll land on the 10.04.1 point release.

Changed in gparted (Ubuntu):
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
importance: Undecided → High
status: New → In Progress
Changed in gparted (Ubuntu Lucid):
importance: Undecided → High
status: New → In Progress
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
milestone: none → ubuntu-10.04.1
Changed in gparted:
status: Unknown → Fix Released
Revision history for this message
Fabián Rodríguez (magicfab) wrote :

I've noticed unmounting partitions is not enough, any existing SWAP-type partitions on internal hard disks are detected and enabled and require sudo swapoff -a to "free" such disks for partitioning. Should I open another bug report for swap specifically ?

Revision history for this message
Curtis Gedak (gedakc) wrote :

I believe that it is the Ubuntu Live CD that enables the swap on bootup. This is not the same as partitions that are automatically mounted when introduced to the system, such as plugging in a USB flash drive.

From GParted you can select the swap partition and then use the "Partition --> Swapoff" menu option to disable the swap.

Changed in gparted (Ubuntu Lucid):
assignee: Canonical Desktop Team (canonical-desktop-team) → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :

I applied the patch to the lucid package, and tested locally. Works fine here. Uploaded to lucid-proposed queue, needs review by an SRU team member.

Martin Pitt (pitti)
Changed in gparted (Ubuntu Maverick):
assignee: Canonical Desktop Team (canonical-desktop-team) → Martin Pitt (pitti)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gparted - 0.5.2-2ubuntu2

---------------
gparted (0.5.2-2ubuntu2) maverick; urgency=low

  * Add 02_udisks.patch: Use udisks in favor of devicekit-disks and hal to
    inhibit automount while gparted is running. Patch backported from 6.0.
    (LP: #588530)
 -- Martin Pitt <email address hidden> Tue, 20 Jul 2010 15:00:40 +0200

Changed in gparted (Ubuntu Maverick):
status: In Progress → Fix Released
Revision history for this message
Jonathan Riddell (jr) wrote :

SRU needs a test case

Revision history for this message
Colin Watson (cjwatson) wrote :

15:11 <cjwatson> pitti: do we need to handle both udisks and hal-lock being there?
15:33 <pitti> cjwatson: yes, in case hal is running
15:48 <cjwatson> pitti: the current fix only calls udisks, and doesn't have the udisks && hal-lock case to match devkit-disks && hal-lock below

Revision history for this message
Curtis Gedak (gedakc) wrote :

Based on comment #7, are you saying that you need something like the following if both udisks and hal-lock are present together?

E.g.:

 udisks --inhibit -- \
  hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \
   --run "/path-to-gpartedbin $*"

My testing on Lucid with only the udisks command (without hal-lock) has shown that udisks alone appears to prevent auto-mounting.

E.g.:

 sudo udisks --inhibit -- /path-to-gpartedbin $*

Revision history for this message
Colin Watson (cjwatson) wrote :

Martin reckoned that on current Ubuntu, only udisks is running by default, while on current Kubuntu, only hal is running by default - but it's conceivable that somebody might end up with both the udisks and hal daemons running due to installing additional packages. At least, so I understand it.

Martin Pitt (pitti)
description: updated
Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 588530] Re: Automounting not prevented with GParted in Ubuntu 10.04

Jonathan Riddell [2010-07-20 13:38 -0000]:
> SRU needs a test case

Added.

Revision history for this message
Martin Pitt (pitti) wrote :

Colin Watson [2010-07-21 7:03 -0000]:
> Martin reckoned that on current Ubuntu, only udisks is running by
> default, while on current Kubuntu, only hal is running by default - but
> it's conceivable that somebody might end up with both the udisks and hal
> daemons running due to installing additional packages.

Having the daemons running is not a problem, but the case where this
fails would be that you are running Kubuntu (which uses hal for
automounting), have udisks installed, and start gparted. Admittedly
this is not a very common scenario, but it's easy to fix this case as
well by locking both hal and udisks.

Curtis, would you mind committing something like in comment 8?

Thanks,

Martin

--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)

Revision history for this message
Curtis Gedak (gedakc) wrote :

The following patch will use both udisks and hal-lock to prevent auto-mounting if both binaries exist and both daemons are running:
http://git.gnome.org/browse/gparted/commit/?id=f242ccba462ae12bc7fd82a0ae774e60bf12e008

I also re-worded the comment after committing if you want this portion of the patch too:
http://git.gnome.org/browse/gparted/commit/?id=280f532f4aad28bf738f8a9eb627862251b312e2

If you need any updates to this patch then just let me know.

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks Curtis!

Revision history for this message
Martin Pitt (pitti) wrote :

I updated the maverick package:

gparted (0.5.2-2ubuntu3) maverick; urgency=low

  * 02_udisks.patch: Apply upstream commit f242cc to also fix the corner case
    of having both udisks and hal running. Thanks Curtis Gedak! (LP: #588530)

 -- Martin Pitt <email address hidden> Fri, 23 Jul 2010 10:50:48 +0200

Updated package upload to lucid-proposed.

Revision history for this message
Colin Watson (cjwatson) wrote : Please test proposed package

Accepted gparted into lucid-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 gparted (Ubuntu Lucid):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Ameet Paranjape (ameetp) wrote :

I was able to reproduce this bug using gparted 0.5.1-1ubuntu2; however, I can *not* recreate this bug using gparted 0.5.1-1ubuntu3 in lucid-proposed. Please let me know if I need to provide any additional information. Thanks.

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

This bug was fixed in the package gparted - 0.5.1-1ubuntu3

---------------
gparted (0.5.1-1ubuntu3) lucid-proposed; urgency=low

  * Add 02_udisks.patch: Use udisks in favor of devicekit-disks and hal to
    inhibit automount while gparted is running. Patch backported from 6.0.
    (LP: #588530)
 -- Martin Pitt <email address hidden> Tue, 20 Jul 2010 14:24:10 +0200

Changed in gparted (Ubuntu Lucid):
status: Fix Committed → Fix Released
Revision history for this message
Dallman Ross (spamless) wrote :

Thanks for the work here, guys. As long as you are busy working out uuid issues to do with gparted, this seems to me to be a perfect time to tackle bug #579703, which I reported some time ago.

https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/579703

Changed in gparted:
importance: Unknown → Medium
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.