Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

Restoring from BTRFS SD card
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Restoring from BTRFS SD card
10th Feb, 2019, 08:05 AM
Post: #1
nickfx Offline
Registered
Posts: 14
Joined: Feb 2016
Reputation: 0
Restoring from BTRFS SD card
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
Find all posts by this user
Quote this message in a reply
13th Feb, 2019, 01:17 AM
Post: #2
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Restoring from BTRFS SD card
(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
Find all posts by this user
Quote this message in a reply
16th Feb, 2019, 07:47 AM
Post: #3
nickfx Offline
Registered
Posts: 14
Joined: Feb 2016
Reputation: 0
RE: Restoring from BTRFS SD card
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)?
Find all posts by this user
Quote this message in a reply
16th Feb, 2019, 08:27 AM
Post: #4
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Restoring from BTRFS SD card
(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
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Possibly Related Threads...
Thread: Author Replies Views: Last Post
  [solved] How to mount an SD-Card with Xbian in BTRFS under Ubuntu 16.04? duno 6 14,223 5th Jul, 2016 06:51 AM
Last Post: duno
  Restoring btrfs autosnap with ubuntu? pix3l 4 12,875 18th Aug, 2014 06:06 PM
Last Post: pix3l

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 9th May, 2025, 04:44 PM Powered By MyBB, © 2002-2025 MyBB Group.