Problem Statement
What command creates a new filesystem on a partition?
Explanation
Mkfs (make filesystem) creates filesystem on partition. Syntax: mkfs -t TYPE DEVICE or mkfs.TYPE DEVICE. Types: ext4, xfs, btrfs, vfat. Example: mkfs -t ext4 /dev/sdb1 or mkfs.ext4 /dev/sdb1 creates ext4 filesystem. Warning: destroys existing data.
Partitioning tools: fdisk (MBR partitions), gdisk or parted (GPT partitions), lsblk shows block devices and partitions. Steps: partition disk with fdisk, create filesystem with mkfs, mount with mount, add to /etc/fstab for automatic mounting.
Mount filesystem: mount /dev/sdb1 /mnt/data mounts to directory. Unmount: umount /mnt/data or umount /dev/sdb1. Check mounts: mount or df -h. Persistent: add to /etc/fstab with device, mount point, filesystem type, options, dump, pass fields.
LVM (Logical Volume Manager): provides flexible volume management, create physical volumes (pvcreate), volume groups (vgcreate), logical volumes (lvcreate), resize without unmounting. Understanding disk management is essential for storage administration.
