I have pen drive that shows unloacted.I have tried many tools as gparted,fdisk,gpart,testdisk etc. but i can't make it usable. Here is my test results:


$ sudo fdisk -l
Disk /dev/sdc: 8010 MB, 8010194944 bytes 
247 heads, 62 sectors/track, 1021 cylinders, total 15644912 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: 0xd0e2392f 
Disk /dev/sdc doesn't contain a valid partition table 

So this device size is correctly identified as 8010MB (8GB) and is located at /dev/sdc. Interestingly, fdisk has reported that this device is not having a valid partition table. So something has happened to the partition table and I wanted to fix it with the help of fdisk command as follows

$sudo fdisk /dev/sdc 
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF     disklabel 
Building a new DOS disklabel with disk identifier 0x4c9b7827. Changes will  remain in memory only, until you decide to write them. 
After that, of course, the previous content won't be recoverable. 
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) 
Command (m for help): w 

The partition table has been altered! Calling ioctl() to re-read partition table

Then i have tried to partition the pendrive

#sudo fdisk /dev/sdc 
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) 
Command (m for help): n 
Partition type: primary (0 primary, 0 extended, 4 free) extended Select (default p): p 
Partition number (1-4, default 1): 1 
First sector (2048-15644911, default 2048): Using default value 2048 
Last sector, +sectors or +size{K,M,G} (2048-15644911, default 15644911): Using default value 15644911 
Command (m for help): w 
The partition table has been altered! 
Calling ioctl() to re-read partition 

After doing this my pen drive still unlocated.Then i try to solve using gparted.

Gparted results:

I used "gparted" tool to add a partition table. As shown in above image, gparted shows this device at /dev/sdc with Partition=unallocated and FileSystem=unallocated, so it also identified that there was an issue. So I tried adding a partition table [by Device -> Create Partition Table...] of msdos type, but GUI displayed an error message as "Error while creating partition table". Command line also had some issues listed as below

$sudo gparted
libparted : 3.1
/dev/sdc: unrecognised disk label 
/dev/sdc: unrecognised disk label

Now how can i solve the problem. thanks in advance.

  • Did you use the dd method to create a bootable flash drive installer? That does not create standard partitions nor partition table and then the location of the partition table on flash drive has random data making it invalid. Often just zeroing out MBR will fix it. Make absolutely sure you are running this command on the correct drive or you damage something. dd if=/dev/zero of=/dev/sdX bs=512 count=1 Change sdX to your correct drive, sdc or whatever it now is. Double check again that it is correct drive. – oldfred Mar 18 '14 at 18:29
  • OUput: $sudo dd if=/dev/zero of=/dev/sdc bs=512 count=1 1+0 records in 1+0 records out 512 byes (512 B) copied, 0.00126988 s, 403 KB/s still i can't mount it. – TuxBot Mar 18 '14 at 19:55
  • Perhaps because you used sudo gparted? With gui applications you should use gksudo gparted to have correct permissions. But I doubt that is issue. Flash drives do not last forever. – oldfred Mar 18 '14 at 20:18

You might try zeroing out the drive as mentioned in the comments by running...

# dd count=1 bs=512 if=/dev/zero of=/dev/sdx && sync

... where sdx is the drive you're wanting to format.


Then create a new partition table...

# cfdisk /dev/sdx
# mkfs.ext4 /dev/sdx1
# e2label /dev/sdx1 USB_STICK

This combined with running gparted with...

gksudo gparted

...worked for me. I had a USB stick that I dd'd an iso on to ot use for booting then had trouble recovering it. These were the steps I took and it as usable again.

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.