I formatted my 16GB pen drive with the NTFS file system in windows vista. After that I started copying some files. However, only a few files were copied to the pen drive before the copy operation hung. So I cancelled the copy operation.
Now I am unable to use the pen drive. I DON'T REALLY NEED ANY FILES THAT I COPIED TO THE PENDRIVE. I JUST WANT TO USE THE PENDRIVE AGAIN.
I have tried using Ubuntu to format the pen drive. But when i use fdisk
to delete the partition, it looks like it is working fine but in fact it does not delete the partition. Also I am unable to format it with any other file system.
When I tried to use gparted
, it throws the following error:
Error mounting: mount exited with exit code 14: The disk contains an unclean file system(0,0).
The file system wasn't safely closed on window.
Fixing ntfs_attr_pread_i:ntfs_pread failed: Input/output error
Failed to read NTFS$Bitmap:Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a softRAID/FakeRAID hardware.
In the first case run chkdsk /f on Windows then reboot into windows twice.
The usage of the /f parameter is very important!.
If the device is a SoftRAID/FakeRAID then first activate it and mount a different device under the /dev/mapper directory, (e.g. /dev/mapper/nvidia_eahaabcc1).
Please see the dmraid documentation for more details
When I searched the Internet I found help on how to recover. But I don’t want to recover, I want to format it again.
When I pressed w after deleting the partition, it took more time than previously. After that i removed the pen drive and re-inserted, but the partition I had deleted was still present.
If I simply type the command fdisk /dev/sdb
without removing the pen drive after the partition is deleted, then it returns the error message Unable to open /dev/sdb
.
Here are the steps that I followed:
root@yesuraj-ubuntu:~# fdisk /dev/sdb
Command (m for help): d
Selected partition 1
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks
THE DEMESG PRINTS ARE AS FOLLOWS,
[ 6139.774753] usb 2-1.3: reset high speed USB device number 4 using ehci_hcd
[ 6154.816941] usb 2-1.3: device descriptor read/64, error -110
[ 6169.968908] usb 2-1.3: device descriptor read/64, error -110
[ 6170.158427] usb 2-1.3: reset high speed USB device number 4 using ehci_hcd
[ 6185.200638] usb 2-1.3: device descriptor read/64, error -110
[ 6200.352572] usb 2-1.3: device descriptor read/64, error -110
[ 6200.542093] usb 2-1.3: reset high speed USB device number 4 using ehci_hcd
[ 6205.559460] usb 2-1.3: device descriptor read/8, error -110
I used the dd
command and it erased the partition table.
But now when I connect the pen drive, dmesg
contains this error message:
[88143.437001] sdb: unknown partition table
.
I am not able to create a partion using fdisk /dev/sdb
. The error message says that it is unable to find the node.
Other messages from dmesg
follow below.
[87100.531596] usb 2-1.3: new high speed USB device number 39 using ehci_hcd
[87130.915257] usb 2-1.3: new high speed USB device number 40 using ehci_hcd
[87135.932647] usb 2-1.3: device descriptor read/8, error -110
Best Answer
If you are completely, positively, SURE that you want to erase the current contents of your pen drive, then you can try the
dd
command as described below.First, check one last time that
/dev/sdb
refers to the pen drive you want to erase. As another answer has pointed out, you want to have no doubt that you are erasing the correct device. (I would probably run the commandsudo fdisk -l
as an extra check.)The
dd
command below should write zeros to the first MiB of the pen drive which will erase any partition table. This should completely remove any partitioning.If you decide you want to write zeros to the entire device, just omit the
count=1
parameter. This will take longer, of course. How much longer depends on the size of the pen drive you are erasing.After you have erased the partition table with zeros, you can partition the drive. I would do this using
gparted
simply because I am familiar with that tool and know how to use it.Here is how I would do it.
gparted
is not already available on your system, install it. You could, for example, use the command below.sudo apt-get update && sudo apt-get -y install gparted
gparted
, entering your password when it is requested.gparted
device.MS-DOS
style partition table.gparted
at this point and usefdisk
to partition the pen drive.Note:
If you wanted to do this in Windows I suggest using the
DISKPART
command in a command window. Once inDISKPART
select the correct disk and then issue the commandCLEAN
.(You can issue the command
HELP CLEAN
while inDISKPART
form more information about what the command does.)