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.

9
  • Please edit and clarify your question. What exactly is "formatting it in disks"? What did you do and how did it fail? What's the output of sudo parted -l with the disk connected?
    – terdon
    May 15, 2014 at 23:28
  • 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. Then I tried following the advice on the first answer on this page:askubuntu.com/questions/308898/wipe-usb-flash-drive-ubuntu. I'm trying to now use the usb with winusb and winusb just keeps trying to format it.
    – user278904
    May 15, 2014 at 23:32
  • What is the default way? what program did you use?
    – Mr.Lee
    May 15, 2014 at 23:37
  • Thanks for the edit. Please also add the result of the command I asked for (sudo parted -l), we have no idea why and cannot help you fix a Windows program that does read a USB. We don't do Windows stuff here and have no knowledge of it. You also need to explain what you mean by "default way". What commands/programs and what settings did you use?
    – terdon
    May 15, 2014 at 23:39
  • added info to main body.
    – user278904
    May 15, 2014 at 23:44

3 Answers 3

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.
0
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.

1
  • Tried it. Didn't work.
    – user278904
    May 16, 2014 at 1:15
-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)

3
  • Anyone have a linux alternative for this?
    – user278904
    May 16, 2014 at 5:25
  • This is a program for Windows, however this site is about Linux and Ubuntu in particular. This tool only exists because Windows by default refuses to partition USB storage, where Linux tools generally allow this. Also please don't post links to sites owned by Hubert Burda Media, they tried to wreck the web and internet several times for the sake of their business model. Use Heise (german equivalent to Slashdot that embraces the web and internet) if you have to, when you cannot find the proper source link.
    – LiveWireBT
    May 16, 2014 at 5:34
  • Thx for your comment. Still I don't mind if I use a Win Tool when I am stuck and need a quick solution - I thought it's also about helping here(?). Didn't know about that Burda story, but I'll keep it in mind^^
    – jhort
    May 19, 2014 at 9:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .