After a fresh install using btrfs how do you resize the swap file. I tried it but it wouldn’t activate the swap file after. There is a @swap and a swap file i assume? So i’m not sure how this is supposed to work compared to swap file on Ext4.
[ricklinux@eos-plasma ~]$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=01B4-EB21 /boot/efi vfat umask=0077 0 2
UUID=885d2794-fc59-4d49-95a0-f57f19884102 / btrfs subvol=/@,defaults,noatime,space_cache,autodefrag,compress=lzo 0 1
UUID=885d2794-fc59-4d49-95a0-f57f19884102 /home btrfs subvol=/@home,defaults,noatime,space_cache,autodefrag,compress=lzo 0 2
UUID=885d2794-fc59-4d49-95a0-f57f19884102 /var/cache btrfs subvol=/@cache,defaults,noatime,space_cache,autodefrag,compress=lzo 0 2
UUID=885d2794-fc59-4d49-95a0-f57f19884102 /var/log btrfs subvol=/@log,defaults,noatime,space_cache,autodefrag,compress=lzo 0 2
UUID=885d2794-fc59-4d49-95a0-f57f19884102 /swap btrfs subvol=/@swap,defaults,noatime,space_cache,autodefrag,compress=lzo 0 2
/swap/swapfile swap swap defaults,noatime 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
[ricklinux@eos-plasma ~]$
I haven’t looked at swap on the new installer yet but presumably @swap is just a subvolume to store the swapfile. You put the swapfile in a separate subvolume on btrfs because you can’t take snapshots of a subvolume with a swapfile. That being said, you really shouldn’t mount that subvolume with compression enabled so I would remove that from the mount options.
I don’t understand what to do with what i currently have that was set up by the install on btrfs. Can i use the existing @swap subvolume or i have to delete it and also the existing swap file. The wiki says to create a non snapshotted subvolume @swap. Not sure i cant’ just use what’s there if i delete the swap file and start from there. Or do i need to delete the subvolume @swap also and create a new one?
Then if i create a directory for swap i get that. But not 100% sure on every step.
I just reinstalled KDE with the new ISO on bare metal and set it all up again. I just don’t want to do it again because i wreak havoc on it trying to resize a swap file.
Edit: I might install kde on v-box first and then if i can understand what I’m doing I’ll try it on that first. I already tried to resize the file and it didn’t work the normal way.
What directory am i supposed to cd into? Don’t i have to create a directory? The wiki doesn’t explain it just tells you to do something.
Edit: I don’t understand how to do this at all. I have tried everything i know. The wiki is not helpful. I can seem to delete this current swap file on btrfs and i don’t understand how to increase the size but also how to do it how it’s supposed to be. I give up!
I decided to go with a swap partition instead of a swap file thereby removing it from the btrfs equation. Nothing i tried worked. Well some commands worked some didn’t. Couldn’t get it set up the way i wanted so i took an alternate route.
[ricklinux@eos-kde ~]$ sudo btrfs subvolume list /
[sudo] password for ricklinux:
ID 256 gen 143 top level 5 path @
ID 257 gen 146 top level 5 path @home
ID 258 gen 125 top level 5 path @cache
ID 259 gen 146 top level 5 path @log
ID 262 gen 25 top level 256 path var/lib/portables
ID 263 gen 26 top level 256 path var/lib/machines
[ricklinux@eos-kde ~]$
I am afraid I haven’t tried yet the new BTRFS installation and encryption with the new ISO, so I couldn’t answer your question properly. I suppose it will set up everything out-of-the-box if you choose those settings. Perhaps @joekamprad or @2000 could tell you that.
i have not really any deeper understanding on BTRFS but it is now possible to use automatic BTRFS install from ISO with the fixed subcol scheme on autopartition, it can use all 3 swap options swap no hibernate, swap with hibernate, and swapfile… and encryption is working also…
subvol scheme:
This worked on a btrfs install that i didn’t have any swap until i got up to the fstab part. Are you supposed to put the uuid in there too?
/swap/swap/./swapfile none swap defaults 0 0
Edit: I guess not. So this worked as i said on a btrfs install that had no swap. What i was trying to do was take the btrfs install that has swap which is only 512 by default and make it larger. So i tried the normal way of stopping swap and tried to make a new swap file that was bigger. This install already has the subvolume for swap and the swap file so i couldn’t figure out how on earth to do it no how & it just made me frustrated with the whole episode.
Edit2: So this is different than what is on the btrfs install if you use a swipe file.
[ricklinux@rick-virtualbox ~]$ sudo btrfs subvolume list /
[sudo] password for ricklinux:
ID 257 gen 70 top level 5 path @
ID 258 gen 70 top level 5 path @home
ID 259 gen 33 top level 5 path @cache
ID 260 gen 70 top level 5 path @log
ID 263 gen 25 top level 257 path var/lib/portables
ID 264 gen 26 top level 257 path var/lib/machines
ID 270 gen 42 top level 257 path swap/swap
[ricklinux@rick-virtualbox ~]$
On the btrfs install with swap file it had @swap and a swap file. Like i say i don’t understand it enough. So i couldn’t get it to work. This worked from scratch when i started with a btrfs install with no swap.
Edit3: So there is no @swap Subvolume?
[ricklinux@rick-virtualbox ~]$ swapon --show
NAME TYPE SIZE USED PRIO
/swap/swap/swapfile file 15.6G 0B -2
[ricklinux@rick-virtualbox ~]$