Repair a USB Flash Drive

FAT32 Filesystem Commands

 The following commands may help with a USB pen drive (flash drive) that is not readable.

 3  unmount /dev/sdb1
 4  man mount
 5  umount /dev/sdb1
 6  fdisk /dev/sdb1
 7  mount /dev/sdb1 /tmp/r2d
 9  fsck.msdos /dev/sdb1
10  fsck.msdos -f -r /dev/sdb1


command 9 shows information on the status of the file system

	I chose the "second FAT"

command 10 actually fixes the file system.   
        

Remeber to give the fsch some time to finish, as it may take a while.

Sample Output

 

Feb 10 07:53:37 localhost fstab-sync[3524]: added mount point /media/floppy for /dev/fd0
Feb 10 07:53:38 localhost hald[2604]: Timed out waiting for hotplug event 288. Rebasing to 288
Feb 10 07:53:40 localhost hald[2604]: Timed out waiting for hotplug event 290. Rebasing to 290
Feb 10 07:53:43 localhost fstab-sync[3552]: added mount point /media/LEXAR_MEDIA for /dev/sda1
Feb 10 07:53:43 localhost kernel: SELinux: initialized (dev sda1, type vfat), uses genfs_contexts
Feb 10 07:53:44 localhost gconfd (root-3376): Resolved address "xml:readwrite:/root/.gconf" to a writable configuration source at position 0
Feb 10 08:01:02 localhost crond(pam_unix)[3621]: session opened for user root by (uid=0)
Feb 10 08:01:02 localhost crond(pam_unix)[3621]: session closed for user root
Feb 10 08:21:54 localhost kernel: usb 1-2: USB disconnect, address 2
Feb 10 08:21:57 localhost fstab-sync[3722]: removed mount point /media/LEXAR_MEDIA for /dev/sda1
Feb 10 03:23:24 localhost kernel: usb 1-2: new full speed USB device using address 3
Feb 10 03:23:24 localhost kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Feb 10 03:23:25 localhost kernel:   Vendor: LEXAR     Model: JD EXPRESSION     Rev: 1.00
Feb 10 03:23:25 localhost kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Feb 10 03:23:25 localhost kernel: SCSI device sda: 2014992 512-byte hdwr sectors (1032 MB)
Feb 10 03:23:25 localhost kernel: sda: Write Protect is off
Feb 10 03:23:25 localhost kernel: sda: assuming drive cache: write through
Feb 10 03:23:25 localhost kernel:  sda: sda1
Feb 10 03:23:25 localhost kernel: Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Feb 10 03:23:26 localhost scsi.agent[3783]: disk at /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.0/host1/1:0:0:0
Feb 10 08:23:33 localhost hald[2604]: Timed out waiting for hotplug event 303. Rebasing to 303
Feb 10 08:23:37 localhost hald[2604]: Timed out waiting for hotplug event 306. Rebasing to 306
Feb 10 08:23:37 localhost netfs: Mounting other filesystems:  succeeded
Feb 10 08:23:38 localhost apmd[2302]: Standby Resume (-1% unknown) AC power            
        

Ext3 Filesystem Commands

 This particular command was used to repair the ext3 partition on an SD Card with the Raspberry Pi Raspbian operating system on it.

sudo fsck -f -r /dev/mmcblk0p2
sudo umount /dev/mmcblk0p2
        

Date Created: 2016-11-16 20:19:54 -0600 (Wed, 16 Nov 2016)



back    |    top