mkfs — create a filesystem
cheat sheet · Ubuntu 24.04 · e2fsprogs 1.47 · xfsprogs 6.6 https://lab.dimsanych.ru/en/wiki/mkfs/Cheat sheet
-
lsblk -f /dev/vdbwhat is on the disk now -
sudo mkfs.ext4 /dev/vdb1ext4 on a partition -
sudo mkfs.ext4 -L data /dev/vdb1with the label data -
sudo mkfs -t ext4 /dev/vdb1the same through mkfs -t -
sudo mkfs.xfs -L logs /dev/vdb2xfs with a label -
sudo mkfs.ext4 -n /dev/vdb1show parameters, create nothing -
sudo blkid /dev/vdb1the new filesystem's UUID for fstab
Options
Below are the options of mkfs.ext4 (that is mke2fs) and mkfs.xfs. The full lists
are in man mke2fs and man mkfs.xfs.