>

Format USB Drive for EXT4

Use lsblk to identify device

$ lsblk
NAME                 MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                    8:0    0 119.2G  0 disk 
├─sda1                 8:1    0   500M  0 part /boot
└─sda2                 8:2    0  55.4G  0 part 
  ├─centos_kate-swap 253:0    0     3G  0 lvm  [SWAP]
  ├─centos_kate-root 253:1    0  35.2G  0 lvm  /
  └─centos_kate-home 253:2    0  17.2G  0 lvm  /home
sdb                    8:16   1  28.9G  0 disk 
└─sdb1                 8:17   1  28.9G  0 part /mnt/KATE_BACKUP
sr0                   11:0    1  1024M  0 rom  

Format with EXT4

Create a GPT partition table by issuing:

sudo parted /dev/sdb --script -- mklabel gpt

Run the following command to create a EXT4 partition that takes the whole space:

sudo parted /dev/sdb --script -- mkpart primary ext4 0% 100%

Format the partition to ext4:

sudo mkfs.ext4 -F /dev/sdb1

How to Format USB Drives and SD Cards on Linux
https://linuxize.com/post/how-to-format-usb-sd-card-linux/

banner ad

Comments are closed.