Arch Linux Install File System BTRFS¶
Instruction Order¶
- Instruction Order
- Partition The Drive
- Format The Drive Partitions
- Mount The Drive Partitions
- Generate Fstab
- External Links
Partition The Drive¶
-
See what drives are available using "fdisk".
$ fdisk -l
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x7a21f024 Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 206847 204800 100M 83 Linux /dev/sda2 206848 943925247 943718400 450G 83 Linux
-
Set up the new partition structure using "gdisk".
# gdisk /dev/sda
-
Press X to enter the advanced menu.
- Press Z to zap the drive.
- Press Y to confirm.
-
Press Y to delete MBR.
Note: If "found invalid MBR and/or corrupt GPT", create a blank GPT.
Note: If "gdisk" complains about existing partition tables, zap (wipe the partition tables) the drive.
-
Press N for new "boot"partition.
- Partition number, press Enter (default 1).
- Press Enter to use the default first sector.
- Type "500M" and presss Enter to specify the last sector.
- Enter "ef00" to specify that this is an EFI partition.
- Press N for new "root" partition
- Press Enter to use the default first sector.
- Press Enter to use the default last sector.
- Press Enter to accept the default partition type (should be "8300" or Linux).
- Write the changes to the disk by press W and then confirming.
Format The Drive Partitions¶
Note: You will require the packages, "dosfstools" and "btrfs-progs".
-
Format the EFI partition.
# mkfs.fat -F32 /dev/sda1
-
Format the Linux root partition. The label "archlinux" can be replaced with any desired string.
# mkfs.btrfs -L archlinux /dev/sda2
Mount The Drive Partitions¶
- Mount the drive parition.
# mount /dev/sda2 /mnt
- Create BTRFS subvolume for the root.
# btrfs subvolume create /mnt/ROOT
- Create BTRFS subvolume for the home.
# btrfs subvolume create /mnt/home
- Create subvolume for the srv.
# btrfs subvolume create /mnt/srv
- Verify subvolumes created.
# btrfs subvolume list -a /mnt
ID 257 gen 359 top level 5 path ROOT ID ??? gen ??? top level ? path home ID ??? gen ??? top level ? path srv
- Unmount the drive.
# umount /mnt
- Mount the subvolume ROOT.
# mount -o defaults,compress,subvol=ROOT /dev/sda2 /mnt
- Create directories for mount points for each subvolume.
# mkdir /mnt/{boot,home,srv}
- Mount the boot drive parition within the subvolume ROOT.
# mount /dev/sda1 /mnt/boot
- Mount the subvolume home within the subvolume ROOT.
# mount -o defaults,compress,subvol=home /dev/sdb2 /mnt/home
- Mount the subvolume srv within the subvolume ROOT.
# mount -o defaults,compress,subvol=srv /dev/sdb2 /mnt/srv
Generate Fstab¶
-
Run the genfstab script.
# genfstab -U /mnt >> /mnt/etc/fstab
-
Edit "/mnt/etc/fstab" and change the "2" at the end of entry for "/dev/sda1" to "0".
/dev/sda1 /boot vfat rw 0 2
/dev/sda1 /boot vfat rw 0 0