Free partition space isn't correctly updated after erasing

Bug #1413494 reported by Yu Ning on 2015-01-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
usb-creator (Ubuntu)

Bug Description

1) The release of Ubuntu you are using, via 'lsb_release -rd' or System -> About Ubuntu

Ubuntu 14.04

2) The version of the package you are using, via 'apt-cache policy pkgname' or by checking in Software Center


3) What you expected to happen

First prepare an usbstick dd'ed with zero (dd if=/dev/zero of=/dev/SDB bs=1M count=1), then erase it with usb-creator-gtk.

After the erasing it should display the free partition space correctly, which is usually the same value with the usbstick capacity.

4) What happened instead

After the erasing it just display the free space as an empty string "", and we can't burn them selected source ISO in such a case.

Related branches

Yu Ning (yuningdodo) wrote :

I checked the source code and found usb-creator can only calculate the free space for a mounted partition, however the newly formated partition isn't mounted.

So to fix the issue we could mount it automatically after the formating. In the attached patch this job is done in the dbus method Format() in usb-creator-helper. In my own test it works fine.

The attachment "auto-mount-after-format.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Brian Murray (brian-murray) wrote :

What is the purpose of this change?

--- a/bin/usb-creator-helper
+++ b/bin/usb-creator-helper
@@ -237,7 +237,7 @@

         # TODO LOCK
- unmount_all(udisks, dev)
+ unmount_all(udisks, parent_dev)


Yu Ning (yuningdodo) wrote :

Brian, thanks for the review, here is the declaration of unmount_all():

def unmount_all(udisks, parent):
    '''Unmounts the device or any partitions of the device.'''

As you can see the last param is expected to be parent, and in my test if we pass "dev" to it it can't unmount properly, so I think this may be a typo of "parent_dev".

BTW, let me propose a merge request with this patch for better reviewing.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers