Apart from the last step, setting up /etc/fstab
there are no differences between partitioning a HDD or SSD drive. All modern Linux partitioning tools take care of aligning the partitions automatically.
Partition ID | Description | Auto-mounted by systemd | Mount point |
---|---|---|---|
EF02 | BIOS boot partition | - | |
EF00 | EFI System Partition | yes | /boot (or /efi if XBOOTLDR partition exists) |
EA00 | XBOOTLDR partition | yes | /boot |
FD00 | Linux RAID | - | |
8200 | Linux swap | yes | |
8300 | Linux filesystem | - | |
8302 | Linux /home | yes | /home |
8303 | Linux x86 root (/) | yes | / |
8304 | Linux x86-64 root (/) | yes | / |
8305 | Linux ARM64 root (/) | yes | / |
8306 | Linux /srv | yes | /srv |
/dev/sda1 1 GiB /boot EF00 vfat EFI System Partition
/dev/sda2 512 MiB 8200 swap Linux swap
/dev/sda3 25 GiB / 8304 ext4 Linux x86-64 root (/)
gdisk /dev/sda
Command (? for help): p
Disk /dev/sda: 156301488 sectors, 74.5 GiB
[...]
n
1
enter
+1024M
EF00
c
1
EFI System Partition
n
2
enter
+512M
8200
n
3
enter
enter
8304
p
w
Y
/dev/sda1 1 MiB EF02 BIOS boot BIOS boot partition
/dev/sda2 100 MiB /boot 8300 ext4 Linux filesystem
/dev/sda3 512 MiB 8200 swap Linux swap
/dev/sda4 25 GiB / 8304 ext4 Linux x86-64 root (/)
gdisk /dev/sda
Command (? for help): p
Disk /dev/sda: 156301488 sectors, 74.5 GiB
[...]
n
1
enter
+1M
EF02
n
2
enter
+100M
8300
n
3
enter
+512M
8200
n
4
enter
enter
8304
p
w
Y
mkswap /dev/sda2
mkfs.ext4 /dev/sda3
# Additional for UEFI
mkfs.fat -F 32 /dev/sda1
mkswap -L swap /dev/sda2
tune2fs -L root /dev/sda3
# Additional for UEFI:
fatlabel /dev/sda1 efi
blkid
mkdir -p /mnt/exherbo
swapon /dev/sda2
mount /dev/sda3 /mnt/exherbo
mkdir /mnt/exherbo/boot
mount /dev/sda1 /mnt/exherbo/boot
For installation or rescue purposes you might also need to mount the following.
mount -o rbind /dev /mnt/exherbo/dev/
mount -o rbind /sys /mnt/exherbo/sys/
mount -t proc none /mnt/exherbo/proc/
List the UUIDs.
blkid
Edit fstab.
nano -w /etc/fstab
UUID=cf602240-7bac-4b29-8930-2080a5aac7cd / ext4 defaults,noatime,discard 0 1
UUID=8E3D-60F5 /boot vfat umask=0077,shortname=winnt,noauto 0 0
UUID=8431f5f2-0cb1-4831-aed2-00d618543e0a swap swap defaults 0 0
The discard parameter enables the TRIM function which should be available on all modern SSDs, check with:
hdparm -I /dev/sda | grep TRIM
mdraid, dm-crypt and the loopback block driver support passing discard commands to the underlying layer(s) since kernel 3.7
To enable discaring of unused blocks once a week:
systemctl enable fstrim.timer
To check the current Wear Leveling Count (supported e.g. by Samsung SSDs).
smartctl -a /dev/sda | grep "Wear_Leveling_Count"
177 Wear_Leveling_Count 0x0013 099 099 000 Pre-fail Always - 2
The Wear_Leveling_Count starts to count down from 100 to 01, in this example it's 099 since the drive is pretty new.
UUID=cf602240-7bac-4b29-8930-2080a5aac7cd / ext4 defaults 0 1
UUID=8E3D-60F5 /boot vfat umask=0077,shortname=winnt 0 0
UUID=8431f5f2-0cb1-4831-aed2-00d618543e0a swap swap defaults 0 0
Useful for pure data partitions.
tune2fs -m 0 /dev/sdd1
tune2fs -l /dev/sdd1 | grep "Reserved block count"