Reinitialize USB pendrive that was used to boot linux

2

I have a pendrive that was used to boot a linux image (created using dd if=... of=/dev/sd4 bs =1m on a mac)

Now I would like to use it again as regular pendrive. Unfortunately I just have a windows xp pc available. The problem is the drive is 8BG in size - but I can only access about 2GB that were used by the boot image.

In Computer Management>Storage>Disk Management the drive is show 7.45GB in size with a 2.36GB partition. But for the small partition "delete partion" is grayed out, also in the unused space "new partition" is grayed out.

Here's what I tried:

  • If I use diskpart on the command line list disk only shows the built in drives - so I can not select the drive.

  • I also tried a 'lexar_usb_format' utility - but it also just allowed me to format the 2.3GB.

  • I tried the same on a second XP machine with same results.

If I wait till weekend I can try to restore it on a Mac - but I find it hard to believe there's no way to fix it using plain windows.

(and unfortunately this time I can't boot into linux as the distro won't boot on this PC - bad luck)

bdecaf

Posted 2013-03-06T11:16:32.477

Reputation: 458

Have you tried formatting the partition? If that works, it would rule out any hardware damage to the USB drive. – Dennis – 2013-03-06T14:30:13.593

Yes formatting and writing to it works as expected. It's just that the formatted partition is 2.3GB instead of 8. – bdecaf – 2013-03-06T14:52:23.690

Answers

3

What about using DISKPART in Windows?

  1. Open the Command Prompt as the Administrator, and type DISKPART, and press Enter.
  2. Type LIST DISK and press Enter to see the physical disks attached. Look for which disk is your flash drive (usually DISK 1 or DISK 2).
  3. Type SELECT DISK x (replace x with the number of your flash drive), then press Enter.
  4. Finally, type CLEAN and Enter.
  5. Type CREATE PARTITION PRIMARY, and ASSIGN LETTER X: (replace x: with any free drive letter).
  6. You can also run a FORMAT from this program, or run it separately.

Canadian Luke

Posted 2013-03-06T11:16:32.477

Reputation: 22 162

I will keep that in mind. "Unfortunately" I managed to solve this in the mean time on a mac, so I can't try it right now. I just fear it will have the same issue as the disk management tool. – bdecaf – 2013-09-09T09:16:28.183

0

The cause of your problems is that your pen drive currently has a file system designed for optical disc media (usually ISO 9660), which does not allow the creation or deletion of partitions.

Normally, it would suffice to create a new partition table (e.g., an MS-DOS partition table). Unfortunately, there seems to be no option for this in Disk Management.

The easiest way to fix this should be using a third-party partition manager. Most items from List of disk partitioning software should be able to achieve this.

You could, e.g., download a GParted LiveCD image and do the following:

  1. Burn the image to an optical disc or a pen drive (not the drive you're going to format) and boot from it.

  2. Select the pen drive by clicking GParted → Devices → /dev/sdX (7.45 GiB).

  3. Create a new partition table by clicking Device → Create Partition Table → Apply.

  4. Create a new partition by clicking Device → New, selecting a suitable File system1 and clicking Add.

  5. Confirm the changes by clicking Edit → Apply All Operations.

  6. Eject the LiveCD and reboot.


1 Option fat32 is the safest bet when using both Windows and Mac OS X. Option ntfs allows creating files larger than 4 GiB, but Mac OS X cannot write to NTFS partitions without additional software.

Dennis

Posted 2013-03-06T11:16:32.477

Reputation: 42 934

Well I'm already aware that I can fix the problem under a "proper" OS. It's more that I would be interested how to solve it under windows as this had happened to me several times - and rebooting is quite the hassle. – bdecaf – 2013-03-06T19:50:32.453

Actually I think your diagnosis is flawed. As you can see from the discussion I was able to format it to FAT32 (NTFS was also available) and was able to write to it. Neither the "original" image nor ISO 9660 would allow that. – bdecaf – 2013-03-06T19:53:32.903

ad 1. I've posted a tutorial for GParted since that's what I have installed. Most items from List of disk partitioning software should be able to achieve this. ad 2. Disk Management somehow manages to create a partition without creating a fully functional partition table. Creating a new partition table will allow you to create, modify and delete partitions in Disk Management.

– Dennis – 2013-03-06T23:46:35.153

0

I think it is related to this "removable bit" mentioned here: USB sticks and multiple partitions

Edit The lexar download has moved - but I could find it here. Unfortunately it won't modify my drive. Suppose I would need to make the steps suggested in https://superuser.com/a/471197/98182

bdecaf

Posted 2013-03-06T11:16:32.477

Reputation: 458

0

starc

Posted 2013-03-06T11:16:32.477

Reputation: 1