Problem: How to recover Xbian BTRFS snapshot or a dir. from xbian_backup_home_01-01-23.img.gz?
|
13th Aug, 2023, 07:08 PM
Post: #2
|
|||
|
|||
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.) |
|||
« Next Oldest | Next Newest »
|