Jul 5, 2018

Format an SD card in Linux

Exchange ‘sdb’ with the name of your block device in the following command:

sudo parted /dev/sdb

(parted) mklabel msdos

(parted) mkpart primary fat32 1MiB 100%

(parted) set 1 boot on

(parted) quit

Now format it as fat32:

sudo mkfs.vfat /dev/sdb1

Just exchange ‘sdb1’ with the partition of your drive. Make sure to format the ‘partition on ‘sdb’ and not ‘sdb’ itself.