Wednesday, April 01, 2020

linux (eg. ubuntu) format USB and check health status

 usb drive doesn't have health data. 


First, find the drive device using df  or  lsblk

Eg. unmount the device sdc1

$ umount /dev/sdc1


Format usb drive to FAT32 on linux

    $ sudo mkfs.vfat -F 32 /dev/sdc1


Check disk for bad blocks by writing different byte patterns
WARNING!  Write mode is destructive. 

    $ sudo badblocks -w -s -o  myusb.log /dev/sdc
        # write-mode,  show progress, output to file 

# non-destructive 
    $ sudo badblocks -nvs > usberr.log /dev/sdc

# or through   fsck  or  mkfs
    # option:   -fcky    or      -fccky    # one 'c' read-only,  'cc'  read-write non-destructive

Labels: , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home