usb-creator fails to install when USB stick is a single filesystem with no partition table.

Bug #277865 reported by Nanley Chery
296
This bug affects 15 people
Affects Status Importance Assigned to Milestone
usb-creator (Ubuntu)
Fix Released
Undecided
Evan

Bug Description

Binary package hint: usb-creator

usb-creator crashed while working on my 1GB iPod Shuffle (2nd Gen):

1. I started usb-creator,
2. plugged in my 1GB iPod Shuffle.
3. It said I needed more space, so I deleted some music.
4. I asked for 256MB of storage space and clicked Make Startup Disk.
5. usb-creator crashed on "Installing: Starting up" (but still remains open)

ProblemType: Crash
Architecture: amd64
DistroRelease: Ubuntu 8.10
ExecutablePath: /usr/bin/usb-creator
InterpreterPath: /usr/bin/python2.5
Package: usb-creator 0.1.7
PackageArchitecture: all
ProcAttrCurrent: unconfined
ProcCmdline: /usr/bin/python /usr/bin/usb-creator
ProcEnviron:
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
 LANG=en_US.UTF-8
 SHELL=/bin/bash
PythonArgs: ['/usr/bin/usb-creator']
SourcePackage: usb-creator
Title: usb-creator crashed with AttributeError in install_bootloader()
Uname: Linux 2.6.27-4-generic x86_64
UserGroups:

Tags: apport-crash
Revision history for this message
Nanley Chery (nanoman) wrote :
description: updated
Revision history for this message
Evan (ev) wrote :

Can you please attach the output of hal-device to this bug report?

Thanks

Changed in usb-creator:
assignee: nobody → evand
status: New → Incomplete
Revision history for this message
Nanley Chery (nanoman) wrote :
Revision history for this message
Nanley Chery (nanoman) wrote :
Nanley Chery (nanoman)
description: updated
description: updated
Revision history for this message
Nanley Chery (nanoman) wrote :

I have attached the files you've requested. (Should I have changed the status to new?)

Changed in usb-creator:
status: Incomplete → New
Revision history for this message
DarrenS (youcanfindme) wrote :

[19:36:03] Source CD: /org/freedesktop/Hal/devices/volume_label_Ubuntu_8_10_i386
[19:36:03] Destination disk: /dev/sdb
[19:36:03] Persistence size: 128 MB

I ran into this similar issue and found that the issue seems to be that usb-creator assumes your usb stick has a partition table. If your usb stick's partition is /dev/sdb and not /dev/sdbX, for example, line 449 in backend.py will fail:

        num = re.match('.*([0-9]+)$', tmp).groups()[0]

I reformatted my usb stick to include a partition table and this issue went away. From want I see many usb sticks come pre-formatted like a floppy disk, the equivalent of "mkfs.vfat /dev/sdb" so I believe this issue should be addressed. I do not know what that means in terms of installing a boot loader if there is not a partition table....

Revision history for this message
Nanley Chery (nanoman) wrote :

After a couple google searches, it looks like it isn't safe to create a partition table on an iPod. Here's what [it] currently looks like,

nanley@nanley-laptop:~$ sudo sfdisk -l /dev/sdb

Disk /dev/sdb: 1015 cylinders, 32 heads, 61 sectors/track
Units = cylinders of 999424 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End #cyls #blocks Id System
/dev/sdb1 ? 398635+ 983424- 584790- 570754815+ 72 Unknown
  start: (c,h,s) expected (1023,31,61) found (357,116,40)
  end: (c,h,s) expected (1023,31,61) found (357,32,45)
/dev/sdb2 ? 86418+ 1078236- 991818- 968014120 65 Novell Netware 386
  start: (c,h,s) expected (1023,31,61) found (288,115,43)
  end: (c,h,s) expected (1023,31,61) found (367,114,50)
/dev/sdb3 ? 957931+ 1949748- 991818- 968014096 79 Unknown
  start: (c,h,s) expected (1023,31,61) found (366,32,33)
  end: (c,h,s) expected (1023,31,61) found (357,32,43)
/dev/sdb4 ? 1478320+ 1478348- 29- 27749+ d Unknown
  start: (c,h,s) expected (1023,31,61) found (372,97,50)
  end: (c,h,s) expected (1023,31,61) found (0,10,0)

Revision history for this message
Snoopstaa (ubuntu-trashed) wrote :

DarrenS,

Could you advise how to create a partition table on a usb key?

I'm moving over from Vista, cause its giving me the shits, so I'm new to Ubuntu.

Steps in either Windows or Ubuntu would be greatly appreciated.

Thanks,

Michael

Revision history for this message
Andre Czausov (pixeldude) wrote : Re: [Bug 277865] Re: usb-creator crashed with AttributeError in install_bootloader()

Michael,

I'm pretty shaky with this myself, but I'll share what I've gleaned so far:

The tool you will need (on Ubuntu) is GParted. It's part of the default
LiveCD, but seems not to be present on a standard desktop install -- if you
don't have it you'll have to "sudo apt-get install gparted" in a terminal
shell or use Synaptic to get the package.

Once you run GParted, you'll probably be first shown the partitions on one
of your hard disks. Use the Device menu over to the right of the window to
select your USB drive instead.

You now have two options:

Easiest is to choose the Create Partition Table option from the Device menu
(on the GParted pulldown menus), and follow the prompts. This will remove
any and all data and create your new table.

Alternatively: On the main display, select the existing USB drive partition
(if there is one, which is likely -- probably formatted as FAT32). Then,
making sure the correct partition is now highlighted, press the "Delete"
option button on GParted's main toolbar. Now (the drive table will be marked
as "Unallocated") you can press the "New" toolbar button and create your new
partition table. Finally, press the "Apply" button to effect these changes.

best of luck,

Andre.

On Fri, Nov 7, 2008 at 9:06 AM, Snoopstaa <email address hidden>wrote:

> DarrenS,
>
> Could you advise how to create a partition table on a usb key?
>
> I'm moving over from Vista, cause its giving me the shits, so I'm new to
> Ubuntu.
>
> Steps in either Windows or Ubuntu would be greatly appreciated.
>
> Thanks,
>
> Michael
>
> --
> usb-creator crashed with AttributeError in install_bootloader()
> https://bugs.launchpad.net/bugs/277865
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>

--
amc

Revision history for this message
Snoopstaa (ubuntu-trashed) wrote : Re: usb-creator crashed with AttributeError in install_bootloader()

Thank Andre,

It worked!

Shame that the USB install is just a copy of the Live CD install, I thought it would be almost like a full version of Ubuntu (ie without the Boot Installer Menu)

Going to try it for a while and might switch if its better.

Thx

Revision history for this message
Walter Bankes (wjbite) wrote :

Used 4 gb Kingston flashdrive.
Set available space for my files to 1 gb.
crashed.
Hope you are able to work this out - I would REALLY like to use it.
Thanks.

Revision history for this message
Max Bowsher (maxb) wrote :

Setting to Confirmed as I've independently come across the same issue of usb-creator breaking on a USB stick without a partition table

Changed in usb-creator:
status: New → Confirmed
Revision history for this message
Max Bowsher (maxb) wrote : Re: usb-creator crashes when USB stick is a single filesystem with no partition table. (AttributeError in install_bootloader())

Supplementary to the core problem of explaining to the user if their USB stick has no partition table that it cannot be made bootable, a quick fix that would at least give the user an error rather than a hang would be to wrap the backend.install_bootloader() call in a try/except block in the same way backend.copy_files() is.

Revision history for this message
bigdeedah (scott-middleton) wrote :

It is parted that causes the problem.
http://<email address hidden>/msg02586.html
...
parted does not recognise the label, because there is no label present. what
you need to do is to create a new label and create a partition inside that. We
might want to change the message though.
...

Revision history for this message
Walther Zwart (wahez) wrote :

Had the same problem here. I had an USB stick with a filesystem on the block device (and no partition table).

I created 3 patches:
The first one is for a bug in backend.py
The second one detects the problem in gtk_frontend.py
The third one makes the logging a bit more reliable.

Revision history for this message
Walther Zwart (wahez) wrote :
Revision history for this message
Walther Zwart (wahez) wrote :

This patch makes the frontend log the error before it does anything else. While troubleshooting this bug, the warning sometimes wouldn't come up and there would be nothing in the log. With this patch it will at least show up in the log file.

Revision history for this message
Alexander Chemeris (alexander-chemeris) wrote :

Your patches does not apply cleanly on recently updated Intrepid on x86_64. And manual apply does not solve the problem. I had to reformat my flash drive and create a partition table on it to get through.

Revision history for this message
Walther Zwart (wahez) wrote :

I made the patch against bzr trunk.

The patch does not 'solve' the problem, but it makes usb-creator handle the situation like it should.
As far as I can see you cannot install the live-cd to a disk without a partition table.
So with these patches you get an error message if you try.

You still have to format the drive manually, because usb-creator should not destroy an existing filesystem.

Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

I experienced this problem myself but instead of it crashing, I get "Install failed: Unable to determine the partition number.". This is because "dev.GetProperty('block.device')" returned /dev/sdb which has no number at the end which "re.match('.*([0-9]+)$', tmp" looks for.

summary: - usb-creator crashes when USB stick is a single filesystem with no
- partition table. (AttributeError in install_bootloader())
+ usb-creator fails to install when USB stick is a single filesystem with
+ no partition table.
Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

Here is the output of hal-device (with my usb stick still inserted) :-)

Revision history for this message
maheshjagadeesan (maheshj) wrote : Re: [Bug 277865] Re: usb-creator crashes when USB stick is a single filesystem with no partition table. (AttributeError in install_bootloader())

Thank you for the notification :-)
I hope you
~~~~~~~~~~~~~~~~
www.maheshj.info/ask
Sent from: Maharashtra India.
George Burns - "Don't stay in bed, unless you can make money in bed."

2009/3/25 Cody A.W. Somerville <email address hidden>

> Here is the output of hal-device (with my usb stick still inserted) :-)
>
> ** Attachment added: "Output of hal-device"
> http://launchpadlibrarian.net/24314625/hal-device.mercurial.out
>
> --
> usb-creator fails to install when USB stick is a single filesystem with no
> partition table.
> https://bugs.launchpad.net/bugs/277865
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>

Revision history for this message
Evan (ev) wrote :

In switching to a devicekit-disks backend, usb-creator now marks unpartitioned disks as needing to formatted. I've filed bug #432532 for the desire to be able to write Ubuntu images to unpartitioned disks without first reformatting them.

Changed in usb-creator (Ubuntu):
status: Confirmed → 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.