On 10/22/2025 9:50 PM, Chris Murphy wrote:
On Wed, Oct 22, 2025, at 10:08 PM, home user via users wrote:
(Fedora-42 workstation)

Following what's said here:
"https://wiki.archlinux.org/title/Btrfs#Disabling_CoW";
and here:
"https://unix.stackexchange.com/questions/635661/how-to-prevent-btrfs-compressing-var";,
I'm trying to turn off copy-on-write and compression on "/home".
Why do you want to turn off COW on /home?

I can see turning off compression but why COW? This will disable data checksums 
too.
As with many things in this field, I recognize that there are trade-offs here.  What's best depends on environment and use cases. I easily imagine where both features are not just good, but essential, or even critical.

I have no real use for either feature.  They add complexity and risk, and slow things down.
I do not anticipate space issues for years, if ever.
I have already experienced sluggishness, even delay, which seems most likely due to one or both of these features. I can easily imagine these features causing me problems in the future, though rarely.
There are some private things involved.

Checksums - If I understand that concept correctly, I would like to have that.  But for me, it is a nice-to-have, not something that I need.  I don't like that checksums are tied to COW, and I don't see why btrfs engineers had to tie those together.
You can add "chattr +C" to all directories, perhaps someone more clever than I 
am, can come up with a find command to look for directories and execute a chattr +C on 
them. New files will then inherit nodatacow thus nodatasum and no compression. It's not 
exactly something I'd advise though.
That I already did.  "/home" has only one sub-directory (so far) - the admin's (not root's) home.  (I sure wish root's home was also under "/home": "/home/root".)

So turning off COW also turns off compression?
If you don't want compression just remove the mount option from  /etc/fstab  - note it 
needs to be removed from the / line, since that line is really a "remount" and 
is what applies compression file system wide. The compression option on /home is just an 
artifact of the installer. There isn't per subvolume compression as a mount option.
That spooks me.  I have the impression that /etc/fstab is a critical system file.  I cannot find a GUI editor for it; I have to use vim, emacs, gedit, or some other text/source editor.  I looked at /etc/fstab, and its man page.  It looks rather unstructured, only spaces as delimiters, not columnized, no column headers, can't tell where one field ends and the next begins.  Multiple consecutive spaces makes it difficult to know how many fields are skipped or left at default values.
I'm logged in as "root"; I'm in "/root".
I moved the original /home aside to /home_old.
I created a new "/home".
I turned off copy-on-write.
How did you do this?
Just as the referenced web pages said: the "mv" command, the "mkdir" command, the "chattr" command, and the "cp" command.
But when I try to turn off compression, I get this:
- - - - - -
bash: chattr +m /home
chattr: Invalid argument while setting flags on /home
I'm not sure if this attribute is supported on directories or subvolumes.

Someone with better Linux history knowledge than I will need to discuss the 
origin of file attributes. I think it was originally an ext2 thing? I'm not 
sure xfs uses any of them, off hand.

I hope that the "mkdir /home" command did not mess up what's where!

Thank-you, Chris.

--
_______________________________________________
users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to