Format action wipes all partitions

Bug #484252 reported by Joe_Bishop
132
This bug affects 30 people
Affects Status Importance Assigned to Milestone
usb-creator (Ubuntu)
Fix Released
High
Dimitri John Ledkov
Nominated for Karmic by Alain Baeckeroot
Nominated for Lucid by Alain Baeckeroot
Precise
Won't Fix
High
Unassigned

Bug Description

[rational]
"Erase Disk" action formats *all* partitions, instead of the selected partition only.

[test case]
1) Start usb creator
2) Select an individual partition
3) Click on erase/format
4) Check that the other partitions haven't been touched

[regression potential]
The fix has been in quantal for a while and peer reviewed before that, this fix leads to quite a bit of code being moved around but still limited to the erase/formatting code.
As it's code doing drive formatting, regressions can be pretty nasty with potential dataloss, though I can't find any indication that it'd affect another block device than that selected and so the worst case scenario I can see is basically what we currently have in precise (wiping a partition wipes the whole drive).

Related branches

Revision history for this message
Joe_Bishop (denis-cheremisov-gmail) wrote :
Revision history for this message
Steve McGrath (smcgrath23) wrote :

Just to be clear, are you saying that you told it to format one of the two partitions, and it then formated the entire device instead?

Changed in usb-creator (Ubuntu):
status: New → Incomplete
Revision history for this message
Joe_Bishop (denis-cheremisov-gmail) wrote :

Yes, when I choose one partition, it formats the entire stick.

Revision history for this message
Steve McGrath (smcgrath23) wrote :

I just reproduced this on my machine. I used a 2GB thumb drive split into a 1GB FAT and 1GB Ext4 partition.

usb-creator appears to be offering the choice to format any given partition, and in fact specifies that the ext4 partition would need to be formated in order to turn it into a startup disk.

Selecting the FAT partition and clicking Format results in the entire device being repartitioned and formatted as a single FAT filesystem.

Changed in usb-creator (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Laurens (laurenssss) wrote :

usbcreator/frontends/gtk/frontend.py line 663:
    def format_dest_clicked(self, *args):
        # FIXME evand 2009-04-30: This needs a big warning dialog.
        model, iterator = self.dest_treeview.get_selection().get_selected()
        if not iterator:
            return
        udi = model[iterator][0]
        self.backend.format(udi)

usbcreator/backends/devicekit/backend.py line 245:
    def format(self, device):
        # TODO evand 2009-08-25: Needs a confirmation dialog.
        try:
            dk = self.bus.get_object('org.freedesktop.DeviceKit.Disks', device)
            device = dk.Get(device, 'device-file', dbus_interface=PROPS_IFACE)
            self.helper.Format(device, timeout=MAX_DBUS_TIMEOUT)
        except dbus.DBusException:
            logging.exception('Could not format the device:')

I don't know python & how to fix but the problem should be somewhere there. Maybe
udi = model[iterator][0] <<-- this zero?
or
dk = self.bus.get_object('org.freedesktop.DeviceKit.Disks.Device', device) <<-- Device

Changed in usb-creator (Ubuntu):
importance: Undecided → High
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

The issue is here in the backend code:

    def format(self, device):
        try:
            dk = self.bus.get_object(DISKS_IFACE, device)
            logging.debug('def format(%s)' % device)
            device = dk.Get(device, 'device-file', dbus_interface=PROPS_IFACE)
            logging.debug('%s = dk.Get()' % device)
            if dk.Get(device, 'device-is-partition', dbus_interface=PROPS_IFACE):
                device = dk.Get(device, 'partition-slave', dbus_interface=PROPS_IFACE)
                logging.debug('%s = dk.Get() no. 2' % device)
                dk = self.bus.get_object(DISKS_IFACE, device)
                device = dk.Get(device, 'device-file', dbus_interface=PROPS_IFACE)
                logging.debug('%s = dk.Get() no. 3' % device)
            logging.debug('self.formatting = %s' % device)
            self.formatting = device
            self.helper.Format(device, reply_handler=self.format_ended_cb,
                                       error_handler=self.format_failed_cb)
        except dbus.DBusException:
            # Could not talk to usb-creator-helper or devkit.
            logging.exception('Could not format the device:')

More specifically the "if" block logic attempts to determine the "parent" of the partition (e.g. the actual device) and then passes that to the helper object to format.

It seems that the original logic surrounding this was that any USB stick being selected would be completely formatted to be used to boot from. I believe that this was an unintentional design flaw, and could be addressed by modifying the above code and the helper object to allow for formatting only a selected partition.

Changed in usb-creator (Ubuntu):
assignee: nobody → Roderick B. Greening (roderick-greening)
Revision history for this message
Evan (ev) wrote :

It was not unintentional, but I agree that the current UI is confusing in this matter. In Maverick, we should change the button label to "Wipe Disk" and change the description in the following dialog to note that this operation will clear the entire disk, not just the selected partition.

There are lots of USB disks with an additional small partition containing Windows software or drivers, but having multiple partitions that you care about is most certainly not the common case.

Simplicity is one of the design goals of usb-creator, and I really don't want to expose too much detail of partitioning when history has shown us (in ubiquity) that many users have a hard time understanding the concept. If the user wants to format specific partitions, they should use GParted or the KDE equivalent.

It's probably worth noting that non-destructive behavior is another design goal. Originally the format button only appeared when absolutely needed, but it quickly became apparent that too many users wanted to quickly clear a disk that they were no longer using and put Ubuntu on it. So if we're going to do something destructive, we should make sure that it's destructive enough to not require additional fiddling.

Revision history for this message
Laurens (laurenssss) wrote :

Having multiple partitions that you care about is maybe not the common case, but as described also in
https://bugs.launchpad.net/bugs/446891 (Should maybe marked as duplicate of this one)
it is present. Especially on external hard drives.

If there is no support for formatting single partitions, the format button should be disabled, when selecting just one partition. Then it is clear that you can only format the whole disk.

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

Evan, I agree with Laurens last comment. Perhaps we should have the UI disable the format button if a "partition" is selected and not the parent drive. Is there anything barring us from doing that?

Revision history for this message
Evan (ev) wrote :

We do not have time to consider the potential fallout from making the format button sensitive/insensitive based on whether or not the device is a disk or partition. We're in freeze for lucid beta 2.

For Lucid, I am keen to just change the text, as that's fairly safe, and consider a better solution for Maverick.

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

Evan, Im good with that. Maybe we should also change the text in the warning dialog from:

"Are you sure you want to format the device?"

to:

"Are you sure you want to format the entire device (/dev/sda)?"

or something like that.

Revision history for this message
Laurens (laurenssss) wrote :

In the attachment i send the change that would be needed for the gtk-frontend. Works fine for me like that.

I think only changing the text is an alibi solution. Afterwards you can tell someone who deleted all his data that he should have read.
If I want to format a partition, I'm expecting to be asked if I'm sure. If I have selected the the right partition before I'll click OK.
I and certainly everybody would never expect a program to delete something you didn't select.

So please have a look at my patch.

Revision history for this message
Rich Johnson (nixternal) wrote :

FYI: We have been in UI and String freeze for more than a month now. Please refer to both UI and String Freeze documentation.

Revision history for this message
lsmobrian (brian-j-porter) wrote :

I have a 2GB usb drive split into two 1GB partitions. I dont recall what format and usb-creator just formatted both. I used sdb2 to hold the lucid iso that i zsync'd and sdb1 to make into an install partition.

usb-creator listed /dev/sdb, with sdb1 and sdb2 in the tree. I loaded up usb-creator and selected the iso from sdb2 and selected sdb1 as the drive to write to, however 'make startup disk' was grayed out. I closed creator, umount'd sdb1 and reopened creator, still no make button. so i tried the 'erase disk' option next to sdb1 to find that it completely wiped /dev/sdb not just sdb1 .... .awww there goes my awesome zsync script i wrote on sdb2 to update my iso

Revision history for this message
Evan (ev) wrote :

I've changed the button's label to Erase Disk for Lucid. Any further changes will have to wait for Maverick, for the reasons I've mentioned above.

Changed in usb-creator (Ubuntu):
milestone: none → later
Revision history for this message
Daniel Kondor (kondor-dani) wrote :

This bug just had my 500GB external hard drive erased (after the first shock I was luckily able to restore it with testdisk). I happened to press the "Erase Disk" button after having selected the partition I wanted to erase (I know the definition of disk and partition of course, but many people - and even the UI of a popular OS - use the two terms interchangedly, and selecting a partition first seemed like a very direct and precise declaration of what I want the program to do, so I thought the button label wasn't technically accurate), so the Erase Disk button label is not a good solution (even temporaly).
As I think this is a very serious problem, I'm asking you to please do something quickly to prevent this from happening again with someone else. I think the format option should be disabled in the Lucid version (in an update, as soon as possible, people still can format patitions using gparted) until the new version solving the issue comes out (I think that a program version that has fewer features is still better than a version which is potentionally dangerous - until the new release comes out in October many people wil have deleted important data, especionally as this program is intended for people with little technical knowledge).

Revision history for this message
tsultana (tsultana) wrote :

Daniel I agree with you. The solution implemented does not address the original concern. IMHO it would have been better to remove the reformatting functionality entirely, or else remove it from the LiveCD and default installation.

Revision history for this message
Nigel Atkinson (nigel-atkinson) wrote :

I'm surprised that this has not been fixed. It has been a problem for several Ubuntu releases, long before the Lucid freeze - and it is destroying peoples' data.

I think the idea of greying out the format button when a partition rather than a device is selected is a good one. This caters for people who want a simple way to get a usb stick ready for Ubuntu, and anyone who wants to just format a partition most likely knows how to do it in other ways.

Also I think that asking the user to confirm their selection and that they do indeed want to erase the entire device is an absolute must. With the confirmation message, showing the size of the device with other identifying information would help too. Then for example, if a user accidentally selects a usb hard drive rather than a stick, they are more likely to realise.

summary: - Wrong behaviour on format action
+ Format action wipes all paritions
summary: - Format action wipes all paritions
+ Format action wipes all partitions
Revision history for this message
Michael T (michaeltandy) wrote :

OH GOD MY BACKUPS ALL MY BACKUPS OH GOD OH GOD OH GOD!

Revision history for this message
Victor Vargas (kamus) wrote :

I have set this report as Triaged for now.

Changed in usb-creator (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Alain Baeckeroot (alain-baeckeroot) wrote :

still not fixed several monthes after being triaged .... :-(

Revision history for this message
Alain Baeckeroot (alain-baeckeroot) wrote :

wrt #10 :
 Maverick end of life will occur *before* lucid, so we dont care about this being fixed in maverick, but we need it in lucid :-)

Also i dont understand how the usb-creator cannot simply transmit the argument of the selected device (be it a partition or a device)

Revision history for this message
Evgeny Martynov (pro-epic-fail) wrote :

Here's a patch. I've modified the usb-creator to format the partition that is selected - or the USB disk otherwise. Tested it on a stick with 2 partitions, seems to work fine, it even boots (surprise!).

Feel free to change the patch or modify as you see fit.

Revision history for this message
Evgeny Martynov (pro-epic-fail) wrote :

Oh, I forgot to add: the files affected are usbcreator/backends/udisks/backend.py and bin/usb-creator-helper

Changed in usb-creator (Ubuntu):
status: Triaged → In Progress
Revision history for this message
corno (crncorno) wrote :

I'm new to the Ubuntu community so sorry for the ignorant question, but what is the current status of this bug? In the review process?

Gary M (garym)
tags: added: karmic lucid patch
Revision history for this message
Gary M (garym) wrote :

Patches seem to have been available for review/sponsorship, but the bug had not been flagged as such (now done).

It seems unlikely that the status is still/currently "In progress", but someone else will need to set it back to "Triaged" and reset the assignee -- unless Roderick is still keen?

Revision history for this message
corno (crncorno) wrote :

I would love to have a go at this. Is it possible to make me the Assignee?

Revision history for this message
Daniel Richard G. (skunk) wrote :

corno, given that you're just starting out here, I think it would be better if you just go ahead and work on a patch, submit it here, and let others review it. Bug assignments usually go to established developers.

Revision history for this message
Evgeny Martynov (pro-epic-fail) wrote :

You might want to check out my patch from 2010-11-27 (link: https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/484252/comments/23 ) - see if it works, and if you can improve it.

Revision history for this message
corno (crncorno) wrote :

@Evgeny - thanks, I will check it out.

@Daniel - when i'm done with the changes and I want it reviewed, do I just generate the patch and submit it to this bug like Evgeny did with his changes. or should it be pushed (bzr push) to LaunchPad and then do the "Propose for merging" process? Which is the appropriate action for a fix like this one?

Revision history for this message
Daniel Richard G. (skunk) wrote :

If you're familiar with Launchpad's bzr repositories and the "Propose for merging" process, then that is preferable, as it simplifies things for the maintainers. Submitting a patch here is simpler, but leaves the work of actual merging to someone else.

If you know your way around the merging process, you'll be up to speed around here in no time :-)

Revision history for this message
eremos (hjbotha) wrote :

Just been bitten by this as well in Oneiric. The dialog does say "entire disk" but it's still very ambiguous. Primarily because on the main dialog, in the LABEL and CAPACITY columns, it gives the label and capacity for the first partition, rather than the entire disk. If THAT dialog said 320GB instead of 4GB, it would remove all doubt about what is about to happen.

I'm frankly amazed that this has been open since 2009, given that it can and has resulted in catastrophic data loss.

Revision history for this message
tsultana (tsultana) wrote :

I would like to propose my original request.

Fix it so that it works on the partition selected and not the entire disk. A warning is a poor substitute.

If it cannot be done then I suggest the usb-creator be removed from the standard installation of Ubuntu.

It is a stick of dynamite in an otherwise stable product.

I think my proposal has gained credibility over the last 2 years and countless GB of data lost by unsuspecting users.

Revision history for this message
Paul-Sebastian Manole (brokenthorn) wrote : RE: [Bug 484252] Re: Format action wipes all partitions

Well, I just think it's a shame that such long threads need to be created for such obvious bug fixes that never get fixed. It's a shame. That's why I stopped using Ubuntu or any other distro on my desktop. (but not Linux)

I feel sorry for everyone. But at least _I'm_ happy!

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of tsultana
Sent: Wednesday, October 26, 2011 4:24 AM
To: <email address hidden>
Subject: [Bug 484252] Re: Format action wipes all partitions

I would like to propose my original request.

Fix it so that it works on the partition selected and not the entire
disk. A warning is a poor substitute.

If it cannot be done then I suggest the usb-creator be removed from the
standard installation of Ubuntu.

It is a stick of dynamite in an otherwise stable product.

I think my proposal has gained credibility over the last 2 years and
countless GB of data lost by unsuspecting users.

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/484252

Title:
  Format action wipes all partitions

Status in �usb-creator� package in Ubuntu:
  In Progress

Bug description:
  Binary package hint: usb-creator

  I have two partitions on my stick: FAT-32 boot partition and Ext-4 without journal one. So, the program shows: 1) FAT partions, Ext 4 partition, Whole drive.
  I can only choose one item in the list: fat, ext4 or whole drive. I suppose the utility only formats selected partition (and leaves other ones alone) or formats the whole drive into Fat-32. But it doesn't. It formats the whole stick into one big Fat-32 partition, which is highly inconsistent.

  ProblemType: Bug
  Architecture: amd64
  Date: Tue Nov 17 18:41:18 2009
  DistroRelease: Ubuntu 9.10
  NonfreeKernelModules: nvidia
  Package: usb-creator-gtk 0.2.12
  PackageArchitecture: all
  ProcEnviron:
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: usb-creator
  Uname: Linux 2.6.32-020632rc6-generic x86_64

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/484252/+subscriptions

Revision history for this message
Peter Berry (pwberry) wrote :

If I select an item from a list and click a button that is clearly visually associated with that box, does it not seem reasonable to infer that the button's action applies to that item only? Changing the wording is not enough as you must assume the user is an idiot and won't interpret the words the same way you do. (Before anyone accuses me of calling them an idiot, I just hit this bug with the Natty version of this tool.)

This very serious bug that can and has resulted in catastrophic data loss has been marked high priority for over a year and still not fixed. What is going on?

Revision history for this message
jah0wl (alberto-delatorre) wrote :

Please, we need this bug to be fixed. I have just lost all the data in my USB hard disk. When you use a translated version (Im using spanish one) and you read "erase disk", when you have selected just one partition, you think it will erase the partition you selected, because: 1st: you selected a partition not a whole disk. 2nd: The translation are not always the best they can be, and you may think "disk" wasn't transalated as well as it could be possible.... We need this bug to be fixed!!

Revision history for this message
Paul-Sebastian Manole (brokenthorn) wrote :

That's OSS for you, don't get your hopes up. I've been watching this bug
thread for an year and counting...

On Tuesday, January 3, 2012, jah0wl <email address hidden> wrote:
> Please, we need this bug to be fixed. I have just lost all the data in
> my USB hard disk. When you use a translated version (Im using spanish
> one) and you read "erase disk", when you have selected just one
> partition, you think it will erase the partition you selected, because:
> 1st: you selected a partition not a whole disk. 2nd: The translation are
> not always the best they can be, and you may think "disk" wasn't
> transalated as well as it could be possible.... We need this bug to be
> fixed!!
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/484252
>
> Title:
> Format action wipes all partitions
>
> Status in “usb-creator” package in Ubuntu:
> In Progress
>
> Bug description:
> Binary package hint: usb-creator
>
> I have two partitions on my stick: FAT-32 boot partition and Ext-4
without journal one. So, the program shows: 1) FAT partions, Ext 4
partition, Whole drive.
> I can only choose one item in the list: fat, ext4 or whole drive. I
suppose the utility only formats selected partition (and leaves other ones
alone) or formats the whole drive into Fat-32. But it doesn't. It formats
the whole stick into one big Fat-32 partition, which is highly inconsistent.
>
> ProblemType: Bug
> Architecture: amd64
> Date: Tue Nov 17 18:41:18 2009
> DistroRelease: Ubuntu 9.10
> NonfreeKernelModules: nvidia
> Package: usb-creator-gtk 0.2.12
> PackageArchitecture: all
> ProcEnviron:
> PATH=(custom, user)
> LANG=en_US.UTF-8
> SHELL=/bin/bash
> SourcePackage: usb-creator
> Uname: Linux 2.6.32-020632rc6-generic x86_64
>
> To manage notifications about this bug go to:
>
https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/484252/+subscriptions
>

--
Sent from Gmail Mobile

Revision history for this message
Nigel Atkinson (nigel-atkinson) wrote :

"That's OSS for you, don't get your hopes up."

This bug and it's failure to be fixed is not representative of OSS. I've seen bugs fixed minutes after I've submitted a bug report. Several times.

That said I first found and reported this YEARS ago when using Hardy Heron. I find it amazing that a bug that potentially destroys users data, has been known about and lasted so long.

Hopefully this is not representative of Ubuntu, but I don't bother submitting bug reports anymore.

Revision history for this message
Paul-Sebastian Manole (brokenthorn) wrote :

What you basically sound like is "give it a break, will you?!".
I only care as much right now for OSS Desktops to have commented in
the first place about how OSS tends to focus on adding new features
more than fixing current bugs, just not in so many words.
This bug is VERY representative of OSS, at least on the graphical
applications (desktop) side of things. Nothing is as polished as it
should be since all the focus is on the backend with very little focus
on the frontend.

That said, nothing beats OSS when it's anything but the desktop.

Sorry for going offtopic. You can delete this post. I already know it
can't make a difference anyway.

On Thu, Jan 19, 2012 at 12:33 AM, Nigel Atkinson
<email address hidden> wrote:
> "That's OSS for you, don't get your hopes up."
>
> This bug and it's failure to be fixed is not representative of OSS.
> I've seen bugs fixed minutes after I've submitted a bug report.  Several
> times.
>
> That said I first found and reported this YEARS ago when using Hardy
> Heron.  I find it amazing that a bug that potentially destroys users
> data, has been known about and lasted so long.
>
> Hopefully this is not representative of Ubuntu, but I don't bother
> submitting bug reports anymore.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/484252
>
> Title:
>  Format action wipes all partitions
>
> Status in “usb-creator” package in Ubuntu:
>  In Progress
>
> Bug description:
>  Binary package hint: usb-creator
>
>  I have two partitions on my stick: FAT-32 boot partition and Ext-4 without journal one. So, the program shows: 1) FAT partions, Ext 4 partition, Whole drive.
>  I can only choose one item in the list: fat, ext4 or whole drive. I suppose the utility only formats selected partition (and leaves other ones alone) or formats the whole drive into Fat-32. But it doesn't. It formats the whole stick into one big Fat-32 partition, which is highly inconsistent.
>
>  ProblemType: Bug
>  Architecture: amd64
>  Date: Tue Nov 17 18:41:18 2009
>  DistroRelease: Ubuntu 9.10
>  NonfreeKernelModules: nvidia
>  Package: usb-creator-gtk 0.2.12
>  PackageArchitecture: all
>  ProcEnviron:
>   PATH=(custom, user)
>   LANG=en_US.UTF-8
>   SHELL=/bin/bash
>  SourcePackage: usb-creator
>  Uname: Linux 2.6.32-020632rc6-generic x86_64
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/484252/+subscriptions

Revision history for this message
Alain Baeckeroot (alain-baeckeroot) wrote :

It is not an OSS problem, its is an UBUNTU problem.

Ubuntu wants to make easy money, but does not act in a responsible way by NOT FIXING TRASHING DATA BUG.

It not hte only bug like this that is not fixed, and which concerns Canonical employee developed tools.

If you need rock solid distro, switch to something else, ubuntu is for kids, not for professional.

komputes (komputes)
tags: added: css-sponsored-p
komputes (komputes)
tags: added: rls-mgr-p-tracking
Revision history for this message
Hesham Saleh (heshamsl65) wrote :

Faced the same problem and it erased a whole priceless 120 GB of backup drive instead of a single partition. Fortunately like Daniel (https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/484252/comments/16), I was lucky enough to be able to retrieve back the partition table using testdisk and consequently got my data back again.

This is a very critical bug I see, I don't know about this specific tool's progress in further versions.

Changed in usb-creator (Ubuntu):
assignee: Roderick B. Greening (roderick-greening) → nobody
status: In Progress → Triaged
assignee: nobody → Canonical Foundations Team (canonical-foundations)
milestone: later → none
Revision history for this message
Steve Langasek (vorlon) wrote :

Dmitrijs, I believe you have some expertise here; can you have a look at fixing this?

We don't necessarily need to support installing to a single partition on the disk if that's error-prone in other ways, but we should definitely make it clear that the entire disk will be formatted. I've experienced (non-data-loss) problems myself before where selecting a partition on the target USB device didn't do what I expected, so I think the selection screen needs clarifying.

Changed in usb-creator (Ubuntu):
assignee: Canonical Foundations Team (canonical-foundations) → Dmitrijs Ledkovs (dmitrij.ledkov)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

On 04/05/12 19:04, Steve Langasek wrote:
> Dmitrijs, I believe you have some expertise here; can you have a look at
> fixing this?
>
> We don't necessarily need to support installing to a single partition on
> the disk if that's error-prone in other ways, but we should definitely
> make it clear that the entire disk will be formatted. I've experienced
> (non-data-loss) problems myself before where selecting a partition on
> the target USB device didn't do what I expected, so I think the
> selection screen needs clarifying.
>

I wonder why we offer format button at all.

Possibly we should launch the gnome 'Disk Utility' (can't find command
name just now)

I'll look into this issue. With branch proposals.
--
Regards,
Dmitrijs.

description: updated
Revision history for this message
Evan (ev) wrote :

On Fri, May 4, 2012 at 7:04 PM, Steve Langasek
<email address hidden> wrote:
> We don't necessarily need to support installing to a single partition on
> the disk if that's error-prone in other ways, but we should definitely
> make it clear that the entire disk will be formatted.

This is already the case. The button says "Erase Disk" not "Erase Partition."

I'm happy with us being explicit about it to avoid the confusion of
selecting what looks like a partition and then acting on the entire
device. I think this would entail throwing up a dialog that said "The
entire contents of $USB_DEVICE_NAME will be lost. Do you want to
continue?"

I do not think just formatting a partition is the right approach for
the reasons I outlined in my previous comment:
https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/484252/comments/7

Adding to that list, usb-creator and other tools write to the MBR,
which would not be cleared by just wiping the partition and its VBR.

Revision history for this message
Evan (ev) wrote :

On Fri, May 4, 2012 at 7:26 PM, Dmitrijs Ledkovs
<email address hidden> wrote:
> I wonder why we offer format button at all.

See my earlier comment on this point:
https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/484252/comments/7

> Possibly we should launch the gnome 'Disk Utility' (can't find command
> name just now)

Please no. That utility is designed for advanced users who understand
partitioning and complex disk arrangements. This tool is designed to
be used by all our users, not just the more technical ones.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

On 21/05/12 11:46, Evan Dandrea wrote:
> On Fri, May 4, 2012 at 7:04 PM, Steve Langasek
> <email address hidden> wrote:
>> We don't necessarily need to support installing to a single partition on
>> the disk if that's error-prone in other ways, but we should definitely
>> make it clear that the entire disk will be formatted.
>
> This is already the case. The button says "Erase Disk" not "Erase
> Partition."
>
> I'm happy with us being explicit about it to avoid the confusion of
> selecting what looks like a partition and then acting on the entire
> device. I think this would entail throwing up a dialog that said "The
> entire contents of $USB_DEVICE_NAME will be lost. Do you want to
> continue?"
>
> I do not think just formatting a partition is the right approach for
> the reasons I outlined in my previous comment:
> https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/484252/comments/7
>
> Adding to that list, usb-creator and other tools write to the MBR,
> which would not be cleared by just wiping the partition and its VBR.
>

Doesn't the proposed branch still passes the whole device for wiping the
MBR? Let me check again, in case it doesn't. It was the intent to still
wipe the MBR.

On 21/05/12 11:49, Evan Dandrea wrote:
> On Fri, May 4, 2012 at 7:26 PM, Dmitrijs Ledkovs
> <email address hidden> wrote:
>> I wonder why we offer format button at all.
>
> See my earlier comment on this point:
>
https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/484252/comments/7
>
>> Possibly we should launch the gnome 'Disk Utility' (can't find command
>> name just now)
>
> Please no. That utility is designed for advanced users who understand
> partitioning and complex disk arrangements. This tool is designed to
> be used by all our users, not just the more technical ones.
>

Ok.

But, although having small windows partitions with drivers and stuff is
still common, the sizes of the usb sticks have greatly increased.

The usb stick I bought last year is 'Cruzer Edge' and it's size is 32GB
from a regular consumer catalogue vendor (Argos). The cheapest/smallest
sticks they offered at the time was 8GB. I have two partitions: one 2GB
in size for live-cd testing, the other is remainging ~28GB NTFS
partition for sharing/moving large files across different operating systems.

So, what I ended up doing now, is opening nautilus and manual select all
files from my 'livecd partition' and delete them. Then re-run
usb-creator to test daily livecd image.

How can we make usb-creator user-friendly, for those people who have
large usb sticks with multiple partitions (1-off setup)?

How can we make it harder to erase intentional multiple partitions?

Option 1: if total size of usb-stick is more than 4GB, and the currently
selected partition is of sufficient total size (e.g. 2GB), then we
should be offer an option to clear the contents of said partition, and
not offer 'Wipe Disk' action.

Option 2: if the selected partition already has a live-cd/usb-creator on
it, offer to 'update it' / override all files on it (apart from
persistent storage?! Maybe not)

--
Regards,
Dmitrijs.

Revision history for this message
Evan (ev) wrote :

On Mon, May 21, 2012 at 12:19 PM, Dmitrijs Ledkovs
<email address hidden> wrote:
> Doesn't the proposed branch still passes the whole device for wiping the
> MBR? Let me check again, in case it doesn't. It was the intent to still
> wipe the MBR.

Well, it's still writing the first 446 bytes, which would definitely
kill the partition table.

> On 21/05/12 11:49, Evan Dandrea wrote:
>> On Fri, May 4, 2012 at 7:26 PM, Dmitrijs Ledkovs
>> Please no. That utility is designed for advanced users who understand
>> partitioning and complex disk arrangements. This tool is designed to
>> be used by all our users, not just the more technical ones.
>>
>
> But, although having small windows partitions with drivers and stuff is
> still common, the sizes of the usb sticks have greatly increased.

Perhaps I was unclear in picking that as an example. It's not that
users want to maximize the amount of space they have. The point I was
trying to make there is that USB disks with multiple partitions that
people care about are not common. We should optimize for the common
case, which is single USB disk, single (or no) VFAT partition.

I have a fear of odd disk configurations that prevent us from
successfully installing to and booting from a USB disk of which we
just replaced the contents of a single partition. The intent of that
button was "start from a known good state", and the only known good
state is a clean disk.

However, the more I draw a line in the sand around this, the more I'm
going to become responsible for investing time in usb-creator. ;) So
if you feel that it's sufficient to clear just the code area of the
MBR and wipe the existed selected partitions and its VBR, then I'll
happily merge your branch (once you've made the change to just hit the
code area).

Thank you for working on this, Dmitrijs. I most certainly feel that
something should be done here, and I'm glad you're taking the
initiative to resolve this issue.

Revision history for this message
Evan (ev) wrote :

My mistake. I misread that entirely. Obviously 446 bytes is okay. The
partition table is everything after 446.

Evan (ev)
Changed in usb-creator (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package usb-creator - 0.2.39

---------------
usb-creator (0.2.39) quantal; urgency=low

  [ Colin Watson ]
  * Clean up various pyflakes warnings.
  * Only pass unicode=True to gettext.install in Python 2.
  * Open subprocesses with universal_newlines=True when expecting to read
    text from them. On Python 2, this only enables \r\n conversion and the
    like, but on Python 3 this also causes subprocess-related file objects
    to read str rather than bytes.
  * Use str() rather than unicode() in Python 3.
  * Remove __pycache__ directories on clean.
  * Use 'isinstance(obj, collections.Callable)' instead of 'callable(obj)'
    in Python 3.
  * Change 'except StandardError' to 'except Exception'; StandardError was
    removed in Python 3.
  * Use Python 3 name for Queue if available.
  * Handle a few cases of builtins being changed to return iterators in
    Python 3.
  * Just use dict.items() rather than bothering with Python 2/3
    compatibility for dict.iteritems().

  [ Evan Dandrea ]
  * Only clear the selected partition on the disk, not the entire disk
    (LP: #484252). Thanks Dmitrijs Ledkovs!
 -- Evan Dandrea <email address hidden> Mon, 28 May 2012 17:58:43 +0100

Changed in usb-creator (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

This seems worth fixing in precise the relevant changes can be found here:
http://bazaar.launchpad.net/~usb-creator-hackers/usb-creator/trunk/revision/390

Changed in usb-creator (Ubuntu Precise):
importance: Undecided → High
status: New → Triaged
milestone: none → ubuntu-12.04.1
Revision history for this message
Sebastien Bacher (seb128) wrote :

Hey Dmitrijs, could you have a look at SRUing that fix?

Changed in usb-creator (Ubuntu Precise):
assignee: nobody → Dmitrijs Ledkovs (dmitrij.ledkov)
Changed in usb-creator (Ubuntu Precise):
assignee: Dmitrijs Ledkovs (dmitrij.ledkov) → Stéphane Graber (stgraber)
Changed in usb-creator (Ubuntu Precise):
status: Triaged → In Progress
description: updated
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Please test proposed package

Hello Joe_Bishop, or anyone else affected,

Accepted usb-creator into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/usb-creator/0.2.38.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in usb-creator (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Gary M (garym) wrote :

I tested with v0.2.381 from precise-proposed, but got inconsistent results. This may be related to a triggered udisks-daemon crash which looks a lot like https://bugzilla.redhat.com/show_bug.cgi?id=752175 and its duplicates : "WARNING: at block/genhd.c:1571 disk_clear_events+0xe8/0x100()". I'll try some more to get a consistent result, but hopefully someone else can do some testing too.

Revision history for this message
Gary M (garym) wrote :

precise-proposed results, tested with a 4GB USB stick having two partitions :
1. Button and subsequent warning both refer st to erasing the disk, not the partition.
2. If partitions are not mounted, they are not shown individually, instead I just see the whole stick.
3. If partitions are mounted, they are each shown, but pressing the erase button just caused the selected partition to be unmounted. I expected the partition to be formatted or deleted.
4. If neither partiton is selected, the erase button is still enabled. I expected it to be disabled until a partition was selected.

Compounding the inconsistency, I also received the error message "org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.". But this time no error was shown in the log.

tags: added: verification-failed
removed: verification-needed
Changed in usb-creator (Ubuntu Precise):
milestone: ubuntu-12.04.1 → ubuntu-12.04.2
Colin Watson (cjwatson)
Changed in usb-creator (Ubuntu Precise):
milestone: ubuntu-12.04.2 → ubuntu-12.04.3
Changed in usb-creator (Ubuntu Precise):
assignee: Stéphane Graber (stgraber) → nobody
Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in usb-creator (Ubuntu Precise):
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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