Questions tagged [btrfs]

B-tree file system is a copy-on-write file system for Linux

From the official project site:

Btrfs is a new copy on write (CoW) filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration. Jointly developed at Oracle, Red Hat, Fujitsu, Intel, SUSE, STRATO and many others, Btrfs is licensed under the GPL and open for contribution from anyone.

The main Btrfs features available at the moment (as of 23 March 2014) include:

  • Extent based file storage
  • 2^64 byte == 16 EiB maximum file size
  • Space-efficient packing of small files
  • Space-efficient indexed directories
  • Dynamic inode allocation
  • Writable snapshots, read-only snapshots
  • Subvolumes (separate internal filesystem roots)
  • Checksums on data and metadata (crc32c)
  • Compression (zlib and LZO)
  • Integrated multiple device support
  • File Striping, File Mirroring, File Striping+Mirroring, Striping with Single and Dual Parity implementations
  • SSD (Flash storage) awareness (TRIM/Discard for reporting free blocks for reuse) and optimizations (e.g. avoiding unnecessary seek optimizations, sending writes in clusters, even if they are from unrelated files. This results in larger write operations and faster write throughput)
  • Efficient Incremental Backup
  • Background scrub process for finding and fixing errors on files with redundant copies
  • Online filesystem defragmentation
  • Offline filesystem check
  • Conversion of existing ext3/4 file systems
  • Seed devices. Create a (readonly) filesystem that acts as a template to seed other Btrfs filesystems. The original filesystem and devices are included as a readonly starting point for the new filesystem. Using copy on write, all modifications are stored on different devices; the original is unchanged.
  • Subvolume-aware quota support
  • Send/receive of subvolume changes
  • Efficient incremental filesystem mirroring
  • Batch, or out-of-band deduplication (happens after writes, not during)
87 questions
0
votes
0 answers

How to recover a btrfs filesystem on top of lvm on two encrypted devices after an lvresize mishap

Recently I added a second ssd block device tot my Pop!_OS 22.04 system, encrypted it and added it to the volume group. In the process I decided to resize the root logical volume (the only volume). However instead of reducing it by 1GB I resized it…
0
votes
0 answers

Yocto - BTRFS for rootfs

I'm having problems when using Btrfs for my rootfs. I'm generatig my image with Yocto and as far as I know U-Boot support it. My zImage and my dts are located at boot and I already enabled Btrfs configs on menuconfig. At boot process I'm getting: [ …
Bjlli
  • 1
  • 1
0
votes
1 answer

Copy files using Server Side Copy/Clone in Python?

Protocols like Samba and AFP support server side copy of files. The BTRFS file system even supports instant server side clone operations that don't take up space. Windows Explorer, Robocopy and MacOS Finder already utilize this Cloner is a sample…
Patrick Wolf
  • 2,530
  • 2
  • 28
  • 27
0
votes
0 answers

Direct I/O alignment restrictions on Btrfs

When performing direct I/O, the buffer memory boundary, file or device offset, and length of the data to be transferred have to be disk blocksize(typically 512 bytes) aligned, or you will get an error with errno set to EINVAL. The Linux Programming…
Steve Lau
  • 658
  • 7
  • 13
0
votes
0 answers

btrfs shows strange dir names in send-receive dump

Today I found out, that just showing a diff in btrfs is extremely complicated. While in ZFS, it's only zfs diff, in btrfs, one has to use either btrfs subv find-new and this find-new does never show me files I created with…
andi8086
  • 394
  • 2
  • 9
0
votes
1 answer

Why don't mounted btrfs subvolumes show up in findmnt?

It appears that Docker creates btrfs subvolumes for its volumes. One example is: ID 266 gen 116089 top level 256 path var/lib/docker/btrfs/subvolumes/166cda8dab21861bcae5e3186d5e21014278d311d68966af9778cecdbdc7a736 These show up when I run btrfs…
Christopher Shroba
  • 7,006
  • 8
  • 40
  • 68
0
votes
1 answer

Btrfs snapshot size too big. Do they actually contain the diffs only?

I don't have a good understanding of COW-snapshots mechanics but expect they contain the diffs and shared data among all of those which have one parent subvolume. I made a script to check btrfs snapshots disk space consumption. #!/usr/bin/zsh for i…
kvdm.dev
  • 141
  • 1
  • 1
  • 12
0
votes
1 answer

btrfs: how to drain one disk in 'single' profile

Assume a multi-device btrfs with data profile single and metadata profile mirrored. The first disk is almost full. The second disk is large enough to hold all data of the whole filesystem. The first disk needs replacement - is there a way to drain…
Martin
  • 184
  • 10
0
votes
0 answers

Why can't PHP flock on btrfs filesystem?

I am trying to set up a chromebook for Laravel development and I was having trouble with my project throwing "419 Page Expired" on every form. The project works fine on a Manjaro development machine. I traced the issue down to Laravel's file-system…
mp035
  • 964
  • 7
  • 18
0
votes
1 answer

Can't remove C (no copy on write) attribute on any file

so for years now I've been using btrfs without any issues, up until recently when I noticed all of my new files seem to have a +C attributes, there is some that do not, I've been unable to figure out what causes file attribute to have +C under my…
0
votes
0 answers

Can fsync(fd) accidentally flush entire Filesystem?

As per API, it just accepts the file fd but is it possible for this operation to accidentally flush the entire filesystem to disk? For example, if the filesystem is journaling and I do fsync on this fd, could it just flush entire journal at which…
user855
  • 19,048
  • 38
  • 98
  • 162
0
votes
1 answer

Does CoW work for files that have the same content but were not created by `cp --reflink`?

I think CoW works for this. echo 'stackoverflow' > foo cp --reflink foo bar So what about this one? echo 'stackoverflow' > foo echo 'stackoverflow' > bar In this case, do they use the disk space of two files? In my use case, there are not many…
omae
  • 25
  • 6
0
votes
0 answers

How to fix btrfs error according to thermal directory

I'm new to ubuntu and I think something went wrong while performing apt upgrades. The unattended upgrades fail due to this error message: dpkg: Fehler beim Bearbeiten des Paketes…
MueRi
  • 1
0
votes
1 answer

Increasing disk size in Vagrant archlinux using resize2fs

I am currently running a Vagrant box with archlinux for development purposes. I wanted to go beyond the 2GB so I installed the vagrant-disksize plugin and after ssh'ing into the box and changing the partition size, I ran resize2fs as suggested…
Yann Hoffmann
  • 201
  • 2
  • 8
0
votes
2 answers

How do I get the disk addresses of files in C/C++?

When a file is saved into a drive, its contents are written & then indexed. I want to get the indexes and to access the raw contents of the files. Any idea on the method how to do it, especially for ex4 & btrfs? UPDATE: I want to get the addresses…
Yacov
  • 21
  • 2