Recently, I build a new desktop PC for my development where my favourite ClearLinux OS is installed and there are 2 nvme disks are installed to expand storage capabilities.
This post will show you how to write entry of fstab
so the system can automatically mount your new disks.
Format your disks as ext4
There are handly tools to parition your disks as ext4
as fdisk
and mkfs.ext4
with below notes:
1) Using fdisk
to create GPT parittion table
to take advantage of GPT table
2) When format the created parittion, you should want to keep 0% reserved-blocks-percentage
:
mkfs.ext4 -m 0 <disk_parition>
Find new disk UUID
After disk parititon is created, a unique UUID is assigned to each, so we will use those UUID numbers for fstab
ls -la /dev/disk/by-uuid/
total 0
drwxr-xr-x 2 root root 120 Mar 6 20:33 .
drwxr-xr-x 8 root root 160 Mar 6 18:02 ..
lrwxrwxrwx 1 root root 15 Mar 6 18:02 0dc939c6-83a8-4634-9f6c-58a3a1631fcc -> ../../nvme2n1p1
lrwxrwxrwx 1 root root 15 Mar 6 18:02 568e39cf-6301-41df-b2dc-6852d895cb11 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Mar 6 20:33 5839-6A35 -> ../../nvme1n1p1
lrwxrwxrwx 1 root root 15 Mar 6 20:33 76a0b4eb-8752-405f-890a-cdbd8eb7457c -> ../../nvme1n1p2
Pls take note the root/boot paritions are recognized by the partition name CLR_BOOT
and CLR_ROOT
, so we only need to add other devices into fstab
. In this case, it is nvme2n1p1
and nvme0n1p1
.
Then we can create /etc/fstab
with below content:
# <device> <dir> <type> <options> <dump> <fsck>
UUID=0dc939c6-83a8-4634-9f6c-58a3a1631fcc /mnt/nvme2 ext4 defaults 0 0
UUID=568e39cf-6301-41df-b2dc-6852d895cb11 /mnt/nvme1 ext4 defaults 0 0
Last digit means that OS will not check those 2 disks while booting up and modify mount point to meet your need and don't forget to create that folder.
Reboot system and enjoy results.