Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help compiling btrfs-restore zstd support to deal with potential dataloss?

Featured Replies

I have a drive with btrfs that is corrupted. I want to use btrfs restore but my drive had many files with compression set to zstd, as it is supported by the kernel. But the version of btrfs-progs installed on 6.11.5 does not have the zstd flag enabled, and thus errors when trying to restore files with zstd compression.

 

Quote

ERROR: copying data for <path> failed
ERROR: btrfs not compiled with zstd support

 

 

I looked into compiling but with the dev tools plugin being depreciated, it seems like a bit of a hassle.


Well, I started down this path after I realized my unRAID parity possibly became out of sync. unRAID certainly could've protected me more but I'll take the blame. For anyone interested in what happened:

 

 

Quote

 

After rebooting, my btrfs partition was unmountable due to write errors on the HD controller (of course this isn't detected by SMART, SMART tests, or the runs of preclearing). The array was in a poor state due to a partition not being mountable. Multiple writes failed to my btrfs partition, so parity was a bit out of sync (it in theory contained the data to correctly emulate my disk or use read/modify/write), though unRAID did not appear to realize this. This becomes a problem later.

 

 

Also, /mnt/user was empty, and I mistakenly assumed that it would stay this way without some intervention in the GUI or command line specific to unRAID. However, once I bypassed the btrfs errors to mount it and recover, unRAID revelaed /mnt/user to the rest of the system to do as it pleases. This is because I mounted it to the place unRAID expected, /mnt/disk4. What confuses me is that I mounted /mnt/disk4 as ro, and it was the smallest drive so it should be written to first. This seemed to be the behavior when the drive failed, as it would report input/output errors, and so writing to /mnt/user also did. 

 

 

However, to my horror, syslogd was writing syslogs from my router and unraid itself to /mnt/user. Unfortunately this included thousands of lines of btrfs parent transid verify failed. I think this would've been fine if it used read/modify/write, however my drives never spin down so I set it to use turbo reconstruct write. That means it would try reading from my failed disk without knowing that writes had failed. If this modified the any part of the btrfs tree metadata structure, any leaf nodes below it would be unreachable, according to experts in #btrfs irc, and I would use information about the files and its types.

 

 

When trying to build btrfs-progs myself, I ran into several issues and am currently stuck on a couple issues.  After going through and installing missing dependencies from https://packages.slackware.com/, I was able to get configure getting decently far. However:

  • openat() function doesn't exist
    • I did check fcntl.h and it certainly looks like openat is defined, just whether or not there is a separate openat64 depending on #defines, though it's been a while since I programmed
  • backtrace and some issue with documentation generation, both can be fixed with flags
  • blkid, uuid packages not found, not on slackware.com
    • stopped commenting out checks at this point

 

image.png

Edited by robobub

Solved by robobub

  • robobub changed the title to Help compiling btrfs-restore zstd support to deal with potential dataloss?
  • Author
  • Solution

After realizing I might actually have dataloss from some mishaps with parity, I've started down this path and ran into issues, added to the first post.

EDIT: Solved through making a temporary array where I could start an ubuntu docker and compile it. The binary then runs on the base slackware outside of docker just fine.

Edited by robobub

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.