4

I have 8GB flash memory stick. Sometimes ago I formatted it to be able to install Windows from it. I can't remember what exactly I did but I think I wanted to be able to install Win 7 64-bit to boot in EFI mode.

Now I can't reformat it nor in Windows nor in Linux.

I tried to convert it to MBR from GPT with gdisk by gdisk /dev/sdc, then w (to write GPT from memory to the drive as the tool reported "Found invalid GPT and valid MBR; converting MBR to GPT format in memory"). Then gdisk /dev/sdc again:

    # gdisk /dev/sdc
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************

, opened expert tools with x, z (to destroy GPT). Here is the output:

Expert command (? for help): z
About to wipe out GPT on /dev/sdc. Proceed? (Y/N): Y
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
Blank out MBR? (Y/N): Y
#

then tried to delete a partition with fdisk

# fdisk /dev/sdc

Command (m for help): p

Disk /dev/sdc: 8086 MB, 8086618112 bytes
249 heads, 62 sectors/track, 1023 cylinders, total 15794176 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a07ca

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *          62    15793073     7896506    7  HPFS/NTFS/exFAT

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdc: 8086 MB, 8086618112 bytes
249 heads, 62 sectors/track, 1023 cylinders, total 15794176 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a07ca

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

Error closing file

After this I tried to pull out and plug in the stick again but NTFS mount error window appeared each time.

enter image description here

I also tried to rewrite an initial drive area with a test content with badblocks

sudo badblocks -w -s -o /tmp/usbstick.log /dev/sdc

and with dd

sudo dd if=/dev/zero of=/dev/sdc bs=1024k count=2

but I couldn't reformat it to usable state.

Is there a way I can restore its factory state?

My system: Linux Mint 17.3

UPDATE

# blkid
/dev/sdc1: UUID="675599A00CE338FC" TYPE="ntfs"

# usb-devices
T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#=  4 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1307 ProdID=0190 Rev=01.00
S:  Manufacturer=USBest Technology
S:  Product=USB Mass Storage Device
S:  SerialNumber=00000000000004
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=98mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
  • What does blkid report for this drive? Also run the usb-devices script (if you have it). Do you have cfdisk? To keep things simple you should probably try to create a FAT32 partition on the drive. – PM 2Ring Mar 12 '16 at 2:23
  • Unless you know its factory state, no. However, it is easy to restore it to a useful state. Suggest you use dd again. This time make the count equal to 500 – fpmurphy Mar 12 '16 at 7:18
  • @PM2Ring please see UPDATE section. FYI, I have cfdisk. – gumkins Mar 12 '16 at 8:59
  • @fpmurphy1 I've just run dd with count=500, it must rewrite the first 500MB, right? However, I rebooted and Windows 7 installation started (I was able to see the first window with language/location/keyboard selection. So it looks like dd writes to the device but those changes are not applied. – gumkins Mar 12 '16 at 10:00
  • ... or, the boot/installation data is located not at the beginning, right? – gumkins Mar 12 '16 at 11:59
0

I hope, I understand properly what you want.

Recently, I had a similar issue. It was after making a bootable USB drive for installing ubuntu. Therefore, I used the dd command: sudo dd if=*.iso of=/dev/sdb . Afterwards I could not access the full storage capacity of my drive (that means: also after formatting my device, further, programs like fdisk did not show its capacity).

Further, applying gparted, I could only reduce the visible amount of usable disk-space, but not restore ist to the maximum of appr 8 GB. Also, gparted wouldn't show me the 8 GB but 4, 3, 2..., whatever I reduced it to. At least using Windows, I could not solve the problem (but I didn't try extensively nor did I have admin privileges). What I did then was to delete all partitions on my usb-stick with fdisk and rebooted the computer. Then the storage capacity shown was around 8 GB again, as I expected.

Your usage of dd command sudo dd if=/dev/zero of=/dev/sdc bs=1024k count=2 won't write zeros onto the whole drive.

You said, you cannot format your usb drive. Further you said you deleted all of your partitions. So my suggestion is, that you run the following command to format your drive (Maybe you will have to do this using the sudo command):

mkfs.vfat -I -F 32 /dev/sdX

where X has to be replaced for the letter of your drive. You can try to write a new partition/partition-table onto your drive before, using sudo fdisk /dev/sdX (d to delete partitions, n to make a new partition [e.g. over the whole device] and with t you could change the type of the partition table; with p you can check the partitioning of your device). But anyway, you wrote, you already used fdisk.

I searched on google, I didn't find information, that linux mint is using a different command for formatting than at least most other linux distributions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.