Skip to main content

Disk Management

Disk device list

lsblk

Detect the disk

sudo fdisk -l /dev/<device-name>

Create a filesystem / format partition

sudo mkfs.ext4 /dev/<device-name>

Resize Filesystem (if already partitioned)

sudo resize2fs /dev/sdb1

Display storage size

df -h

Mount disk

mount /dev/<device-name> <path>

Unmount disk

umount <path>

Persist the mount on reboot

nano /etc/fstab
/dev/<device-name>   <path>   ext4    defaults    0   2