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

[PROBLEM] How to recover Xbian BTRFS snapshot or a dir. from xbian_backup_home_01-01-23.img.gz?
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Problem: How to recover Xbian BTRFS snapshot or a dir. from xbian_backup_home_01-01-23.img.gz?
3rd Aug, 2023, 12:57 AM
Post: #1
postcd Offline
Registered
Posts: 31
Joined: Nov 2021
Reputation: 0
Information How to recover Xbian BTRFS snapshot or a dir. from xbian_backup_home_01-01-23.img.gz?
Hello,

I need to recover one folder from the time around 1 week ago or older. Can i do it within Xbian BTRFS or on other computer i have xbian_backup_home_01-01-23.img.gz which i can extract, but do not know if/how to properly mount it while my other computer Linux Debian PC has no BTRFS.

Mounted extracted .img using Disks GUI tool in Debian (seeing loop0 in lsblk output). No available operation to see content.

Quote:sudo losetup /dev/loop1 /dev/shm/xbian_backup_home_01-01-23.img
losetup: /dev/shm/xbian_backup_home_01-01-23.img: Warning: file does not fit into a 512-byte sector; the end of the file will be ignored.

sudo mount /dev/loop{0,1} /mnt/xn
mount: /mnt/xn: wrong fs type, bad option, bad superblock on /dev/loop1, missing codepage or helper program, or other error.

List of BTRFS snapshots is here

The snapshot that looks like the one to restore seems to be:
Quote:ID 3790 gen 868586 top level 261 path home/@btrfs-auto-snap_monthly-2023-07-12-1045

Yet after like 30 minutes i have not found right command/s to restore it.
Visit this user's website Find all posts by this user
Quote this message in a reply
13th Aug, 2023, 07:08 PM
Post: #2
postcd Offline
Registered
Posts: 31
Joined: Nov 2021
Reputation: 0
RE: How to recover Xbian BTRFS snapshot or a dir. from xbian_backup_home_01-01-23.img.gz?
Mount snapshots subvolume for current session in order to browse directories and files/copy/restore it:
Quote:mkdir /root/btrfs-snapshots;mount -o rw,relatime,ssd,space_cache,subvol=/ /dev/mmcblk0p2 /root/btrfs-snapshots
(/dev/mmcblk0p2 is the device path shown in output of the command: mount|grep "@" )

List content of the /home/user/ directory in one of the snapshots:
Quote:ls /root/btrfs-snapshots/home/@btrfs-auto-snap_daily-2023-04-24-0827/user/

Copy directory from snapshot to its original location:
Quote:cp -a --reflink=always /root/btrfs-snapshots/home/@btrfs-auto-snap_daily-2023-04-24-0827/user/directory /home/user/
(--reflink=always to prevent duplication of files (save disk space))

List snapshots:
Quote:btrfs sub list / -t

Mount snapshots on each boot:
Quote:blkid|grep btrfs

Find out UUID and copy it down, open fstab:
Quote:sudo nano /etc/fstab

append new line inside it:
Quote:UUID="uuidhere" /root/btrfs-snapshots xbian ro,noatime,nodiratime 0 0
(replace uuidhere and xbian[by string that other mount lines in the file has] and replace ro by rw in case you need to write into snapshot filesystem. "ssd" parameter in case of a SSD drive + writing.)
Visit this user's website Find all posts by this user
Quote this message in a reply
12th Sep, 2023, 06:16 PM
Post: #3
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: How to recover Xbian BTRFS snapshot or a dir. from xbian_backup_home_01-01-23.img.gz?
I always do this when I need something from a snapshot:

Code:
mount /dev/root /mnt
cd /mnt/
ls -la

This shows you the subvol roots for /root, /home etc.
then

Code:
cd home for example
ls -la

Then you will see all available snapshots of the subvolume
and finally

Code:
cd @....
into the snapshot you want to get the older files from
Find all posts by this user
Quote this message in a reply
25th Oct, 2023, 05:28 PM
Post: #4
frybreadnice Offline
Banned
Posts: 1
Joined: Oct 2023
RE: How to recover Xbian BTRFS snapshot or a dir. from xbian_backup_home_01-01-23.img.gz?
I usually use Snipping Tools when I want to take a quick snapshot.
Visit this user's website Find all posts by this user
Quote this message in a reply
21st Nov, 2023, 04:42 PM
Post: #5
Suzume199x Offline
Banned
Posts: 1
Joined: Nov 2023
RE: How to recover Xbian BTRFS snapshot or a dir. from xbian_backup_home_01-01-23.img.gz?
You can restore the snapshot. pokedoku
Find all posts by this user
Quote this message in a reply
28th Nov, 2023, 07:18 PM
Post: #6
Mira23 Offline
Banned
Posts: 1
Joined: Nov 2023
RE: How to recover Xbian BTRFS snapshot or a dir. from xbian_backup_home_01-01-23.img.gz?
(25th Oct, 2023 05:28 PM)frybreadnice Wrote:  I usually use Snipping Tools when I want to take a quick snapshot dino game
This tool is quite good, and it is very convenient to use
Find all posts by this user
Quote this message in a reply
12th Jan, 2024, 06:04 PM
Post: #7
TomHiddleston Offline
Banned
Posts: 2
Joined: Jan 2024
RE: How to recover Xbian BTRFS snapshot or a dir. from xbian_backup_home_01-01-23.img.gz?
great
Find all posts by this user
Quote this message in a reply
23rd Jan, 2024, 11:36 AM
Post: #8
lilianna Offline
Banned
Posts: 1
Joined: Jan 2024
RE: How to recover Xbian BTRFS snapshot or a dir. from xbian_backup_home_01-01-23.img.gz?
You don't need to mount the .imp file separately. It's already part of the BTRFS filesystem. Buckshot Roulette
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


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

Current time: 14th May, 2025, 04:22 AM Powered By MyBB, © 2002-2025 MyBB Group.