3

How do you factory reset a usb?

I have a hp 4gb usb that seems like it has a messed up partition table and ubuntu isn't recognizing all the space. I've tried formatting it in disks. That doesn't work. How do you make a usb good as new on ubuntu?

I formatted it in the default way - FAT. Originally what happened was that I did sudo dd if=memtest86-usb.img of=/dev/sdb to install memtest86 on the usb. When I was done with that I formatted it in the default way but Ubuntu kept calling it the 51mb volume in nautilus. I formatted it and tried to use it with winusb.

winusb gave me an error.

Installation failed ! Exit code: 256 Log: Formating device... Error: The backup GPT table is not at the end of the disk, as it should be. This might mean that another operating system believes the disk is smaller. Fix, by moving the backup to the end (and removing the old backup)? Warning: Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 7655424 blocks) or continue with the current setting?

Error: You requested a partition from 1000kB to 4077MB. The closest location we can manage is 17.4kB to 157MB.

Then I tried following the advice on the first answer on this page. I'm trying to now use the usb with winusb and winusb just keeps trying to format it.

Output of sudo parted -l:

Model: ATA TOSHIBA MK5076GS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size    Type      File system  Flags
 1      1049kB  496GB  496GB   primary   ext4         boot
 2      496GB   500GB  3868MB  extended
 5      496GB   500GB  3868MB  logical


Model: USB DISK 2.0 (scsi)
Disk /dev/sdb: 4077MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  4077MB  4077MB  fat32


Model: Linux device-mapper (crypt) (dm)
Disk /dev/mapper/cryptswap1: 3868MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system     Flags
 1      0.00B  3868MB  3868MB  linux-swap(v1)

Default way: Ubuntu 14.04 program "Disks" - Format - (Quick) (FAT)

winusb is a linux program for making a windows install disk.

Avinash Raj
  • 80,446
user278904
  • 43
  • 1
  • 1
  • 5

3 Answers3

8

Disks rarely works for me, but Gparted is a great alternative. I know someone has already suggested using Gparted, you tried it, and it failed. I think that's because you didn't create a new partition table first, and I believe your current table is damaged given it's showing up as "loop" so I suggest trying Gparted again; what have you got to loose right. This time create a new partition table, and then a new partition. You will loose any data currently on the drive.

Steps:

  1. In terminal type sudo apt-get install gparted.

  2. Open Gparted from the applications screen.

  3. Select your device from the drop down menu on the far right.

  4. From the top menu click "device", and then choose "create partition table".

  5. From the partition table menu choose a partition table type. [MBR and GPT are the most commonly used. If you aren't sure which to pick then pick MBR. In Gparted MBR is called "msdos".]

  6. The drive should appear as unallocated now. Right click on it and choose "new". Change the desired options and click "add".

[Screenshot of the settings I used: https://copy.com/qvCWZBqdKfRz ]

  1. Click the green checkmark on the top menu, and then click "apply" on the prompt.

  2. Click "close" on the prompt. Your device is now ready for use.

Notes:

  • Gparted only supports quick formatting.
mango
  • 140
0

Have you tried gparted?

sudo apt-get install gparted

Plug in your USB, open up gparted, select the usb device which is usually name with /dev/sd* where * is a letter. Delete all partitions and then make a new partition to fat32 or whatever you would like it to be.

Mr.Lee
  • 891
-1

Sometimes this happens if you create a smaller partition than the actual size of the stick, maybe with other tools(?). I solved the problem with the HP USB Disk Storage Format Tool (runs in Windows, needs admin rights).

HP USB Disk Storage Format Tool (Windows)

LiveWireBT
  • 29,597
jhort
  • 2,515