Backup whole osmc system (not just kodi settings)/ Acess internal storage

My prefered way to backup the whole os would be with the program/script rsnapshot, using rsnyc command.
Why no image? Because rsync can backup a running system, dd for example backs up whole storage also unused part…etc…

So I think things I have to figure out are:

  • How to access the 8GB internal storage from outside, in order to restore a backup (in case I have to)
  • How is everything partitioned, how many partitions, which file system(s?)

parted -l gives me this:

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/vero–nand-root: 7181MB
Sector size (logical/physical): 512B/524288B
Partition Table: loop
Disk Flags:

Number Start End Size File system Flags
1 0,00B 7181MB 7181MB ext4

Error: /dev/boot: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/boot: 33,6MB
Sector size (logical/physical): 512B/524288B
Partition Table: unknown
Disk Flags:

Error: /dev/data: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/data: 5562MB
Sector size (logical/physical): 512B/524288B
Partition Table: unknown
Disk Flags:

Error: /dev/logo: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/logo: 33,6MB
Sector size (logical/physical): 512B/524288B
Partition Table: unknown
Disk Flags:

Error: /dev/misc: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/misc: 33,6MB
Sector size (logical/physical): 512B/524288B
Partition Table: unknown
Disk Flags:

Error: /dev/cache: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/cache: 528MB
Sector size (logical/physical): 512B/524288B
Partition Table: unknown
Disk Flags:

Error: /dev/system: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/system: 1074MB
Sector size (logical/physical): 512B/524288B
Partition Table: unknown
Disk Flags:

Error: /dev/recovery: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/recovery: 33,6MB
Sector size (logical/physical): 512B/524288B
Partition Table: unknown
Disk Flags:

Okay, so now I know that internal storage is mounted at /dev/mapper/vero-nand-root…
I don’t know what partition table: loop means. But filesystem is ext4.
But all the errors?.. Counting it, does it mean that there are 7 partitions in /dev/mapper/vero-nand-root??
If so which fs are they?

And how would I go about restoring a backup? Backing everything up is easy i guess…I would run rsync with source /

It’s a lot simpler picture if you use fdisk -l:

[code]osmc@VeroB:~$ fdisk -l

Disk /dev/mmcblk0: 7.2 GiB, 7751073792 bytes, 15138816 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00061a6a

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 499711 497664 243M c W95 FAT32 (LBA)
/dev/mmcblk0p2 501760 15138815 14637056 7G 83 Linux

[/code]

and use the mount command to show how and where things are mounted
I don’t know what it means when the parted entry shows loop - but perhaps that is connected to mounting a filesystem as ‘loop’ which is done with things like isos (IIRC)
Derek

Ok, fdisk -l isn’t less confusing for me as a beginner:

Disk /dev/cache: 504 MiB, 528482304 bytes, 1032192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 524288 bytes
I/O size (minimum/optimal): 524288 bytes / 524288 bytes
Disk /dev/logo: 32 MiB, 33554432 bytes, 65536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 524288 bytes
I/O size (minimum/optimal): 524288 bytes / 524288 bytes
Disk /dev/recovery: 32 MiB, 33554432 bytes, 65536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 524288 bytes
I/O size (minimum/optimal): 524288 bytes / 524288 bytes
Disk /dev/misc: 32 MiB, 33554432 bytes, 65536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 524288 bytes
I/O size (minimum/optimal): 524288 bytes / 524288 bytes
Disk /dev/boot: 32 MiB, 33554432 bytes, 65536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 524288 bytes
I/O size (minimum/optimal): 524288 bytes / 524288 bytes
Disk /dev/system: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 524288 bytes
I/O size (minimum/optimal): 524288 bytes / 524288 bytes
Disk /dev/sda: 2,7 TiB, 3000592982016 bytes, 732566646 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x9fefb129

I guess i will have to install osmc on a spare microsd card and try it out.
Maybe it would be possible to fresh install osmc on internal storage, reformat the root partition and then restore a backup. What do you think?

I really don’t wanna start setting up my vero2 without scheduled backups.
Kodi backup is nice but will just be a smal piece of my final os cake.:slightly_smiling:

Dan missed that you have a Vero2 and not Vero1 (which his output was from).
The NAND setup of the Vero2 is quite complicated to allow for the best support. I would not mess around with it but wait till Sam has introduce the OSMC Cloud which I believe will allow you backups and restore via SD.

Should work, if you have a full backup with the right permissions (e.g. tar).

The internal 8GB nand storage on the Vero 2 is divided into a number of physical block devices at the kernel driver level, these /dev devices are boot, cache, data, logo, misc, recovery and system. The linux kernel is stored on /dev/boot.

The root file system is ext4 however it is an lvm2 logical volume at /dev/vero-nand/root which uses data, misc, cache and system block devices as the underlying storage to create one large logical volume which is formatted as ext4. There is only the one partition.

You should not try to access or write to any of the underlying block devices directly or you will almost certainly corrupt your system.

Not sure what you mean by “from outside” - the nand chip is soldered to the motherboard and can only be accessed by booting the device. And the only way to boot it is to either boot from the nand or boot from the SD card slot. (Like the installer image does)

Booting from the SD card to access the nand is possible (after all the installer image does so) but requires a kernel custom compiled to boot from SD and manually copying an existing install’s root file system to the SD card. We don’t have any automated tools to do so and aren’t planning to make any as far as I know.

Cloud as in “all my personal data is stored on a server somewhere in the world?” :unamused:
What if something breaks my system in the meantime?
…I guess a image backup with dd should work as temporary solution, right?

Planning to use rsync, as stated.

So one last question: How can I access the internal storage of vero2? Maybe I read over this…can’t find how to. Is it possible using a usb type a to type a cable? I read theres an otg usb port, which one is it?

Omg, it’s all Greek to me…

How can you guys sell a device its storage is virtually unaccessible, backupable and restoreable for a beginner??!
I mean I get that the vero2 is mainly a kodi/android mediaplayer. But it would be a pitty just to use it for this only. I think its way overpowered for this.

:cry: I’m so sad right now…honestly.

I mean you state: “Yes, osmc has all debian packages, you can install and use all of them. But you’ll never be able back your system up in an easy and private (not via cloud and server) way.”

I honestly don’t understand your point of view here, you say:

How is it un-backupable ? We even provide a backup function within My OSMC to back up your Kodi configuration and restore it from a backup.

While the system is working you can use any backup approach you like, (including rsync that you mentioned in your first post) apart from removing an SD card and backing that up on another system, which you obviously can’t do because it doesn’t (normally) boot from an SD card but from internal storage.

This is no different from a host of other devices such as a Fire TV, Apple TV or so on.

It’s true that doing a “bare metal” restore of a full system image backup would be more challenging because the device does not normally boot from an SD card, however in general you are better to do a fresh install then restore your data than trying to do a full low level restore anyway. This is no more difficult than any other device, so I fail to see what your issue is.

Just do a fresh install with the downloadable installer then use the My OSMC restore function to restore a previous Kodi backup from an SD card, USB drive or across the network.

As i stated I want to backup whole osmc not just the few settings made in kodi.

Kodi is a media center application and OSMC is the operating system that runs Kodi and brings it to your device. OSMC is not a fork of Kodi but rather a Linux distribution that ships Kodi as the main application.
This is a similar concept to Kodi running on top of Windows or Android. OSMC is based on Debian Jessie (a flavour of GNU/Linux) and has been heavily optimised to provide the best TV experience possible.

This is from the faq section. I want to know how I can restore a previous rsync backup of the operating system, Linux Distribution called osmc on vero2s internal storage.
I don’t want to know how to just backup and restore settings of one application (kodi) of osmc.
I cannot be clearer than this, I tried my best.

Then plugin a USB drive or SD card and set up rsync and cron to do regular backups

rsync is a filesystem utility, not a block level one like dd, so you should not be using fdisk etc to perform a backup, you should just be specifying directories you wish to back up

I did, now how do I restore it?.. i would have to format internal storage first, no?

Reinstall as you normally would

And the use rsync to restore your changes

Remember the proper way to backup things like installed packages in Debian is to use dpkg get selections rather than dd

Did this once on hummingboard running archlinux. I ended up having all files and directories twice and unbootable system.
Did I miss an option in rsync when restoring? Im sorry to bother you guys with probably basic stuff for you but I remember googling for this an didn’t found much more than “just use same rsync command like when backing up”.
After having several fs errors and unbootable systems after upgrading uboot or so, I learned to appreciate a good and up to date backup of everything.

Reading the rsync man page will probably heed some advice. The best advice would be: what do you want to backup and keep in the event of something going wrong?

Things like U-Boot are hidden away from you – it’s a consumer device, and you shouldn’t update the bootloader. We handle that sort of thing for you via updates.

Sam

That’s nice.

Well…custom scripts, edited config files, installed programs, program settings, changed .service files, setup timers, autostarts, etc… and of couse backup has to be possible during the system is running.
I thought rsync is commonly used for such backups.

So how do i actually make a fresh install of osmc on vero2s internal storage??
In the windows version of osmc installer I see options where to install osmc USB Stick, NFS Share, internal storage, but I can’t choose any other option than sd card. Tried to run the installer as admin aswell.
Can osmc be run from an sd card on vero2? Would this be the “install on an sd card option do”?

All of these can be backed up via rync.

Same way you do any OSMC supported device. See osmc.tv/download. dd is also your friend (just grab an IMG from the OSMC site) for the more advanced users.

Sam

is there a good thread that descriebs how to do this with a script?
the only thing i found is this one: [How to] Make periodic backups of whole OSMC system - #28 by grahamh. but it does not seem there is a good solution yet.
is it possible to rsync all the needed partitions while osmc is up and running or would certain ressources be busy while running osmc and kodi?

cheers bendsch

What do you find missing from my ‘solution’? Apart from a script to walk you through the restore process. And I haven’t had the opportunity to see how it might work on Vero.

i solved this with a very simple script that makes a dd of all the needed partitions on a mounted device:
it backups up the partitions and tars them. afterwards the img files are deleted.

#!/bin/bash
 DATE=$(date +%F)
 FOLDER=/your_mount/vero-${DATE}
 mkdir ${FOLDER}
 chmod 777 ${FOLDER}
 dd if=/dev/boot of=${FOLDER}/boot.img
 dd if=/dev/misc of=${FOLDER}/misc.img
 dd if=/dev/cache of=${FOLDER}/cache.img
 dd if=/dev/data of=${FOLDER}/data.img
 dd if=/dev/system of=${FOLDER}/system.img
 tar czf  ${FOLDER}.tar ${FOLDER}
 rm -R ${FOLDER}

i think about making a cron-job for the script that runs once a month.

i have not tried to restore from the backup yet but according to sam the mentioned partitions is all you need to get your system back.

hope this is useful to anyone else …
cheers

I don’t think that’s a good solution. The Vero2 is using LVM and you need to look back at @DBMandrake’s #5 post: