Restore from full disk img

Hi

after the osmc install on my vero 2 got corrupt somehow after a reboot (no idea why) i want to recover from my full disk image via dd. somehow i am not able to enter recovery mode by pressing shift at boot. what is the right command to do it, did it change lately?

i found nothing about it in the wiki, a little more documentation would be nice …

cheers
bendsch

Hi

You can learn about how to reinstall OSMC from the Wiki.

Depending on how, and which block devices you backed up with dd, you may not be able to directly restore those images to the Vero.

Sam

yes, i was already able to reinstall with a fresh image. but now i want to at least try to restore from my disk image. so what would the procedure be to get into recoverymode and do the dd?

Well, which partitions did you backup with dd originally, I’m slightly concerned you may not have fully backed up.

Personally I’d mount the dd’d image loopback on a Linux pc (LiveCD) will do and copy files from it. You should only need to restore ./~kodi to get most of your configuration back

i backed up ALL Partitions. Unfortunately i do not have a linux pc: thats why i was asking how you can go into recovery mode to mount the partitions from a usb-disk there and copy them directly to the internal storage via dd.

i have another copy of my .kodi folder on a network drive - so those settings i am not worried about. but i did a lot of other small configurations on the linux system directly (openvpn, fstab, chronjobs, shairport …). therefor i wanted to just restore my full disk like i did it on my pi when i ran into problems …

so … looks like things seem to be more complicated on vero regarding backup und restore of full disk images.

or do you think its worth trying?

cheers
bendsch

any thoughts on this?

Sorry – busy around here.

if you backed up these partitions

/dev/boot
/dev/misc
/dev/cache
/dev/data
/dev/system

Then you can just dd them back.

Sam

ok but i guess they are busy if i ssh into the device right?

Ah I see what you’re asking now.

If you hold SHIFT during boot, then you’ll get to a console running in RAM. You can the mount the SD card or USB with the images, and dd them to the partitions. They won’t be in use.

Sam

ok looks like i backed up only 4 partitions. since the name of the partitions is missing i can not tell which is which. i did a “cd”, “ls” in each partition in the log below. can you tell me if this is enough to recover?

cheers
bendsch

osmc@osmc:~$ mount
devtmpfs on /dev type devtmpfs (rw,relatime,size=406496k,nr_inodes=101624,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /run type tmpfs (rw,relatime)
/dev/mapper/vero--nand-root on / type ext4 (rw,relatime,stripe=1024,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/bfqio type cgroup (rw,nosuid,nodev,noexec,relatime,bfqio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/mmcblk0p1 on /media/A33B-CCA1 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0111,dmask=0000,allow_utime=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,errors=remount-ro,uhelper=udisks)
/dev/mmcblk0p2 on /media/adb710b5-df09-4059-bcc3-10254d26db6b type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
/dev/mmcblk0p4 on /media/daad1f1f-f923-4387-b16a-5de6ca6e1a37 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
/dev/mmcblk0p3 on /media/2f7f579a-9586-4808-b460-27d60d93ff4a type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=81516k,mode=700,uid=1000,gid=1000)
osmc@osmc:~$ cd /media/
osmc@osmc:/media$ ls -l -a
insgesamt 25
drwxr-xr-x  6 root root 4096 Mär 18 18:11 .
drwxr-xr-x 23 root root 4096 Mär  1 22:08 ..
drwxrwxrwx 22 osmc osmc 4096 Sep  3  2016 2f7f579a-9586-4808-b460-27d60d93ff4a
drwxrwxrwx  4 osmc osmc  512 Jan  1  1970 A33B-CCA1
drwxrwxrwx 16 root root 4096 Aug 21  2016 adb710b5-df09-4059-bcc3-10254d26db6b
drwxrwxrwx  4 osmc 2001 4096 Sep  3  2016 daad1f1f-f923-4387-b16a-5de6ca6e1a37
-rw-r--r--  1 root root  232 Feb 29  2016 README
osmc@osmc:/media$ cd 2f7f579a-9586-4808-b460-27d60d93ff4a/
osmc@osmc:/media/2f7f579a-9586-4808-b460-27d60d93ff4a$ ls
app       app-lib      backup      dalvik-cache  dontpanic  local       media     misc      resource-cache  ssh     user
app-asec  app-private  bugreports  data          drm        lost+found  mediadrm  property  security        system
osmc@osmc:/media/2f7f579a-9586-4808-b460-27d60d93ff4a$ cd ..
osmc@osmc:/media$ cd A33B-CCA1/
osmc@osmc:/media/A33B-CCA1$ ls -l -a
insgesamt 7679
drwxrwxrwx 4 osmc osmc     512 Jan  1  1970 .
drwxr-xr-x 6 root root    4096 Mär 18 18:11 ..
-rw-rw-rw- 1 osmc osmc 7853256 Aug 21  2016 recovery.img
drwxrwxrwx 4 osmc osmc     512 Sep  3  2016 .Spotlight-V100
drwxrwxrwx 2 osmc osmc     512 Sep  3  2016 .Trashes
-rw-rw-rw- 1 osmc osmc    4096 Sep  3  2016 ._.Trashes
osmc@osmc:/media/A33B-CCA1$ cd ..
osmc@osmc:/media$ cd adb710b5-df09-4059-bcc3-10254d26db6b/
osmc@osmc:/media/adb710b5-df09-4059-bcc3-10254d26db6b$ ls -l -a
insgesamt 212
drwxrwxrwx 16 root root   4096 Aug 21  2016 .
drwxr-xr-x  6 root root   4096 Mär 18 18:11 ..
drwxr-xr-x  2 root root   4096 Aug 21  2016 app
drwxr-xr-x  3 root root   4096 Aug 21  2016 bin
-rw-r--r--  1 root root   8407 Aug 21  2016 build.prop
-rw-r--r--  1 root root 115057 Aug 21  2016 chksum_list
drwxr-xr-x 12 root root   4096 Aug 21  2016 etc
drwxr-xr-x  2 root root   4096 Aug 21  2016 fonts
drwxr-xr-x  3 root root   4096 Aug 21  2016 framework
drwxr-xr-x  8 root root  12288 Aug 21  2016 lib
drwx------  2 root root  16384 Aug 21  2016 lost+found
drwxr-xr-x  4 root root   4096 Aug 21  2016 media
drwxr-xr-x  2 root root   4096 Aug 21  2016 package_config
drwxr-xr-x  2 root root   4096 Aug 21  2016 priv-app
drwxr-xr-x  3 root root   4096 Aug 21  2016 tts
drwxr-xr-x  7 root root   4096 Aug 21  2016 usr
drwxr-xr-x  4 root root   4096 Aug 21  2016 vendor
drwxr-xr-x  2 root root   4096 Aug 21  2016 xbin
osmc@osmc:/media/adb710b5-df09-4059-bcc3-10254d26db6b$ cd ..
osmc@osmc:/media$ cd daad1f1f-f923-4387-b16a-5de6ca6e1a37/
osmc@osmc:/media/daad1f1f-f923-4387-b16a-5de6ca6e1a37$ ls -l -a
insgesamt 28
drwxrwxrwx 4 osmc 2001  4096 Sep  3  2016 .
drwxr-xr-x 6 root root  4096 Mär 18 18:11 ..
drwx------ 2 osmc osmc  4096 Sep  3  2016 backup
drwxrwx--- 2 root root 16384 Aug 21  2016 lost+found

I don’t think that looks correct. You seem to be missing the root partition.

The partitions are configured using LVM2, so you’d need a 1.1 backup of all of the (mentioned above) partitions for the restore to work correctly.

hi sam thx for your reply.

after an afternoon of work i was able to recuperate the system manually more or less like i had it, but now i want to make sure that i am prepared for when the next system corruption happens. question: is there somewhere a step by step guide how to correctly back up the entire system with dd?
cheers
bendsch

Back up the partitions mentioned above with dd and all should be fine