ZFS: Difference between revisions
mNo edit summary |
use variables for simplicity |
||
Line 108: | Line 108: | ||
3 10487808 1000215175 471.9 GiB 8300 Linux filesystem | 3 10487808 1000215175 471.9 GiB 8300 Linux filesystem | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''Let's get our device names and put them as variables from now on. | |||
Get the device ID in <code>/dev/disk/by-id/</code>, in our case here it is <code>nvme-SKHynix_HFS512GDE9X081N_FNB6N634510106K5O</code> | |||
''' | |||
<syntaxhighlight lang=bash> | |||
BOOT=/dev/disk/by-id/nvme-SKHynix_HFS512GDE9X081N_FNB6N634510106K5O-part1 | |||
SWAP=/dev/disk/by-id/nvme-SKHynix_HFS512GDE9X081N_FNB6N634510106K5O-part2 | |||
DISK=/dev/disk/by-id/nvme-SKHynix_HFS512GDE9X081N_FNB6N634510106K5O-part3 | |||
'''Make zfs pool with encryption and mount points:''' | '''Make zfs pool with encryption and mount points:''' | ||
Line 114: | Line 122: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
zpool create -O encryption=on -O keyformat=passphrase -O keylocation=prompt -O compression=zstd -O mountpoint=none -O xattr=sa -O acltype=posixacl -o ashift=12 zpool | zpool create -O encryption=on -O keyformat=passphrase -O keylocation=prompt -O compression=zstd -O mountpoint=none -O xattr=sa -O acltype=posixacl -o ashift=12 zpool $DISK | ||
# enter the password to decrypt the pool at boot | # enter the password to decrypt the pool at boot | ||
Enter new passphrase: | Enter new passphrase: | ||
Line 150: | Line 158: | ||
'''Format boot partition with fat as filesystem''' | '''Format boot partition with fat as filesystem''' | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
mkfs.fat -F 32 -n boot | mkfs.fat -F 32 -n boot $BOOT | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''Enable swap''' | '''Enable swap''' | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
mkswap -L swap | mkswap -L swap $SWAP | ||
swapon | swapon $SWAP | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''Installation:''' | '''Installation:''' | ||
# Mount boot | # Mount boot | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
mkdir -p /mnt/boot | mkdir -p /mnt/boot | ||
mount | mount $BOOT /mnt/boot | ||
# Generate the nixos config | # Generate the nixos config |