Anything can go here, in any language... except my native language Sinhala. Be cool... anybody is warmly welcomed! :)

Solution for Some USB Flash Drive Problems


Today I'm gonna put the English translation of one of my Sinhala blog posts, which talks about a solution some possible problems that might occur with USB flash drives. Roughly I would say the solution is to destroy and rebuild the filesystem on the device. But this is not actually the same content from original blog post.

Well, most of us are carrying those portable memory devices... some call it pen drive... and some call it flash drive... and some other may call thumb drive. Whatever it is, it has become an essential thing with our day to day life.

First, I must tell an important thing,.. pay extreme attention when following these instructions. Unless, a single mistake could ruin your entire hard drive!

OK, the first thing that I'm going to point out is, you may have seen that capacity of a flash drive is indicated less than the value printed on it. I'm not talking about indicating a 4 GB drive as 3.77 GB. Sometimes you might have seen a scenario where the drive has been indicating 3.77 GB, but later it has become a lower value like 1.2 GB. Yes, I'm talking about that problem.

In certain other cases, Windows would not detect the device. It might show a message like 'Insert disk...' also.

As far as I think, the reason behind this might be physical, electrical or electronically damage to the device. Also, viruses are also a suspect. However, if the damage is too severe, then you might not be lucky enough to succeed with these instructions. I have tested this several times successfully, but unsuccessful attempts are there as well.

So, my instructions are based on Linux, to be executed on a command line shell, free, open and adventurous! :)

First, you need to backup existing data on the device. Use any backup tool or you can use the following command. (Assumed that the flash drive is /dev/sdb and it's filesystem is FAT32)
# mount -t vfat /dev/sdb1 /mnt
# tar cvpzf backup.sdb.tgz /mnt

If you are not sure about the device file (/dev/?d?), just enter the following command and identify your flash drive.
# fdisk -l

Now unmout the device if mounted.
# umount /dev/sdb

Then we will clear everything on the device, including it's partition table (overwriting MBR). We do not have this option with Windows.
# fdisk /dev/sdb
Enter o to create a new disklabel (this is not the drive label which we can see on a windows parition)
Enter w to write the MBR and exit fdisk.

Now, create the only partition on the flash drive. Of course you can have multiple partitions on the flash drive. But I'm not sure about whether Windows would detect all the partitions.
# fdisk /dev/sdb
Enter n to create a new partition.
Enter p to make it primary.
Enter 1 as the partition number.
Press Enter twice to use default starting and ending points.
Enter w to write changes and exit.

We have finished setting up the partition, now the next thing is to format. It's a good choice to format as FAT32 because when you do so, the drive can be used with both Windows and Linux. If the device capacity is more than 4 GB, I would recommend NTFS. Well, that would be another story. I'm gonna write about that some day as well. If it is the memory stick on your mobile phone, your choice should be FAT16 -- this depend on your phone's type also.

To format as FAT32,
# mkdosfs -F 32 -cv -n DRIVELABEL
I use verbose (-v) option so I can see the progress, -c is to probe for bad clusters (this can take some time), and -n for Windows disk volume label (DRIVELABEL in this example) which can be or less than 11 ASCII characters.

To format as NTFS,
# mkntfs -C -I -v -L DRIVELABEL
-C to enable compression, and I to disable indexing (Windows XP), -v for verbose output and -L for volume label which cab be or less than 32 ASCII or unicode characters.

So, this is the end of my post. This method is not alwsys successful, but I was lucky in two of three situations.

Thanks for reading!

Comments (0)

Followers

Subscription Options

 Subscribe in a reader

or

Enter your email address:

and
to inscrease

and make me happy. :)

Other Blogs by the Author

The Author

www.flickr.com
ශාකුන්තල | Shaakunthala's items Go to ශාකුන්තල | Shaakunthala's photostream
free counters
TopOfBlogs
Related Posts with Thumbnails