On Fri, 6 Nov 2020 at 08:42, Patrick O'Callaghan pocallaghan@gmail.com wrote:
On Fri, 2020-11-06 at 20:27 +0800, Qiyu Yan wrote:
Patrick O'Callaghan pocallaghan@gmail.com 于2020年11月6日周五 下午8:14写道:
On Fri, 2020-11-06 at 11:18 +0000, Patrick O'Callaghan wrote:
On Fri, 2020-11-06 at 05:43 +0000, Qiyu Yan wrote:
You can use swapfile on btrfs with nocow [...] https://wiki.archlinux.org/index.php/btrfs#Swap_file for
instructions
Great. I was actually wondering about precisely that, so I'm glad to see it's supported with the right incantations.
Trying to follow the instructions in the above URL, but clearly I'm misunderstanding something:
# btrfs sub create /SWAP Create subvolume '//SWAP' # btrfs property set /SWAP compression no # btrfs sub show /SWAP root/SWAP Name: SWAP UUID: 1d4d839a-fd4e-d345-8d3f-ea858af71982 Parent UUID: - Received UUID: - Creation time: 2020-11-06 11:41:37 +0000 Subvolume ID: 1311 Generation: 14657 Gen at creation: 14547 Parent ID: 257 Top level ID: 257 Flags: - Snapshot(s): # cd /SWAP # truncate -s 0 ./swapfile # chattr +C /SWAP chattr: Invalid argument while setting flags on /SWAP
Try setting +C flag on the file rather than the subvolume itself
# chattr +C swapfile chattr: Invalid argument while setting flags on swapfile
Mybe we are no lnpger meant to use chattr: Manual page btrfs-property(8) says:
"btrfs property provides an unified and user-friendly method to tune different btrfs properties instead of using the traditional method like chattr(1) or lsattr(1)."