Partitions
Always make sure to identify and select the correct device.
Otherwise, the following steps may result in unintended data loss.
- Identify available disks
# rom, loop or airootfs may be ignore
lsblk
The next step is for NVMe drives only
- Check the formatted logical block address (LBA) size
nvme id-ns -H /dev/nvme0n1 | grep "Relative Performance"
On the output example below the sector size in use (512 bytes) is not the optimal one:
LBA Format 0 : Metadata Size: 0 bytes - Data Size: 512 bytes - Relative Performance: 0x2 Good (in use)
LBA Format 1 : Metadata Size: 0 bytes - Data Size: 4096 bytes - Relative Performance: 0x1 Better
You can confirm it by running lsblk -td
and looking at the LOG-SEC
column value.
To change the logical block address size, you can use the nvme format
command
specifying the preferred value with the --lbaf
parameter:
nvme format --lbaf=1 /dev/nvme0n1
- Create the partitions
cfdisk /dev/the_disk_to_be_partitioned
Purpose | Suggested size | Partition type | Mount point |
---|---|---|---|
efi | 1 GiB | EFI System | /efi |
swap | 8 GiB | Linux filesystem | [SWAP] |
root | Remainder | Linux filesystem | / |
- Verify the partitions
fdisk -l /dev/partitioned_disk
- Create an Ext4 fs for the root
mkfs.ext4 /dev/root_partition
- Initialize the swap
mkswap /dev/swap_partition
- Format the efi to FAT32
mkfs.fat -F 32 /dev/efi_system_partition
- Add a label to the efi partition
# This will be useful later on to set the rEFInd config
dosfslabel /dev/efi_system_partition ARCHIE_ESP
- Add a label to the root partition
# This will be useful later on to set the root device
e2label /dev/root_partition ARCHIE_ROOT
- Verify the result
lsblk --fs /dev/partioned_disk
- Mount the root partition to /mnt
mount /dev/root_partition /mnt
- Mount the efi partition to /mnt/efi
mount --mkdir /dev/efi_system_partition /mnt/efi
- Enable the swap
swapon /dev/swap_partition
- Check the mountpoints
lsblk /dev/partioned_disk
Notes
-
To identify available disks, the
fdisk -l
command provides all the necessary information, butlsblk
is also a good alternative for a concise output -
Make sure to set the correct type for the efi partition