New linux user here, i have some questions about btrfs

I read about cow filesystem, and some things about it are making me uneasy. torrents for example(looked online there is an option to make a folder with torrents nocow somehow or something). As im a new user i will tinker with the system, install new stuff, delete it, frequently update it and so on. and when i do anything cow keeps everything and keeps multiplying. i dont really need that security of cow except for snapshots, since im new i will probably break some stuff and snapshots is an safety parachute..
So is it possible to disable cow on my ssd. i have wd black ssd 2tb that i installed garuda on, the rest of hdds and ssds are ntfs..?

Oh and a another question. can i mess up somehow my other hdds (ntfs on them) if i read or write to them with my current linux instalation( i can read from them i didnt try writing)?

System:
Kernel: 6.4.3-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.1.1
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=e31445d3-aaf3-44db-9a4b-86c5a54c8b7c rw rootflags=subvol=@
quiet quiet rd.udev.log_priority=3 vt.global_cursor_default=0 loglevel=3
ibt=off
Desktop: KDE Plasma v: 5.27.6 tk: Qt v: 5.15.10 wm: kwin_x11 vt: 2
dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Desktop System: Gigabyte product: X570 AORUS ELITE v: -CF
serial: <superuser required>
Mobo: Gigabyte model: X570 AORUS ELITE serial: <superuser required>
UEFI: American Megatrends LLC. v: F37 date: 12/26/2022
CPU:
Info: model: AMD Ryzen 7 3700X bits: 64 type: MT MCP arch: Zen 2 gen: 3
level: v3 note: check built: 2020-22 process: TSMC n7 (7nm)
family: 0x17 (23) model-id: 0x71 (113) stepping: 0 microcode: 0x8701021
Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB
L3: 32 MiB desc: 2x16 MiB
Speed (MHz): avg: 3599 high: 3600 min/max: 2200/4426 boost: enabled
scaling: driver: acpi-cpufreq governor: performance cores: 1: 3600 2: 3600
3: 3600 4: 3600 5: 3600 6: 3600 7: 3600 8: 3588 9: 3600 10: 3600 11: 3600
12: 3600 13: 3600 14: 3600 15: 3600 16: 3600 bogomips: 114983
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Vulnerabilities: <filter>
Graphics:
Device-1: AMD Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] vendor: ASUSTeK
driver: amdgpu v: kernel arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm)
built: 2020-22 pcie: gen: 4 speed: 16 GT/s lanes: 16 ports: active: DP-3
empty: DP-1,DP-2,HDMI-A-1 bus-ID: 0b:00.0 chip-ID: 1002:73bf
class-ID: 0300
Device-2: Microdia Dual Mode Camera (8006 VGA) driver: hid-generic,usbhid
type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-3.2:5
chip-ID: 0c45:8006 class-ID: 0301
Device-3: Logitech Webcam C310 driver: snd-usb-audio,uvcvideo type: USB
rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-3.3:6
chip-ID: 046d:081b class-ID: 0102 serial: <filter>
Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.1.2
compositor: kwin_x11 driver: X: loaded: amdgpu unloaded: modesetting,radeon
alternate: fbdev,vesa dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
Screen-1: 0 s-res: 2560x1440 s-dpi: 96 s-size: 677x381mm (26.65x15.00")
s-diag: 777mm (30.58")
Monitor-1: DP-3 mapped: DisplayPort-2 model: LG (GoldStar) ULTRAGEAR
serial: <filter> built: 2021 res: 2560x1440 hz: 165 dpi: 93 gamma: 1.2
size: 697x392mm (27.44x15.43") diag: 800mm (31.5") ratio: 16:9 modes:
max: 2560x1440 min: 640x480
API: OpenGL v: 4.6 Mesa 23.1.3 renderer: AMD Radeon RX 6900 XT (navi21
LLVM 15.0.7 DRM 3.52 6.4.3-zen1-1-zen) direct-render: Yes
Audio:
Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel pcie:
gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 0b:00.1 chip-ID: 1002:ab28
class-ID: 0403
Device-2: AMD Starship/Matisse HD Audio vendor: Gigabyte
driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
bus-ID: 0d:00.4 chip-ID: 1022:1487 class-ID: 0403
Device-3: Logitech Webcam C310 driver: snd-usb-audio,uvcvideo type: USB
rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-3.3:6
chip-ID: 046d:081b class-ID: 0102 serial: <filter>
API: ALSA v: k6.4.3-zen1-1-zen status: kernel-api with: aoss
type: oss-emulator tools: N/A
Server-1: PipeWire v: 0.3.74 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Intel I211 Gigabit Network vendor: Gigabyte driver: igb v: kernel
pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: f000 bus-ID: 05:00.0
chip-ID: 8086:1539 class-ID: 0200
IF: enp5s0 state: up speed: 100 Mbps duplex: full mac: <filter>
Drives:
Local Storage: total: 14.55 TiB used: 11.34 GiB (0.1%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:5 vendor: Western Digital model: WD BLACK
SN850X HS 2000GB size: 1.82 TiB block-size: physical: 512 B logical: 512 B
speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter> fw-rev: 620311WD
temp: 38.9 C scheme: GPT
ID-2: /dev/nvme1n1 maj-min: 259:0 vendor: Kingston model: SKC2500M81000G
size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
lanes: 4 tech: SSD serial: <filter> fw-rev: S7780102 temp: 33.9 C
scheme: GPT
ID-3: /dev/sda maj-min: 8:0 vendor: Seagate model: WDC WDS200T2B0A-00SM50
size: 1.82 TiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: 00WD scheme: GPT
ID-4: /dev/sdb maj-min: 8:16 vendor: Western Digital
model: WD1002FAEX-00Z3A0 size: 931.51 GiB block-size: physical: 512 B
logical: 512 B speed: 6.0 Gb/s tech: N/A serial: <filter> fw-rev: 1D05
scheme: MBR
ID-5: /dev/sdc maj-min: 8:32 vendor: Western Digital
model: WD6002FRYZ-01WD5B0 size: 5.46 TiB block-size: physical: 4096 B
logical: 512 B speed: 6.0 Gb/s tech: HDD rpm: 7200 serial: <filter>
fw-rev: 1M02 scheme: GPT
ID-6: /dev/sdd maj-min: 8:48 vendor: Western Digital
model: WD10EALX-009BA0 size: 931.51 GiB block-size: physical: 512 B
logical: 512 B speed: 6.0 Gb/s tech: N/A serial: <filter> fw-rev: 1H15
scheme: GPT
ID-7: /dev/sde maj-min: 8:64 vendor: Western Digital
model: WD30EFRX-68EUZN0 size: 2.73 TiB block-size: physical: 4096 B
logical: 512 B speed: 6.0 Gb/s tech: HDD rpm: 5400 serial: <filter>
fw-rev: 0A80 scheme: GPT
Partition:
ID-1: / raw-size: 1.82 TiB size: 1.82 TiB (100.00%) used: 11.34 GiB (0.6%)
fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:7
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 580 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:6
ID-3: /home raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
used: 11.34 GiB (0.6%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:7
ID-4: /var/log raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
used: 11.34 GiB (0.6%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:7
ID-5: /var/tmp raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
used: 11.34 GiB (0.6%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:7
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 15.54 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 35.8 C mobo: 28.0 C gpu: amdgpu temp: 35.0 C
mem: 32.0 C
Fan Speeds (RPM): N/A gpu: amdgpu fan: 0
Info:
Processes: 349 Uptime: 51m wakeups: 7 Memory: total: 16 GiB
available: 15.54 GiB used: 3.65 GiB (23.5%) Init: systemd v: 253
default: graphical tool: systemctl Compilers: gcc: 13.1.1 Packages:
pm: pacman pkgs: 1834 libs: 544 tools: octopi,paru Shell: fish v: 3.6.1
default: Bash v: 5.1.16 running-in: konsole inxi: 3.3.28
Garuda (2.6.16-1):
head: cannot open '/var/log/pacman.log' for reading: No such file or directory
System install date:
Last full system update: 2023-07-14
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut
Windows dual boot:       Probably (Run as root to verify)
Failed units:
1 Like

I dl torrents to a btrfs partition all the time without any issue.

The NTFS under Linux works great, you can read and write to your windows disks fine, too.

2 Likes

cow and torrents it is not ideal, all the different version of the same files that you are downloading are multiplying(no cow would be better for dealing with torrent files)

Ah that sounds great. I have lots of hdds with ntfs with data that i use. I definitely dont want to mess something up so im being careful.

EXACTLY this. I bought 2 8 tb drives and was gifted a 12 tb to replace a handful of smaller drives and this time instead of doing EXT4 I did all 3 BTRFS and the only issue I’ve run into is that from storage BTRFS seems slower, but seeing thing duplicated including my torrent simply no.

I have to ask if you maybe change a setting in Snapper to include your other BTRFS drive(s).

As for the NTFS drive is it Windows, Storage, or Windows and storage?

I would not disable CoW on the whole disk (you may as well not use Btrfs at that point). Instead, create a no-CoW subvolume and use that as the target for your torrent downloads and temp files. After a download completes, copy the file to a CoW subvolume so you can take advantage of Btrfs checksums, etc.

I agree that there is not a huge benefit to this kind of setup. If you have enabled periodic defragmentation and balances for all subvolumes in Btrfs Assistant, it’s fine to just use a normal CoW subvolume because it really doesn’t matter.

Yes, on Linux NTFS is very fragile and easily broken. The Linux tools for repairing it are somewhat limited. Look through the forum and you’ll find a hundred issues where NTFS gave up the ghost and had to be repaired from Windows. Make sure your mount options are correct!

2 Likes

I had one kingston nvme ssd with windows on it and couple of sata hdds and one sata ssd for games. then i bought another wd nvme ssd and put linux on it.. wd black with linux on it is the only one with btrfs, all of the rest are ntfs.. i didnt mount anything. when i installed linux on nvme i detached all sata drives, which i reatached back once linux was installed. and when i did that i normaly see sata drives and can access them with linux.. Is there anything else i should do, or something i should watch for?

I honestly can't say at this point. I just install Garuda with all my drives attached and run Snapper as it's configured out of the gate without issue.

1 Like

Hi there, welcome to the community

In your case, it will simply be best to disable the CoW for a single folder, for example, the downloads folder, and download all the torrents there. Here is the command

chattr +C /<absolute path to folder>/

To know absolute path of the folder, simply open the terminal in that particular folder and run pwd command.

Read more about it at Archwiki

https://wiki.archlinux.org/title/btrfs

I hope this solves your issue.
Have a nice day!

3 Likes

Need to find out what they did to get files not on the OS drive backed up since neither Snapper or Timeshift will do it on initial setup.

Thx. And what should i do with the rest, for example, there are a lot of updates, small and big to the garuda and installed programs, and as i understand cow just keeps everything and writes new file versions. how to get rid of those old versions(ones being replaced by updated files), how can i delete those so that i don't clutter the ssd over time?

Just my own personal opinion, but NTFS drives are simply an accident waiting to happen when running Linux. If you value your data don’t use NTFS drives with Nix based OS’s. Take my word for it, Windows is not always able to repair it’s own NTFS data partitions when a Linux corruption occurs. When that happens you are at the mercy of expensive data recovery options or you can kiss your data goodbye.

Cue @SGS and his ode to the God of Backup.

3 Likes

Ah, then i will need to backup hdds and then convert them into btrfs or something. what about other way around, if i convert hdds into btrfs, and access them through win11, is that also risky for data? atm still need windows for some things.. and i would like to leave one ssd as is, ntfs( sata) that has games on it, and not accessing it through linux, will than that ssd be safe from linux messing it up?

No, M$ do not know other file systems :smiley:

There exists a btrfs driver for windows (GitHub - maharmstone/btrfs: WinBtrfs - an open-source btrfs driver for Windows) But I only used it once that too in emergency.

Check, please

It looks like there are a lot of issues in this. I might be lucky I was able to do my work once.
Now I looked into the repo, It is not even updated since january. (I didnt count readme changes)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.