Tuesday, March 22, 2022

macOS howto format usb drive to dos compatible, max 4GB

 diskutil eraseDisk FAT32 MY_DISK1 /dev/disk2

Labels: , ,

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: , , ,

Sunday, May 13, 2018

HOWTO convert ubuntu 18.04 LTS ISO to bootable USB installation disk on Mac OSX


minimum 2GB size of SD card

0) find name of SD card in file system
diskutil list

1) download from ubuntu.com the 18.04 LTS image
cd ~/Downloads/
ls ubuntu-18.04-desktop-amd64.iso

2) convert ISO to dd-table binary image
hdiutil convert -format UDRW -o ubuntu1804.img ubuntu-18.04-desktop-amd64.iso

3) unmount SD card, eg. disk3
diskutil unmountDisk /dev/disk3

4) write to SD card
sudo dd if=./target.img.dmg of=/dev/rdisk3 bs=1m


Labels: , , , , , , , , ,