-
sudo btrfs subvolume create @swap
-
sudo mkdir /swap
-
sudo mount -o subvol=@swap /dev/XXX /swap ## replace XXX with your actual partition for example sda2, nvme0n1p2
-
cd /swap
-
sudo truncate -s 0 swapfile
-
sudo chattr +C swapfile
-
sudo btrfs property set swapfile compression none
-
sudo dd if=/dev/zero of=swapfile bs=1M count=512 status=progress
-
sudo chmod 600 swapfile
-
sudo mkswap swapfile
-
sudo swapon swapfile
-
Now Edit the /etc/fstab and add the following two lines:
UUID=NNNN /swap btrfs subvol=@swap ## replace NNNN with the UUID of the partition where @swap resides
/swap/swapfile none swap defaults 0 0
I have been trying to follow the guide above but it seems I am doing something wrong, as far as I see I created the @swap subvolume and its inside / Once I get to the 3rd command its not working the way it is probably supposed to or I am doing something wrong.
nvme0n1 is the drive/partition? I have eos installed on, when I run ls in my root directory after I create the btrfs @swap subvolume I get:
bin dev home lib64 opt root sbin @swap sys usr
boot etc lib mnt proc run srv swap tmp var
Is @swap supposed to be there?
lsblk:
seb@PrimeCore/ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 1K 0 part
└─sda5 8:5 0 465.8G 0 part
sdb 8:16 0 223.6G 0 disk
├─sdb1 8:17 0 500M 0 part
└─sdb2 8:18 0 223.1G 0 part
sdc 8:32 0 1.8T 0 disk
└─sdc1 8:33 0 1.8T 0 part /mnt/diamond-drive
sdd 8:48 0 3.6T 0 disk
└─sdd1 8:49 0 3.6T 0 part /mnt/titan-drive
nvme0n1 259:0 0 931.5G 0 disk
├─nvme0n1p1 259:1 0 300M 0 part /boot/efi
├─nvme0n1p2 259:2 0 922.4G 0 part /var/log
│ /home
│ /var/cache
│ /
└─nvme0n1p3 259:3 0 8.8G 0 part
I tried running the 3rd command from the guide and tried different partitions I dont know what I am doing wrong here…
sudo mount -o subvol=@swap /dev/nvme0n1p2 /swap
mount: /swap: mount(2) system call failed: No such file or directory.
dmesg(1) may have more information after failed mount system call.
sudo mount -o subvol=@swap /dev/nvme0n1 /swap
mount: /swap: /dev/nvme0n1 already mounted or mount point busy.
dmesg(1) may have more information after failed mount system call.
Is this maybe not the best guide or am I more likely doing something wrong?