How to fix memory stick reader

Sometimes memory stick dies. This is how to bring it back to life. 

1. Check the partition table, to get the impression of the way Linux recognises memory stick as a device.  

# cat /proc/partitions  major minor  #blocks  name     8     0   39070080 sda    8     1   22528296 sda1    8     2     971932 sda2    8     3   15566985 sda3    8    16     976384 sdb    8    17     971901 sdb1 

# fdisk -l  gives rather overwhelming information, but can be used as well.  sdb Disk together with sdb1 partition are representing memory stick file system. Usually memory stick is recognised as sdb or sdc device.  

2. Creating file system on memory stick.  

a) Delete all from memory stick.  # dd if=/dev/zero of=/dev/sdb  

b) Recreating MBR (Master Boot Record). mbr packet needs to be installed first. In case Debian, do as root 

# apt-get install mbr 

# install-mbr --force /dev/sdb  

c) Creating new partition with FAT32 file system on it. Use parted or fdisk or cfdisk. 

# parted /dev/sdb  (parted) mkpartfs primary fat32 0 100%  (parted) print   (parted) quit 

3. Creating partition Label.  # mkfs.vfat -n Label /dev/sdb1