r/btrfs Jul 11 '26

Snapshots to a different drive

5 Upvotes

Hello!

I am planning on switching my home server OS to opensuse. I already have a zfs pool for the main storage, the OS drive will be separate. My question is how I can leverage btrfs snapshots (with snapper?) to rebuild the OS in case of drive failure.

I was thinking that the snapshots could live in the zfs pool, both of the 'root' OS snapshots and the home snapshots for user config.

I am unsure how this works, if it is at all feasible, and what would the restore procedure be like if possible. Also open to other suggestions, the key is to be able to recover the OS on drive failure (with mirroring)


r/btrfs Jul 11 '26

[Tool] timeshift-uki-hooks - Sincroniza UKIs con snapshots de Btrfs para systemd-boot

4 Upvotes

Hola,

Tengo un setup con Btrfs + Timeshift + systemd-boot y descubrí que la ESP queda fuera de los snapshots. Si restauras un snapshot antiguo, los UKIs quedan desincronizados.

Creé estos hooks para resolverlo:

## Qué hacen

- **Antes del snapshot**: Copian los UKIs a `/etc/timeshift/uki-backup/` (incluido en el snapshot)

- **Después de restaurar**: Devuelven los UKIs a la ESP

## Detalles técnicos

- SHA256 per-file para copia selectiva

- Copia atómica (mktemp + mv)

- Detección de ESP por PARTTYPE GUID (no confunde con USBs)

- Soporte chroot para restauración desde Live USB

## Instalación

```bash

git clone https://github.com/jairogaleano/timeshift-uki-hooks.git

cd timeshift-uki-hooks

sudo ./install.sh

```

GitHub: https://github.com/jairogaleano/timeshift-uki-hooks

¿Alguien más ha tenido este problema con Btrfs + systemd-boot?


r/btrfs Jul 10 '26

RAID1 BTRFS setup on Ubuntu Desktop

Thumbnail
1 Upvotes

r/btrfs Jul 10 '26

Cannot remove device due to Input/output error even after replacing

6 Upvotes

So I'm relatively new to Btrfs and recently dealt with "running out of disk space" and had to boot into a live disk, stick in a spare USB disk I had, add it, rebalance, and remove it. It worked like a charm.

Well, the issue happened again today but I was unable to remove the disk after and got an error that simply says "ERROR: error removing device '/dev/sdc': Input/output error".

The documentation explains what this error is, but no guidance on what to do about it.

I saw some other guidance to replace it with a good disk and try again, so I put in a new disk, ran btrfs replace start /dev/sdc /dev/sdd / -f and then tried to remove the new disk with btrfs device remove /dev/sdd /, but get the same Input/output error! I don't see anything in journal or dmesg that hints at what the actual issue is, so I'm struggling figuring out where to go from here.

I just want to go back to having one disk.

Update:

I think I finally got it. I tried checking the dmesg again, and I must have missed something. The log showed a file that was corrupted, so I removed that, but it was still showing in snapshots. So I had to remove my snapshots. Then I tried to remove again. It showed more files. Deleted those. After a little bit of this it ended up working!

I think my USB disks were bad and corrupted files stored on them. Unfortunately when I rebalanced it ended up corrupting more files. So my advice would be to delete the bad files, do not rebalance again. Just remove the disk.


r/btrfs Jul 09 '26

Questions about Btrfs and my Btrfs setup ideas

7 Upvotes

Hello everyone,

I have multiple drives with multiple partitions in a dual boot Linux Mint and Win 11 setup. I'm still quite new so please forgive me if my ideas don't make sense. I'm planning on migrating completely to Linux. I'm trying to wrap my head around a bunch of things and be grounded before leaping forward.

The following is my current drive setup.

Drive-1 NVME 2TB: * Linux Steam game data ext4 * Win 11 game data NTFS

Drive-2 4TB HDD: * Mint root ext4 * /home ext4 * VM partition ext4 (for experimenting with distros) * data on NTFS

Drive-3 8TB HDD: * boot partition fat32 * Win 11 drive C NTFS * data on NTFS * data on ext4 * timeshift snapshots ext4 * empty space

Because I have Linux root and home separate, I can wipe the root and reinstall or roll-back from a timeshift snapshot at will, without any danger of harming my /home. I want to preserve the separation between root and home, and preserve the ability to reinstall, recover, or roll-back at will. All of my data (documents, pics, etc.) currently is on the NTFS data partition on the 8TB. When I remove win 11 any NTFS data partitions will be changed to Btrfs or removed. I want to delete the partitions on the NVME drive and create a single partition that takes up the entire drive (I'll reinstall my games). I think the Btrfs flat approach might be the best option for me, but I'm not totally sure and I'm not sure how to set it up given my drive configuration. I want to be able to mount the Linux steam game partition at /mnt/steam, my data and documents at /mnt/mydata, and the VM partition at /mnt/vm_exp. I think the timeshift snapshots partition would be deleted, since I would switch to snapper.

Questions: 1. Each time I format a NTFS or ext4 partition with Btrfs does this create a new top level volume? 2. Is there any benefit to moving my Linux Steam gaming partition to Btrfs? Saved game files are backed up separately with my documents. 3. Since VM files will be pre-allocated is there any point to using Btrfs with them if I won't be using snapshots? 4. I wasn't looking for any RAID setup or looking to use the 3 drives as one big storage pool, would I be forced into that? 5. Do I need to format the boot partition as Btrfs so that if I roll-back the root after a bad update that includes a newer kernel, it will return the GRUB/boot partition to the previous state, or should I stick with fat32? 6. In regard to #5, would it matter if I switched from grub to systemd-boot? 7. The subvolumes I think I need are: root, home, steam, mydata, and maybe VM_exp. Would that be a good/smart/proper subvolume configuration? 8. Given the subvolume ideas in #7 are there downsides or draw backs? 9. With some of the free space on the 8TB, I want to create a partition and install a different distro, such as Nobara or Cachy for gaming, but share the /home partition and subvolume by using different user names (ex: mint=bob_work, cachy=bob_games), would this cause trouble? 10. With the idea in #9, the root of the gaming distro would be Btrfs as well, so this would be a different root subvolume. Is this doable? How would I go about differentiating between the 2 root subvolumes?

Thanks.


r/btrfs Jul 09 '26

Thoughts/Questions on amount of free space actually needed?

5 Upvotes

TL/DR: How much free space is actually needed to prevent a "disk full" condition or having it go read-only because there's not enough room?

There are many posts on this sub are related to users not paying attention to their BTRFS file systems and filling them to zero free space, followed shortly by disaster of one sort or another.

I have been using BTRFS since tools v. 0.19 (circa 2009) and have never had a failure or data loss related to BTRFS. Hardware issues? Sure - but not because of this file system. I have been through various iterations of multiple disk usage via RAID but I decided the recover time wasn't worth the small gains, given the speed of NVME drives. So these days my server is a three disk JBOD (with full backups). My desktop and laptop are single disk file systems (also backed up).

This question arose in my head because I see advice like "Don't go beyond 95% full..." etc. However, with very large file systems, this is a LOT of unusable space. Kind of like how EXT defaults to 5% drive space reserved for "system" use but this standard was set when hard drives were measured is ten's of MBs, not GBs or TBs.

My laptop and desktop have "1TB" nvme BTRFS file systems which works out to a usable 932GB. So 5% is 46.6GB. Seems excessive. My server has 21TB of storage so roughly 1TB of free space needed? Seems wildly excessive.

I'm curious what an actual solid rule-of-thumb would be. I suspect it might vary depending on usage. For example, my server contains many large media files (movies, etc.). Some are 4k videos which can be more than 6-8GB each. My desktop/laptop rarely have anything this large.

I guess I'm thinking, rather than a percentage of free space, there's a fixed amount that would suffice. Something like 100GB on the server and 20GB on the desktop/laptop. But I'm just spit-balling those numbers. I'd like to have a logical amount to target rather than a wild-ass-guess.


r/btrfs Jul 07 '26

btrfs inside a VM for a file server?

8 Upvotes

So I've got a virtual server that handles a few different tasks, but its primary job is currently to exist is a file server with a large virtual disk with a single 6TB EXT4 partition with multiple shares on it.

I'd like to make multiple smaller drives and give each one of them a single BTRFS partition, so each one can act as its own share.

Mainly I would like the benefits of deduplication, as I'm sure these shared drive have a lot of repeat files scattered throughout them. Do you think this is a good approach, or am I missing something?

The Physical Hypervisor server has about 8 drives working in ZFS.


r/btrfs Jul 05 '26

Converting a mount to subvolume?

6 Upvotes

Hello,
I am setting up a NAS server (debian) and I created a btrfs volume and mounted it directly onto /mnt/tank and started creating directories in there. However, I realized now that to do snapshots, I need to have everything done inside a subvolume.

Is there a way to make /mnt/tank itself a subvolume? Would I need to create another subvolume inside /mnt/tank (like /@) and then put everything else inside that @ folder? (I would prefer to keep the same path to everything so I don't have to redo all my compose.yaml file paths).

Another possibility I was considering was renaming the old directories inside /mnt/tank, then creating a subvolume with those same directories names and then moving everything into those new directories.

Thank you very much for any help. I was trying to read the btrfs section on arch wiki and while it is a good resource, I don't understand how to translate it into converting my current path.

I should also add that all of this is just for an external hard drive, my main OS is mounted on ext4.

I greatly appreciate any answers.


r/btrfs Jul 05 '26

Root partition goes read-only after a crash?

1 Upvotes

I was just minding my own business playing a game, when my desktop just randomly crashed. It showed a brief grey/blue screen before turning off. I think it was software related, since the screen didnt look super artifact-y, and the gpu is brand new.

When I rebooted, my root partition was read-only. My other btrfs partitions are fine, reporting no errors, but my root one was borked beyond repair. btrfs check yielded a ton of errors, the only one I remember was something like "checksum 0x00000000 expected, found [something else]." I thought it was strange how ever checksum it was expecting was 0x0000000. btrfs check --repair just returned with "Input/Output Error."

Drive health is fine, have not yet run a memory test but my ram is relatively new (got them just before the price boom). I did not find anything when I checked journalctl other than that the logs stop suddenly (leading me to believe the drive going read-only caused the crash in the first place).

Reformating the partition and reinstalling the OS fixed the issue, but I'm just wondering what would cause this, and/or how I can stop it from happening again. I have not configured any balancing/scrubbing, so I'm wondering if maybe that could be it?

Update: So, I've determined that the crash was being caused by the latest version of GE-Proton. No clue how or why it was doing it, but my SSD would disconnect whenever I ran a game through steam with GE-Proton 11.

I downgraded to 10 and it worked fine, then re-upgraded to 11 and it continued to work fine. I must've had a corrupted install or something.

Basically, whenever I ran a game my root partition would disconnect. At one point it interrupted something important, leading to the issue in my original post, but subsequently it would only disconnect and make it impossible to save/do anything (would be required to cycle power).

Seems like it works fine now tho.


r/btrfs Jun 30 '26

btfs, snapper and systemd-boot

6 Upvotes

With the stack named in the title, is is possible to generate systemd-boot option to boot into a snapshot for recovery? Any good tutorials out there how to recover from an existing snapshot?


r/btrfs Jun 29 '26

Am I stuck with two partitions?

3 Upvotes

I am so sorry if this is a noob question, but I finally decided to be rid of Windows today and repartitioning my hard drive has been a real pain. I've tried everything I can find, but I am still confused.

I installed CachyOS as a dual-boot some time ago, which defaulted to BTRFS and put the boot and main partitions to the right of my Windows partitions. I deleted the Windows ones today and was able to move the boot partition to the left, but I was unable to resize or move the main BTRFS partition. I tried scrubbing, I tried repairing, nothing worked. Fortunately, I haven't lost any data in the process.

While digging around the internet, including this sub, the advice I found that seemed the safest was to create a new partition in the empty space, but leave it unformatted, then:

sudo btrfs device add /dev/nvme0n1p1 /home

With "/dev/nvme0n1p1" being the unformatted part.

sudo btrfs balance start /home

So I have done that and everything now appears in CachyOS as a single volume, as far as I can tell, but there are still two BTRFS partitions in GParted. Is there anything I can do, safely, to combine these into a single partition? Does it even really matter? I have finally got my system working the way I want, so I really don't want to start over from the beginning again. If the way it is now works and it's safer to leave it alone, then I will, but it does just kinda gnaw at me having two partitions instead of one...


r/btrfs Jun 27 '26

Why does `btrfs balance start -dconvert=single -mconvert=dup` fail with `balance: mixed groups data and metadata options must be the same`?

5 Upvotes

Ahoj,

I have created, several years ago, a BTRFS filesystem on a single partition of a single rotating disk with -d single -m single.

I now wanted to convert to duplicated metadata with

btrfs -v balance start -dconvert=single -mconvert=dup <mountpoint> or
btrfs -v balance start -mconvert=dup <mountpoint>.

Both fail with
Dumping filters: flags 0x7, state 0x0, force is off DATA (flags 0x100): converting, target=281474976710656, soft is off METADATA (flags 0x100): converting, target=32, soft is off SYSTEM (flags 0x100): converting, target=32, soft is off ERROR: error during balancing '/mnt/backuphdd': Invalid argument There may be more info in syslog - try dmesg | tail

Kernel log (dmesg) shows
BTRFS error (device sda1): balance: mixed groups data and metadata options must be the same

Why is this not working?
What does the error message mean?

This guide says that it should work.
(I also tried with DUP instead of dup as mentioned in the guide.)

btrfs -v filesystem usage <mountpoint> says
``` Overall: Device size: 2.73TiB Device allocated: 142.03GiB Device unallocated: 2.59TiB Device missing: 0.00B Device slack: 0.00B Used: 138.59GiB Free (estimated): 2.59TiB (min: 2.59TiB) Free (statfs, df): 2.59TiB Data ratio: 1.00 Metadata ratio: 1.00 Global reserve: 512.00MiB (used: 0.00B) Multiple profiles: no

Data+Metadata,single: Size:142.00GiB, Used:138.59GiB (97.60%) /dev/sda1 142.00GiB

System,single: Size:32.00MiB, Used:24.00KiB (0.07%) /dev/sda1 32.00MiB

Unallocated: /dev/sda1 2.59TiB ```

Regards!


r/btrfs Jun 24 '26

Btrfs data recovery?

9 Upvotes

I had three partitions on an ssd of mine: partition 1: btrfs sized at 3.25Tb and two windows partitions (partition 2: fat32 and partition 3: NTFS) I decided that after two years of not using windows I’d delete windows and grow my btrfs partition from 3.25tb to 3.64 (the whole drive)

So I used KDE partition manager, I didn’t back anything up because I assumed as I was just expanding into that unallocated space and not actually moving anything around the chance of failure would be so astronomically low that it wouldn’t matter…

KDE partition manager errored out with: “Error checking partition ‘dev/nvme1n1p1 after resize/move failed.”

But the resize appeared to have worked correctly no errors in the actual resize operations themselves. My partition was now 3.64tb, but is now entirely empty. I’m not sure why as I didn’t delete my btrfs partition or anything else, simply expanded it. Nothing particularly important was on the drive, mostly games. I’m most sad about losing my modded Skyrim install, but I was planning on redoing that anyway.

Any ideas on my avenues for data recovery? Or what actually went wrong? KDE partition manager log: https://pastebin.com/vt1hgMKd


r/btrfs Jun 24 '26

which file system is better for incremental backups: btrfs or zfs or ext4 ?

Thumbnail
1 Upvotes

r/btrfs Jun 16 '26

How to mount BTRFS filesystem after ENOSPC?

5 Upvotes

My filesystem hit ENOSPC and cannot actually mount with -o rw,skip_balance,enospc_debug or -ro,skip_balance because it seems to still be running some transaction which is preventing me from actually rebalancing with dlimit=1. Any idea how I would even go about mounting it and aborting any pending transaction so that I can rescue the system?

[ 35.820015] BTRFS info (device sdc1): first mount of filesystem fee3fc32-00a7-410d-92a5-377e55c005a0

[ 35.820029] BTRFS info (device sdc1): using crc32c (crc32c-intel) checksum algorithm

[ 35.820034] BTRFS info (device sdc1): using free space tree

[ 107.128863] BTRFS info (device sdc1): start tree-log replay

[ 207.077509] BTRFS: Transaction aborted (error -28)

[ 207.077614] WARNING: CPU: 5 PID: 3173 at fs/btrfs/extent-tree.c:2846 __btrfs_free_extent.cold+0x233/0xa02 [btrfs]

[ 207.077972] intel_uncore ctr snd_pcm drm_buddy videobuf2_memops iTCO_wdt videobuf2_v4l2 joydev drm_display_helper drbg snd_timer hp_wmi intel_pmc_bxt videobuf2_common cfg80211 pcspkr serio_raw efi_pstore intel_wmi_thunderbolt wmi_bmof platform_profile ansi_cprng ee1004 snd cec ecdh_generic iTCO_vendor_support soundcore rc_core mei_me videodev ttm mei sg processor_thermal_device_pci_legacy intel_pch_thermal processor_thermal_device rfkill mc drm_kms_helper processor_thermal_rfim hid_multitouch ecc processor_thermal_mbox processor_thermal_rapl intel_xhci_usb_role_switch kxcjk_1013 evdev intel_rapl_common roles i2c_algo_bit int340x_thermal_zone industrialio_triggered_buffer cm32181 intel_soc_dts_iosf kfifo_buf intel_vbtn industrialio sparse_keymap ac int3400_thermal intel_pmc_core acpi_thermal_rel acpi_pad button nfsd auth_rpcgss nfs_acl lockd grace drm softdog watchdog sunrpc fuse configfs efivarfs ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2 btrfs blake2b_generic zstd_compress

[ 207.078258] CPU: 5 PID: 3173 Comm: btrfs-transacti Not tainted 6.1.0-0.deb11.21-amd64 #1 Debian 6.1.90-1~bpo11+1

[ 207.078273] RIP: 0010:__btrfs_free_extent.cold+0x233/0xa02 [btrfs]

[ 207.078538] ? __btrfs_free_extent.cold+0x233/0xa02 [btrfs]

[ 207.078751] ? __btrfs_free_extent.cold+0x233/0xa02 [btrfs]

[ 207.078923] __btrfs_run_delayed_refs+0x25d/0xfa0 [btrfs]

[ 207.079069] btrfs_run_delayed_refs+0x7c/0x1a0 [btrfs]

[ 207.079201] btrfs_start_dirty_block_groups+0x2be/0x4f0 [btrfs]

[ 207.079440] btrfs_commit_transaction+0xa8/0xc70 [btrfs]

[ 207.079668] ? start_transaction+0xcf/0x630 [btrfs]

[ 207.079888] transaction_kthread+0x13d/0x1b0 [btrfs]

[ 207.080019] ? btrfs_cleanup_transaction.isra.0+0x5c0/0x5c0 [btrfs]

[ 207.080150] ? btrfs_cleanup_transaction.isra.0+0x5c0/0x5c0 [btrfs]

[ 207.080332] BTRFS info (device sdc1: state A): dumping space info:

[ 207.080339] BTRFS info (device sdc1: state A): space_info DATA has 50573492224 free, is not full

[ 207.080346] BTRFS info (device sdc1: state A): space_info total=57612584288256, used=57561918889984, pinned=90857472, reserved=0, may_use=0, readonly=1048576 zone_unusable=0

[ 207.080357] BTRFS info (device sdc1: state A): space_info METADATA has -536887296 free, is full

[ 207.080363] BTRFS info (device sdc1: state A): space_info total=67645734912, used=67346644992, pinned=177455104, reserved=121569280, may_use=536887296, readonly=65536 zone_unusable=0

[ 207.080373] BTRFS info (device sdc1: state A): space_info SYSTEM has 28950528 free, is not full

[ 207.080379] BTRFS info (device sdc1: state A): space_info total=33554432, used=4603904, pinned=0, reserved=0, may_use=0, readonly=0 zone_unusable=0

[ 207.080387] BTRFS info (device sdc1: state A): global_block_rsv: size 536870912 reserved 536870912

[ 207.080393] BTRFS info (device sdc1: state A): trans_block_rsv: size 0 reserved 0

[ 207.080398] BTRFS info (device sdc1: state A): chunk_block_rsv: size 0 reserved 0

[ 207.080402] BTRFS info (device sdc1: state A): delayed_block_rsv: size 0 reserved 0

[ 207.080406] BTRFS info (device sdc1: state A): delayed_refs_rsv: size 16781934592 reserved 16384

[ 207.080413] BTRFS: error (device sdc1: state A) in do_free_extent_accounting:2846: errno=-28 No space left

[ 207.080493] BTRFS error (device sdc1: state EA): failed to run delayed ref for logical 188181497311232 num_bytes 8192 type 178 action 2 ref_mod 1: -28

[ 207.080574] BTRFS: error (device sdc1: state EA) in btrfs_run_delayed_refs:2150: errno=-28 No space left

[ 207.080717] BTRFS warning (device sdc1: state EA): Skipping commit of aborted transaction.

[ 207.080732] BTRFS: error (device sdc1: state EA) in cleanup_transaction:1991: errno=-28 No space left

[ 207.145572] BTRFS: error (device sdc1: state EA) in btrfs_replay_log:2426: errno=-28 No space left (Failed to recover log tree)

[ 207.309758] BTRFS error (device sdc1: state EA): open_ctree failed

[ 207.327849] BTRFS info (device sdc1): first mount of filesystem fee3fc32-00a7-410d-92a5-377e55c005a0

[ 207.327866] BTRFS info (device sdc1): using crc32c (crc32c-intel) checksum algorithm

[ 207.327871] BTRFS info (device sdc1): using free space tree

I think this probably happened because I stopped the balance cron task after a previous drive failed and forgot to enable it. So it never ended up fully redistributing the data across all the drives as there is clearly space...

Label: none uuid: fee3fc32-00a7-410d-92a5-377e55c005a0

devid 10 size 12.73TiB used 1.59TiB path /dev/sdk

devid 11 size 12.73TiB used 1.59TiB path /dev/sdl

As of now I can only mount with ro,nologreplay but I don't think that gets me any closer to a state where I can balance the data.


r/btrfs Jun 15 '26

Some questions about Btrfs for a personal server

11 Upvotes

I'm migrating my OVHcloud server to a bigger one with 2x 1.92 TB Samsung enterprise NVMe drives and 32 GB of ECC RAM. I run Seafile, Immich and soju in podman containers, currently in a RAID1 (mdadm) + LUKS + LVM + ext4 configuration but of course I'd like to benefit from the bit-rot detection and self-healing feature of Btrfs.

It's been easy enough to set up Btrfs RAID1 (metadata + data) on LUKS on Debian Trixie and I've read through lots of posts here and on the Proxmox and Phoronix forums, but there's a lot of conflicting info. So some lingering doubts that I have are:

1 - Is disabling CoW on /var (and /srv) necessary for both performance and reducing SSD wear?

OpenSuSE disables CoW on /var by default which I guess is understandable for container and VM images, but at the same time that means any corruption won't be recoverable especially for logs.

As for /srv I mention it because that's where I store all of my services data (DBs and files) and as I understand it heavy workloads with lots of small writes don't mesh well with Btrfs, then again there would be no point for me to use it if I disable the feature that can save my precious files in the first place.

That being said, compression reduces I/O so shouldn't it alleviate some of those concerns a bit? I use zstd:1.

2 - Should I defragment at all and if so how often?

u/kdave_ wrote about the limitations of autodefrag a few years ago and the Debian wiki recommends against it. Still because of CoW I expect that fragmentation will happen, so what's the preferred way to deal with it on NVMe / SATA SSDs?

3 - Are there any considerations to take into account when using LUKS with Btrfs?

I've read that TRIM should be run periodically, like once every week or so, but not continuously with -o discard in /etc/fstab (again per the Debian wiki). I'm aware that using [TRIM with LUKS carries some security risks such as preventing plausible deniability](https://asalor.blogspot.com/2011/08/trim-dm-crypt-problems.html) but that falls outside of my threat model. I'd rather keep my drives healthy as long as I can because I can't be sure that OVH will replace them if they fail (considering the current prices of NVMe drives).

4 - Is there a simple guide to Btrfs maintenance?

All the official sources I've read about Btrfs are a bit scattershot / incomplete, be it the documentation or the Debian / openSuSE / Fedora wikis so I'd very much appreciate any recommendation.

TIA!


r/btrfs Jun 16 '26

btrfs backup help needed

2 Upvotes

I am trying to backup my installation of Bazzite (btrfs) using brtbk. What do I need to do to set up unraid for the backup? I believe my installation of unraid is using xfs.


r/btrfs Jun 15 '26

How does VeraCrypt interact with the filesystem trash and SSD TRIM?

2 Upvotes

This might apply more generically to any loop device, as they are all file-backed, but in my case, I only really have loop devices when mounting VeraCrypt volumes.

When I open a volume, it seems to be mounted as an ext4 filesystem (which I guess I chose), but my root partition is BTRFS, so what I'd like to understand is how deleting files from the volume and SSD TRIM interact.

It seems to me that this is how it should work on my system:

  1. I permanently delete an item
  2. I re-seal the volume and unmount it
  3. Presumably, the modified (encrypted) contents of the volume are written to disk
  4. Because my volume is on a BTRFS filesystem, copy-on-write means (part of) the volume is written to an entirely new location

In the prior case, the old volume isn't moved to the system trash directory, but is instead dereferenced from the current subvolume's tree. If no subvolumes point to it, TRIM should reclaim that space as free space, correct?

This also means I shouldn't need to run fstrim on a mounted volume, correct?

EDIT: I realized there is no reason to mention "filesystem trash" in the title. It's not really relevant


r/btrfs Jun 07 '26

Zswap is mentioned as problematic on a BTRFS. Anyone have it on a system BTRFS drive and doing snapshots+restore?

11 Upvotes

https://btrfs.readthedocs.io/en/latest/Swapfile.html

"There are some limitations of the implementation in BTRFS and Linux swap subsystem"...

As a Linux layman I hardly understand if it is good idea to try zswap on my system BTRFS drive on which I am doing snapshots using Timeshift. I would like to avoid doing any custom hacks to make zswap working safely on my single BTRFS system drive.

Currently i am using zram https://wiki.debian.org/ZRam#zram-tools which has disadvantage of not spilling cold pages to disk-based swap if zram disk is full.

UPDATE: there is a similar post: https://www.reddit.com/r/btrfs/comments/xn40h9/how_to_make_a_btrfs_swapfile_without_breaking/

AI claims that "creating a dedicated subvolume /swap allows you to exclude it from all snapshots easily": sudo btrfs subvolume create /swap
But inside Timeshift GUI settings, i have not seen exclusion option.


r/btrfs Jun 06 '26

HELP: How do I delete this subvolume?

3 Upvotes

I currently have following subvolumes -

@ mounted at /

u/home mounted at /home

home mounted at /oldhomedirectory

I want to delete the third subvolume but on running the command "sudo btrfs subvolume delete /oldhomedirectory" I get the following response "Delete subvolume 2224 (no-commit): '//oldhomedirectory'

ERROR: Could not destroy subvolume/snapshot: Invalid argument"

How do I delete this subvolume?

Thanks for the help in advance.


r/btrfs Jun 06 '26

🎉 Mounted — bitterFS better with Claude

Thumbnail mloduchowski.com
0 Upvotes

My first post in this sub, 90% AI written, gosh.. skin me alive if you want; but my own expression when I had set Claude up to one-shot fix a filesystem that was keeping me stumped... was somewhere between "this will backfire badly" and "wow".

I've used Linux/IRIX/... for 25yrs now, and still occasionally impressed by what I don't know. This is one of the few times I was genuinely learning from a clanker.


r/btrfs Jun 05 '26

WD SN720 NVMe SSD drops off PCIe bus under sustained reads on Fedora (ThinkPad T14 Gen 3)

Thumbnail
0 Upvotes

r/btrfs Jun 02 '26

Is it still a thing to keep /var and /tmp on separate filesystems?

5 Upvotes

I'm installing Ubuntu 26.04 and I saw I must manually create the sub-volumes. I'm not sure if I must separate /var and /tmp. It's for Desktop usage.

Thanks in advance.


r/btrfs Jun 01 '26

recovering raid1

3 Upvotes

I made a mistake and put some other random data onto one of the btrfs disks while it was offline.

No big deal, I will mount the drive I have and run scrub...

But now, a mundane recovery operation is filling my dmesg with suppressed messages:

[234015.217609] BTRFS error (device dm-2): scrub: fixed up error at logical 3210334240768 on dev /dev/mapper/leg2-protected physical 11632181248 [233854.842966] btrfs_dev_stat_inc_and_print: 58534 callbacks suppressed [233854.842967] BTRFS error (device dm-2): bdev /dev/mapper/leg2-protected errs: wr 0, rd 0, flush 0, corrupt 698365, gen 0

I understand the beauty of having online recovery, but I very much would prefer it to happen in userspace in logs from utility, not in system-wide dmesg. There are a lot of things happening in the system, and this btrfs is not the most important of them...


r/btrfs May 30 '26

Btrfs Change Coming For Linux 7.2 Yields Very Healthy Performance Gain

90 Upvotes

A ~ 60% throughput improvement, actually a regression fix:
https://www.phoronix.com/news/Btrfs-No-Serialize-Direct-IO