Disks, partitions and file systems: fdisk, mkfs, ext4, xfs
Sign in to read this lesson
A new disk has been added but is not used yet. Three steps bring it into service — a partition table, a partition and a file system. In this lesson we learn the difference between GPT and MBR, creating partitions with fdisk and parted, and choosing between ext4 and xfs.
What you will learn
- The order: partition table (GPT) → partition (
sdc1) → file system (mkfs) → mount (next lesson). - GPT is the modern standard (128 partitions, disks over 2 TB); MBR is old (4 primary partitions, 2 TB limit).
sudo fdisk /dev/sdc:gGPT,nnew partition,pprint,wwrite;qquits without writing.mkfs.ext4andmkfs.xfscreate a file system; ext4 can shrink, xfs is strong with large files but cannot shrink.mkfserases everything on the partition — check withlsblk -fthat it is the right disk first.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.