Forum
Restoring from BTRFS SD card - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Others (/forum-24.html)
+--- Thread: Restoring from BTRFS SD card (/thread-4012.html)



Restoring from BTRFS SD card - nickfx - 10th Feb, 2019 08:05 AM

So it seems my SD card had some failures, not entirely sure why. The result is that while XBIAN boots, neither internet nor USBs work, so I can't access it at all. I'd really like to save the /etc folder, as it has quite a lot of settings.

I've mounted the SD in my Ubuntu 18.10, and can copy most files. However, with quite a few important ones, I get an input-output error.

I tried
Code:
btrfs restore -s -i -o /dev/mmcblk0p2 /home/nick/restored
.

This restored several snapshots and with all files except those damaged (those files are length 0). Moreover, I get a repeated errors such as this on:
Code:
Error copying data for /home/nick/restored/root/@/var/lib/dpkg/alternatives/display-im6
ERROR: zstd decompress failed Unknown frame descriptor
, that I can't seem to find any help for.

Any idea whether this is related to the LZ4 compression, and whether I can restore these files somehow?

Nick


RE: Restoring from BTRFS SD card - Nachteule - 13th Feb, 2019 01:17 AM

(10th Feb, 2019 08:05 AM)nickfx Wrote:  Any idea whether this is related to the LZ4 compression, and whether I can restore these files somehow?

First check if you have LZ4 compression enabled:
Terminal

grep -oE "compress-force=[^ ]*|compress*=[^ ]*" /boot/cmdline.txt

If LZ4 enabled, you could try to use the internal rescue mode, which resides in initramfs.

To enable this, add rescue to commandline (in file /boot/cmdline.txt), make sure that initramfs is enabled [1]
(FORCEINITRAM=yes in /etc/default/xbian-initramfs) before rebooting

[1] initramfs can be enabled via XBian-config GUI, category System


RE: Restoring from BTRFS SD card - nickfx - 16th Feb, 2019 07:47 AM

Not sure this works. I was able to add 'rescue' to cmdline.txt on xbianroot partition. But /etc/default/xbian-initramfs is inaccessible.

I booted with the changed cmdline.txt but still cannot access anything: USB hubs and ethernet aren't working, hence wifi isn't working and I can't use a directly connected keyboard either.

LZ4 compression was set to enabled, by the way.

Ubuntu 18.10 apparently uses lz4 compression, too.

Do you have any idea how I could access the files from my main computer (i.e. mounting the SD card)?


RE: Restoring from BTRFS SD card - Nachteule - 16th Feb, 2019 08:27 AM

(16th Feb, 2019 07:47 AM)nickfx Wrote:  Not sure this works. I was able to add 'rescue' to cmdline.txt on xbianroot partition. But /etc/default/xbian-initramfs is inaccessible.

I booted with the changed cmdline.txt but still cannot access anything: USB hubs and ethernet aren't working, hence wifi isn't working and I can't use a directly connected keyboard either.

If initramfs is enabled, system should enter rescue mode. And of course, no network connection is available per default. You have to start ethernet manually, described in this text which is displayed when rescue mode is entered

Quote:LZ4 compression was set to enabled, by the way.

Ubuntu 18.10 apparently uses lz4 compression, too.

I think you mean does not use lz4 compression

Quote:Do you have any idea how I could access the files from my main computer (i.e. mounting the SD card)?

If your kernel does not support btrfs lz4 compression, I don't see any way to access files from your computer

You have only one choice:
If you have spare sd-card, you could flash a new XBian image onto and boot from this card.
After booting, put your old sd-card into an usb card reader, plug it to your Pi and mount that card from there