in /run/media/enio/wd ultrastar hdd i made folder Torrents (/run/media/enio/wd ultrastar hdd/Torrents). what is the command to make that folder nocowdata and all the files that will torrent make inside that folder nocow.
chattr +C /run/media/enio/wd ultrastar hdd/Torrents is this the precise command?
and how to use lsattr command to check that folder and maybe the folders inside if nocow is indeed disabled? i tried to make a torrent folder on the other drive nocow and i dont know if i did manage to do it.
and that other torrent file that is on wd gold, if i delete it i deleted also the nocow on that folder.(what if i make the same folder name in the same place, will it be cow or nocow?)
That’s right, chattr +C /path/to/directory will disable copy-on-write for that directory.
If you do snapshotting, you may wish to create a separate subvolume for that directory so it is excluded from snapshots. The snapshots will be copy-on-write.
You can also disable copy-on-write for a subvolume with the nodatacow mount option, however it needs to be a separate filesystem (for example, a separate partition) if your other subvolumes are copy-on-write. You can’t mount some subvolumes in a given filesystem with nodatacow and others with datacow.
i tried earlier on wd gold, i made Torrents folder, and did that command, and later tried to check if it worked with lsattr and it says something unknown, as in it cant locate the file to check or something.
what would be the correct command to use to check that:
If you are using spaces in your directory names, you will have to quote the path or escape the spaces.
lsattr is correct. To check the attributes of a directory, you will need the -d flag.
chattr +C nocow/
lsattr -d nocow/
Only the directory is no-CoW. The directory lives in a subvolume which has been mounted CoW, unless you set up a separate filesystem so you can mount the subvolume nocow. My understanding is if you are snapshotting the subvolume that contains the no-CoW directory, CoW still occurs. See here:
$ chattr +C */dir/file*
This will disable copy-on-write for those operation in which there is only one reference to the file. If there is more than one reference, e.g. due to file clones / lightweight clones or filesystem snapshots, copy-on-write still occurs.
All you need to do to prevent the directory from being snapshotted is make a new subvolume for it.
I managed to make the Torrents folder nocow and managed to check it via lsattr, good job guys and thanks. One more question, lets say i delete that folder, and make another with the same name, i would need to make this step again(chattr) to folder to be nocow again?