Forum
[PROBLEM] Mounting of Backup Image-File not possible - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: [PROBLEM] Mounting of Backup Image-File not possible (/thread-3142.html)



Mounting of Backup Image-File not possible - suhm - 2nd Oct, 2015 08:22 AM

Hi,

i've destroyed my root file system on my xbian and want just to rollback to my last snapshot,
so i cannot access and i dont know the name of it anymore (@ and @last_good_known arealso destroyed)

ive just tried to access my sd card, so its not possible to mount the btrfs filesystem it says:

Terminal

btrfs: disk space caching is enabled
BTRFS: couldn't mount because of unsupported optional features (10).
btrfs: open_ctree failed

so its maybe a unpatched kernel problem or somting else?

anyways.. now i've tried to mount it on a xbian system as an *.img File and got this errors:

Terminal

# Mounted an extern USB HDD with the xbian image on my flesh xbian installattion
root@xbian:~# modprobe loop
root@xbian:~# ./md.sh /media/usbextern/xbianbackup.img
/media/usbextern/xbianbackup.img1 2048 71679 69632 34M b W95 FAT32
/media/usbextern/xbianbackup.img2 141312 15257599 15116288 7.2G 83 Linux
/media/usbextern/xbianbackup.img3 15257600 15759359 501760 245M 82 Linux swap / Solaris

root@xbian:~# mount -v -t btrfs -o loop,ro,offset=72351744 /media/usbextern/xbianbackup.img /mnt
mount: /dev/loop1 is already mounted or /mnt busy

root@xbian:~# mount -v -t auto -o loop,ro,offset=72351744 /media/usbextern/xbianbackup.img /
mount: /dev/loop1 is already mounted or / busy
/dev/loop1 is already mounted on /
/dev/loop1 is already mounted on /home
/dev/loop1 is already mounted on /lib/modules
/dev/loop1 is already mounted on /xbmc-backup

at this point i have no idea to get this work here. so im happy for any help. thanks!

suhm


RE: Mounting of Backup Image-File not possible - CurlyMo - 2nd Oct, 2015 05:14 PM

I would suggest using kpartx for this.


RE: Mounting of Backup Image-File not possible - suhm - 2nd Oct, 2015 07:37 PM

when im using kpartx its maps my image file on /dev/mapping/loopXY. its all fine at this point

so when im mounting the mapped loop device its curiously mount the wrong filesystem.. im not see my "Old SD Xbian Image" but rather see the new one where are snapshots of today/yesterday. its very strange for me. im want see some snapshots of Sep 15th or something else in the past.


RE: Mounting of Backup Image-File not possible - CurlyMo - 2nd Oct, 2015 09:16 PM

You should mount using the correct subvol option:
Code:
subvol=root/@
Where the @ points to the snapshot you want to mount. You can also boot XBian to a previous snapshot.


RE: Mounting of Backup Image-File not possible - suhm - 2nd Oct, 2015 09:57 PM

so the problem is here my root/@ and root/@last_good_known snapshots seens to be destroyed.

i want to find another snapshot on my old xbianimage file, like root/@btrfs-auto-snap_daily-2014-06-04-1905 for example.

the actually situation in my oldxbianimage:
root/@ - DESTROYED OR ANYTHING ELSE
root/@btrfs-auto-snap_daily-2015-09-15-19?? - FINE
root/@btrfs-auto-snap_weekly-2015-08-04-????
root/@btrfs-???????????????????????????????
root/@last_good_known - ALSO DESTROYED OR ANYTHING ELSE

So i want to boot with my cmdline.txt the "root/@btrfs-auto-snap_daily-2015-09-15-1905" but this is just an example. i dont know the correct name of the snapshot Sad

PS: im also just trying to add on cmdline.txt rescue oder rescue_early , but no success. my raspberry is catched in a reboot loop


RE: Mounting of Backup Image-File not possible - CurlyMo - 2nd Oct, 2015 11:05 PM

Then there is a high chance that your sd card or image is too corrupt.


RE: Mounting of Backup Image-File not possible - suhm - 2nd Oct, 2015 11:35 PM

hm, thats sounds not so good, but is there no way maybe to mount it with a ubuntu-special-btrfs-patched livecd with proper kernel?

but im really sure that the image cannot be currupt, maybe there is someting wrong with the loop-mouting? (see the strange "busy"-messages in my first posting)


RE: Mounting of Backup Image-File not possible - suhm - 5th Oct, 2015 08:46 PM

i have another idea for the problem..

my sd card where i have the new xbian intalled has a size of 8GB and my old xbian image which i want to boot is even 7~8 GB

so its maybe not possible to mount an loop device, because there isnt enough free space available and i have to use a bigger sd card?


RE: Mounting of Backup Image-File not possible - CurlyMo - 6th Oct, 2015 12:07 AM

mounting a loop device doesn't use space. That space is already allocated in the image file itself.


RE: Mounting of Backup Image-File not possible - suhm - 6th Oct, 2015 01:14 AM

ok.. so there is anothhner way maybe to patch an normal kernel from kernel.org source with a kernelpatch?
i've seen this one here in this forum: http://forum.xbian.org/thread-2217-post-24363.html#pid24363

but it would be amazing if someone has a small howto, to install this kernel patch? (it's also seems that the link is down?)


RE: Mounting of Backup Image-File not possible - suhm - 7th Oct, 2015 06:03 PM

okay. i've just found a simple solution for my problem to find my old btrfs snaps names (avoid the mounting of fs).
just using the "strings" command and grepping the last lines of binary image. here i want to share the code:

Code:
strings <image/devicefile> | grep -A 1 -B 2 -si btrfs-auto-snap_ | tail -n 50

PS: it would be still amazing if there was a possibility to run a "xbian lz4-patch" on an desktop-linux kernel, but i couldnt found the right one here. Huh