ejolson
Posts: 4054
Joined: Tue Mar 18, 2014 11:47 am

btrfs-progs in Buster busted for multi-drive disk pools.

Sun Aug 25, 2019 5:46 pm

In the continuing saga of my Pi 4B file server experiment, I have discovered that btrfs from the Raspbian btrfs-progs package can't make snapshots. The result

Code: Select all

# btrfs sub snap blue_root blue_root-snap
ERROR: Could not statfs: Value too large for defined data type
seems to indicate that instead of statfs64, the older system calls were inadvertently used. Note that statfs64 has been standard since kernel versions 2.6 and, if my memory is correct, btrfs snapshots used to work.

In light of the additional fact detailed here that Ethernet on my 4B doesn't work when connected to my gigabit switch, this file server experiment has not been going well.
Last edited by ejolson on Sat Aug 31, 2019 2:52 am, edited 9 times in total.

ejolson
Posts: 4054
Joined: Tue Mar 18, 2014 11:47 am

Re: Are btrfs-progs in Buster busted?

Sun Aug 25, 2019 7:01 pm

ejolson wrote:
Sun Aug 25, 2019 5:46 pm
In the continuing saga of my Pi 4B file server experiment, I have discovered that btrfs from the Raspbian btrfs-progs package can't make snapshots.
Note that btrfs version v4.20.1 is included with Raspbian Buster. I compiled the latest btrfs version 5.2.1 from source. The problem persisted. Then I copied the old version 4.7.3 binary from Raspbian Stretch to the 4B. Woohoo! The Stretch binary works on Buster!

In conclusion, I'm not sure whether there is a regression upstream, or something has gone wrong with the current Raspbian toolchain that prevents it from properly compiling btrfs. The result, however, is definitely a bug and it would be nice if someone fixed it properly.

Since btrfs snapshots are now working with the binary copied over from Raspbian Stretch, I'm back to pondering what's wrong with gigabit Ethernet.

ejolson
Posts: 4054
Joined: Tue Mar 18, 2014 11:47 am

Re: Are btrfs-progs in Buster busted? [Answer: yes]

Tue Aug 27, 2019 7:37 pm

This post is simply to check whether the maintainer for btrfs-progs in Raspbian Buster has seen this report, or whether an additional bug report needs to be placed somewhere other than on this forum. Any reply would be appreciated.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6115
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: btrfs-progs not working in Buster. Help requested.

Wed Aug 28, 2019 9:39 am


ejolson
Posts: 4054
Joined: Tue Mar 18, 2014 11:47 am

Re: btrfs-progs not working in Buster. Help requested.

Wed Aug 28, 2019 3:14 pm

ShiftPlusOne wrote:
Wed Aug 28, 2019 9:39 am
https://bugs.launchpad.net/raspbian/
The bug has now been added to launchpad. The report is

https://bugs.launchpad.net/raspbian/+bug/1841799

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6115
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: btrfs-progs not working in Buster. Help requested.

Wed Aug 28, 2019 3:26 pm

FWIW, my pi syncs its ext4 rootfs to an external btrfs-formatted drive and takes a snapshot nightly. I haven't come across the issue you're describing.

ejolson
Posts: 4054
Joined: Tue Mar 18, 2014 11:47 am

Re: btrfs-progs not working in Buster. Help requested.

Wed Aug 28, 2019 4:48 pm

ShiftPlusOne wrote:
Wed Aug 28, 2019 3:26 pm
FWIW, my pi syncs its ext4 rootfs to an external btrfs-formatted drive and takes a snapshot nightly. I haven't come across the issue you're describing.
Are you running Raspbian Buster?

What does btrfs --version report?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6115
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: btrfs-progs not working in Buster. Help requested.

Wed Aug 28, 2019 5:23 pm

ejolson wrote:Are you running Raspbian Buster?
Yup
ejolson wrote:What does btrfs --version report?
I'll let you know tomorrow when I have access to that pi.

ejolson
Posts: 4054
Joined: Tue Mar 18, 2014 11:47 am

Re: btrfs-progs not working in Buster. Help requested.

Thu Aug 29, 2019 3:16 am

ShiftPlusOne wrote:
Wed Aug 28, 2019 5:23 pm
ejolson wrote:Are you running Raspbian Buster?
Yup
ejolson wrote:What does btrfs --version report?
I'll let you know tomorrow when I have access to that pi.
Thanks. I find it surprising that the btrfs-progs package in Buster works for you. I'm looking forward to know what version it reports.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6115
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: btrfs-progs not working in Buster. Help requested.

Thu Aug 29, 2019 3:10 pm

Code: Select all

$ apt policy btrfs-progs
btrfs-progs:
  Installed: 4.20.1-2
  Candidate: 4.20.1-2
  Version table:
 *** 4.20.1-2 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
        100 /var/lib/dpkg/status
$ btrfs --version
btrfs-progs v4.20.1 
# btrfs subvolume snapshot -r /media/backup/work-pi/ /media/backup/work-pi_$(date -u +%Y%m%d-%H%M%S)
Create a readonly snapshot of '/media/backup/work-pi/' in '/media/backup/work-pi_20190829-150944

ejolson
Posts: 4054
Joined: Tue Mar 18, 2014 11:47 am

Re: btrfs-progs not working in Buster. Help requested.

Fri Aug 30, 2019 2:56 pm

ShiftPlusOne wrote:
Thu Aug 29, 2019 3:10 pm

Code: Select all

$ apt policy btrfs-progs
btrfs-progs:
  Installed: 4.20.1-2
  Candidate: 4.20.1-2
  Version table:
 *** 4.20.1-2 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
        100 /var/lib/dpkg/status
$ btrfs --version
btrfs-progs v4.20.1 
# btrfs subvolume snapshot -r /media/backup/work-pi/ /media/backup/work-pi_$(date -u +%Y%m%d-%H%M%S)
Create a readonly snapshot of '/media/backup/work-pi/' in '/media/backup/work-pi_20190829-150944
That does appear to be the same version that ships with Raspbian Buster. I wonder why my Pi doesn't work. Where is the Nancy Drew who can solve this mystery?

Here are some of the details for my nonworking setup:
  • The drive pool is a four disk USB drive enclosure.
  • The filesystem was created with 64-bit Intel Linux.
  • The pool is operating with both mirrored data and metadata.
  • The Raspbian Buster image on the SD card in the 4B was originally booted on a Pi Zero.
  • The btrfs binary from the previous version of Raspbian Stretch works fine.
  • I think the Pi is running the LPAE kernel--default on the 4B.
When I'm able, I'll try a BTRFS filesystem running in single-drive mode to see how that works.

Again, thanks for looking into this. The problem is more subtle than it initially seemed.

ejolson
Posts: 4054
Joined: Tue Mar 18, 2014 11:47 am

Re: btrfs-progs not working in Buster. Help requested.

Fri Aug 30, 2019 8:01 pm

ejolson wrote:
Fri Aug 30, 2019 2:56 pm
Where is the Nancy Drew who can solve this mystery?
The plot thickens. I just mounted a single BTRFS disk on the Pi 4B and obtained

Code: Select all

# /bin/btrfs --version
btrfs-progs v4.20.1 
# /bin/btrfs sub snap -r blua blua-old
Create a readonly snapshot of 'blua' in './blua-old'
# /bin/btrfs sub del blua-old
Delete subvolume (no-commit): '/x/dexa/blue/blua-old'
# md5sum /bin/btrfs
14b122fcc460cb88682ea203a6b2aa9b  /bin/btrfs
which seems to imply the difficulty only occurs in mirror mode with larger disk pools.

Does anyone have Raspbian Buster working for BTRFS in mirror mode using four disks?

Return to “Raspbian”