Create an ext4 filesystem

Format a partition as ext4 with a label. All data on it is lost.

mkfs.ext4 -L datalabel /dev/sdb1

tool
linux133 commands
tags
linuxfilesystemdisk

More linux commands

  • resize2fs /dev/sdb1

    Grow ext4 to fill the whole partition after you made the partition bigger.

  • tune2fs -l /dev/sda1 | grep -E 'Block (count|size)|Mount count|Last mount'

    Show ext2/3/4 metadata: block count and size, mount count, last mount time.

  • du -h --max-depth=2 /var | sort -rh | head -20

    Show the 20 biggest directories in /var, up to 2 levels deep.

  • df -hT --type=ext4 --type=xfs --type=btrfs

    Show free space only for real filesystems (ext4, xfs, btrfs), without tmpfs and overlay.

  • fdisk /dev/sdb

    Open an interactive editor for MBR or GPT partition tables.

all 133 linux commands