ejolson
Posts: 8897
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: 8897
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: 8897
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: 6354
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: 8897
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: 6354
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: 8897
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: 6354
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: 8897
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: 6354
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: 8897
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: 8897
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?

elpeh
Posts: 6
Joined: Mon Mar 14, 2016 12:26 pm

mkfs.btrfs. on buster broken Re: btrfs-progs in Buster busted for multi-drive disk pools.

Sun Nov 15, 2020 8:02 pm

Hello,

I have to reactivate this thread with a more general problem of btrfs-progs on PI4 buster.
mkfs.btfs is not working for me. Neither wirh USB-SSD-devices (one or two, partirion oe whole device), but with the same behaviour also on loopback file (on ext4):
-rw-r--r-- 1 root root 1048576000 Nov 15 20:52 loopbackfile.img

root@hosts~# mkfs.btrfs loopbackfile.img
btrfs-progs v4.20.1
See http://btrfs.wiki.kernel.org for more information.

ERROR: superblock magic doesn't match
Bus error

Same (SSD) devices initiated on x86_64 Linux (openSUSE Leap 15.2) with btrfs-progs v4.19.1 seems to work on the Pi (even with LUKS layer inbetween).
I haven't tested snapshots or other operations yet though.

Any idea? I'm surprised that I don't find this problem described here...

Regards
Lutz

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

Re: mkfs.btrfs. on buster broken Re: btrfs-progs in Buster busted for multi-drive disk pools.

Sun Nov 15, 2020 11:10 pm

elpeh wrote:
Sun Nov 15, 2020 8:02 pm
Hello,

I have to reactivate this thread with a more general problem of btrfs-progs on PI4 buster.
mkfs.btfs is not working for me. Neither wirh USB-SSD-devices (one or two, partirion oe whole device), but with the same behaviour also on loopback file (on ext4):
-rw-r--r-- 1 root root 1048576000 Nov 15 20:52 loopbackfile.img

root@hosts~# mkfs.btrfs loopbackfile.img
btrfs-progs v4.20.1
See http://btrfs.wiki.kernel.org for more information.

ERROR: superblock magic doesn't match
Bus error

Same (SSD) devices initiated on x86_64 Linux (openSUSE Leap 15.2) with btrfs-progs v4.19.1 seems to work on the Pi (even with LUKS layer inbetween).
I haven't tested snapshots or other operations yet though.

Any idea? I'm surprised that I don't find this problem described here...

Regards
Lutz
Have you tried mounting the img file as a loopback device and then formatting?

This may be one of those 32-bit getting more and more broken over time as new developers have less experience with anything other than 64-bit systems.

elpeh
Posts: 6
Joined: Mon Mar 14, 2016 12:26 pm

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

Mon Nov 16, 2020 11:10 am

root@host:~# losetup -f loopbackfile.img
root@host:~# LANG=en mkfs.btrfs /dev/loop0
btrfs-progs v4.20.1
See http://btrfs.wiki.kernel.org for more information.

ERROR: superblock magic doesn't match
Detected a SSD, turning off metadata duplication. Mkfs with -m dup if you want to force metadata duplication.
Bus-Zugriffsfehler


No difference. As I wrote, file only as further test. Also happens with real devices.

Lutz

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

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

Mon Nov 16, 2020 4:16 pm

elpeh wrote:
Mon Nov 16, 2020 11:10 am
root@host:~# losetup -f loopbackfile.img
root@host:~# LANG=en mkfs.btrfs /dev/loop0
btrfs-progs v4.20.1
See http://btrfs.wiki.kernel.org for more information.

ERROR: superblock magic doesn't match
Detected a SSD, turning off metadata duplication. Mkfs with -m dup if you want to force metadata duplication.
Bus-Zugriffsfehler


No difference. As I wrote, file only as further test. Also happens with real devices.

Lutz
My testing was only done with a disk pool that had been created on an x86 machine previously. My impression is that the driver in the kernel works okay, but latest versions of btrfs-progs don't.

Does the btrfs binary copied over from Raspbian Stretch work? That was the work around I used before.

Return to “Raspberry Pi OS”