If your fat32 formatted USB memory stick / hard drive is failing on you and not allowing you to access it. You can try repairing it to restore access by using free tool fsck available with most linux distros. Beware: fsck does not guarantee full recovery but is certainly expected to fix the disk to the best possible condition so that at least some or full data can be recovered before you format it. I have used fsck installed in Ubuntu for this tutorial.

Start by installing fsck for dos by doing so:

sudo apt-get install dosfstools

Next find out the partition or drive name for your memory stick or hard drive with fat32 partition by invoking the following command

sudo fdisk -l

Check the list of partitions shown and take a note of the partition / drive that you need to check, in the example shown below it is /dev/sdc1 (You would have to replace it with corresponding drive for your case)

First we unmount the drive

sudo umount /dev/sdc1

Now run the following command to check / repair the damaged fat32 partition / drive. Note: the command shown below is only valid for fat32 partitions and not ntfs!

sudo dosfsck -t -a -w /dev/sdc1

If this command gives the following error, when your USB flash drive or partition is not recognized:

FAT is a universal file system, which can be used on both Windows and Mac OS. This file system is used in all small storage devices like pen drive, memory card, music players, USB drives and many more. However due to poor logical structure the files from the FAT file system are lost and in order to recover FAT, you need to take help of file recovery software like Yodot.