Skip to content

Instantly share code, notes, and snippets.

@deomorxsy
Last active August 17, 2019 22:41
Show Gist options
  • Save deomorxsy/243c633bc02c97248e58604abf82d913 to your computer and use it in GitHub Desktop.
Save deomorxsy/243c633bc02c97248e58604abf82d913 to your computer and use it in GitHub Desktop.
Pendrive/USB-Stick formatting in CLI

Pendrive/USB-Stick formatting in CLI

  1. detecting the pendrive:

    sudo fdisk -l
    
  2. unmounting pendrive

    sudo umount /dev/sdf1
    
  3. formatting the pendrive

    sudo mkfs.vfat -n ‘Nome Pendrive’ -I /dev/sdf1
    

    where:

    • '-n' = Volume Name
    • 'mkfs' = command responsible for format the file system
    • 'vfat' = formats in the file system FAT. Others avaible: mkfs.bfs, mkfs.ext2, mkfs.ext3, mkfs.ext4, mkfs.minix, mkfs.msdos, mkfs.vfat, mkfs.xfs, mkfs.xiafs.
    • '-I' = pen drive's partition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment