[Howto] Odroid-Backup tool - backup and restore tool

Moderators: odroid, meveric, mdrjr

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Mon Aug 14, 2017 3:54 pm

Hmm, maybe you need to start Win32Imager with administrator privileges (RunAs Administrator). Or write to a folder where your user has rights (like My Documents)
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby Quilope » Wed Aug 16, 2017 4:09 pm

Ahh, I bet you're right! I feel like I read something about that elsewhere, while reading about all this.

Hmmm, maybe I'll find some excuse to test this soon.

Mad_Ady, would you understand me if I said Blagodaria ('thank you' in Bulgarian)?
Quilope
 
Posts: 5
Joined: Fri Aug 04, 2017 1:26 pm
languages_spoken: english
ODROIDs: C2

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Wed Aug 16, 2017 4:16 pm

Bulgarian and Romanian are two very different languages, with different roots, even if the countries are neighbours. Romanian is based on latin, with some slavic influences and is closer to Italian, Spanish and French, while Bulgarian is a Slavic language with a totally different alphabet.
So, no - I would not understand that :), But you're welcome!
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby minca » Mon Oct 09, 2017 4:14 am

Hi,

1st nice work.

I've tried to use your tool, but the restored image wont boot:
- I've 2 UX4 devices and 2 eMMCs.
- 1st I've tried to update the Ubuntu, but I think I've screwed the partitions..
- I did normal Wipe of eMMC and wrote new Ubuntu from *.img file. But it won't boot. The Recovery using the Android image does not work:
viewtopic.php?f=93&t=28614

- I've umounted boot and rootfs.
- and started full eMMc backup (all partitions)

Backup log:
Code: Select all
Starting backup process
*** Starting to backup mbr ***
Error code: 0
label: dos
label-id: 0x0008aae4
device: /dev/sdb
unit: sectors

/dev/sdb1 : start=        2048, size=      262144, type=c
/dev/sdb2 : start=      264192, size=    15004673, type=83
*** Starting to backup bootloader ***
2048+0 records in
2048+0 records out
1048576 bytes (1,0 MB, 1,0 MiB) copied, 0,161917 s, 6,5 MB/s
Error code: 0
*** Bootloader backup size: 1048576 bytes ***
*** Starting to backup /dev/sdb2 ***
Statistics for filesystem 0
* files successfully processed:....regfiles=169119, directories=23320, symlinks=54170, hardlinks=35, specials=82
* files with errors:...............regfiles=0, directories=0, symlinks=0, hardlinks=0, specials=0
Error code: 0
====================== archive information ======================
Archive type:          filesystems
Filesystems count:       1
Archive id:          59dbb919
Archive file format:       FsArCh_002
Archive created with:       0.6.22
Archive creation date:       2017-10-08_19-35-14
Archive label:          <none>
Minimum fsarchiver version:   0.6.4.0
Compression level:       3 (gzip level 6)
Encryption algorithm:       none

===================== filesystem information ====================
Filesystem id in archive:    0
Filesystem format:       ext4
Filesystem label:       rootfs
Filesystem uuid:       e139ce78-9841-40fe-8823-96a304a09859
Original device:       /dev/sdb2
Original filesystem size:    7.04 GB (7563059200 bytes)
Space used in filesystem:    5.59 GB (6004641792 bytes)

*** Starting to backup /dev/sdb1 ***
Partclone v0.2.86 http://partclone.org
Starting to clone device (/dev/sdb1) to image (/media/smurf/data/backup/odroid/partition_1.img)
Reading Super Block
Calculating bitmap... Please wait...
                                                                               
Elapsed: 00:00:01, Remaining: 00:01:39, Completed:   1,00%
                                                                               
Elapsed: 00:00:01, Remaining: 00:00:00, Completed: 100.00%
Total Time: 00:00:01, 100.00% completed!
done!
File system:  FAT16
Device size:  134,2 MB = 262144 Blocks
Space in use:   7,7 MB = 14972 Blocks
Free Space:   126,6 MB = 247172 Blocks
Block size:   512 Byte

                                                                               
Elapsed: 00:00:01, Remaining: 00:01:39, Completed:   1,00%,   0,00byte/min,

                                                                               
current block:          0, total block:     262144, Complete:   0,00%

                                                                               
Elapsed: 00:00:02, Remaining: 00:00:00, Completed: 100.00%, Rate: 229,97MB/min,

                                                                               
current block:     262144, total block:     262144, Complete: 100.00%
Total Time: 00:00:02, Ave. Rate:  230,0MB/min, 100.00% completed!
Syncing... OK!
Partclone successfully cloned the device (/dev/sdb1) to the image (/media/smurf/data/backup/odroid/partition_1.img)
Cloned successfully.
Error code: 0
Partclone v0.2.86 http://partclone.org
Display image information
File system:  FAT16
Device size:  134,2 MB = 262144 Blocks
Space in use:   7,7 MB = 14972 Blocks
Free Space:   126,6 MB = 247172 Blocks
Block size:   512 Byte


- after it I've connected the "bad" EmmC and tried to write the backup.
- but it won't start up.
Restore log

Code: Select all
Starting restore process
*** Restoring MBR ***
Checking that no-one is using this disk right now ... OK

Disk /dev/sdb: 7,3 GiB, 7818182656 bytes, 15269888 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: 0x0008aae4

Old situation:

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sdb1         2048   264191   262144  128M  c W95 FAT32 (LBA)
/dev/sdb2       264192 15268864 15004673  7,2G 83 Linux

>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new DOS disklabel with disk identifier 0x0008aae4.
Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 128 MiB.
/dev/sdb2: Created a new partition 2 of type 'Linux' and of size 7,2 GiB.
/dev/sdb3:
New situation:

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sdb1         2048   264191   262144  128M  c W95 FAT32 (LBA)
/dev/sdb2       264192 15268864 15004673  7,2G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
Error code: 0
/dev/sdb: msdos partitions 1 2
*** Restoring Bootloader ***
2047+0 records in
2047+0 records out
1048064 bytes (1,0 MB, 1,0 MiB) copied, 1,08962 s, 962 kB/s
Error code: 0
*** Restoring Bootstrap code ***
1+0 records in
1+0 records out
446 bytes copied, 0,0211408 s, 21,1 kB/s
Error code: 0
*** Restoring Partition 1 ***
Partclone v0.2.86 http://partclone.org
Starting to restore image (/media/smurf/data/backup/odroid/partition_1.img) to device (/dev/sdb1)
Calculating bitmap... Please wait... done!
File system:  FAT16
Device size:  134,2 MB = 262144 Blocks
Space in use:   7,7 MB = 14972 Blocks
Free Space:   126,6 MB = 247172 Blocks
Block size:   512 Byte

                                                                               
Elapsed: 00:00:01, Remaining: 00:01:39, Completed:   1,00%,   0,00byte/min,

                                                                               
current block:          0, total block:     262144, Complete:   0,00%

                                                                               
Elapsed: 00:00:02, Remaining: 00:00:00, Completed: 100.00%, Rate: 229,97MB/min,

                                                                               
current block:     262144, total block:     262144, Complete: 100.00%
Total Time: 00:00:02, Ave. Rate:  230,0MB/min, 100.00% completed!
Syncing... OK!
Partclone successfully restored the image (/media/smurf/data/backup/odroid/partition_1.img) to the device (/dev/sdb1)
Cloned successfully.
Error code: 0
*** Restoring Partition 2 ***
Statistics for filesystem 0
* files successfully processed:....regfiles=169119, directories=23320, symlinks=54170, hardlinks=35, specials=82
* files with errors:...............regfiles=0, directories=0, symlinks=0, hardlinks=0, specials=0
Error code: 0


Can you pls help, Am I doing something wrong?
minca
 
Posts: 29
Joined: Fri Oct 06, 2017 5:23 am
languages_spoken: english
ODROIDs: xu4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Mon Oct 09, 2017 3:10 pm

So - it's not clear for me - is the source emmc working? Is it booting normally? I can't see anything wrong from the output for your backup/restore process. The second emmc should behave like the first one.
Make sure both emmcs are "red" emmcs, because black ones can't boot on the XU4. Also, try to recover the hidden sectors on the emmc which are used in the XU4 boot process, but are not touched by the backup/restore script: https://wiki.odroid.com/accessory/emmc/recovery_xu4
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby minca » Mon Oct 09, 2017 4:32 pm

mad_ady wrote:So - it's not clear for me - is the source emmc working? Is it booting normally? I can't see anything wrong from the output for your backup/restore process. The second emmc should behave like the first one.
Make sure both emmcs are "red" emmcs, because black ones can't boot on the XU4. Also, try to recover the hidden sectors on the emmc which are used in the XU4 boot process, but are not touched by the backup/restore script: https://wiki.odroid.com/accessory/emmc/recovery_xu4


Hi Yes, the Source eMMc (both are red) is from the 2nd device with old Ubuntu 14.x and that boots correctly.

the Recovery Process does not work for me:

- after start the Blue and Red leds are ON for like 15 sec and after it, the Blue goes off, no "flashing like a heartbeat" - also the Cooler stops.
- after removing the PSU, removing the SD and switching to Emmc Boot, the Odroid won't start..only Red LED is On, even when I try to press the power button, nothing happens
minca
 
Posts: 29
Joined: Fri Oct 06, 2017 5:23 am
languages_spoken: english
ODROIDs: xu4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Mon Oct 09, 2017 4:48 pm

Hmm, I take it the emmc will not boot a freshly written stock image as well, right? You should open a new thread asking for support for the recovery tool. Once that is fixed, you can retry the restore process.
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby minca » Mon Oct 09, 2017 5:23 pm

mad_ady wrote:Hmm, I take it the emmc will not boot a freshly written stock image as well, right? You should open a new thread asking for support for the recovery tool. Once that is fixed, you can retry the restore process.


nope it won't, if I understod correctly there is no "normal" way to install new Ubuntu to Emmc (I've tryed as 1st):

I just wrote the new Ubuntu image "ubuntu-16.04.3-4.9-mate-odroid-xu4-20170824.img" using Etcher.
Also tried it from Linux PC using:

Code: Select all
dd if=ubuntu-16.04.3-4.9-mate-odroid-xu4-20170824.img of=/dev/sdb/ bs=1M


that didn't work...so here I am now :)
minca
 
Posts: 29
Joined: Fri Oct 06, 2017 5:23 am
languages_spoken: english
ODROIDs: xu4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Mon Oct 09, 2017 5:37 pm

That's the correct way to do it, but if it doesn't boot then the hidden sectors (there are 2 4MB blocks exposed as /dev/mmcblk0boot0 and boot1) which are not overwritten during normal flashing procedures need to be fixed. The only way I know of to write them is with that procedure in the wiki. If it still doesn't work for you, only @odroid can help.
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby minca » Mon Oct 09, 2017 5:52 pm

mad_ady wrote:hidden sectors

u know, are/should they be visible on Linux "lsblk" ? because i can see only 2 /boot/ and /rootfs/
minca
 
Posts: 29
Joined: Fri Oct 06, 2017 5:23 am
languages_spoken: english
ODROIDs: xu4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Mon Oct 09, 2017 7:53 pm

They are not mounted. They are visible in /dev. You could try to copy and write to them with dd, but I don't know if it would work.
Code: Select all
odroid@xu4-dev:/DataVolume> ls -l /dev/mmcblk0*
brw-rw---- 1 root disk 179,  0 Sep 26 09:33 /dev/mmcblk0
brw-rw---- 1 root disk 179, 16 Sep 26 09:33 /dev/mmcblk0boot0
brw-rw---- 1 root disk 179, 32 Sep 26 09:33 /dev/mmcblk0boot1
brw-rw---- 1 root disk 179,  1 Sep 26 09:33 /dev/mmcblk0p1
brw-rw---- 1 root disk 179,  2 Sep 26 09:33 /dev/mmcblk0p2
brw-rw---- 1 root disk 179, 48 Sep 26 09:33 /dev/mmcblk0rpmb
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby minca » Mon Oct 09, 2017 9:23 pm

mad_ady wrote:They are not mounted. They are visible in /dev. You could try to copy and write to them with dd, but I don't know if it would work.
Code: Select all
odroid@xu4-dev:/DataVolume> ls -l /dev/mmcblk0*
brw-rw---- 1 root disk 179,  0 Sep 26 09:33 /dev/mmcblk0
brw-rw---- 1 root disk 179, 16 Sep 26 09:33 /dev/mmcblk0boot0
brw-rw---- 1 root disk 179, 32 Sep 26 09:33 /dev/mmcblk0boot1
brw-rw---- 1 root disk 179,  1 Sep 26 09:33 /dev/mmcblk0p1
brw-rw---- 1 root disk 179,  2 Sep 26 09:33 /dev/mmcblk0p2
brw-rw---- 1 root disk 179, 48 Sep 26 09:33 /dev/mmcblk0rpmb


is this visible from a PC ? or just from Odroid? (I'm able to boot from SD-card)
minca
 
Posts: 29
Joined: Fri Oct 06, 2017 5:23 am
languages_spoken: english
ODROIDs: xu4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Mon Oct 09, 2017 9:37 pm

It's visible from the Odroid. You could add the emmc and boot from SD card and run ls -l /dev/mmcblk*. If you boot from SD mmcblk0 will probably be the SD card and mmcblk1 will be the emmc.
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby minca » Tue Oct 10, 2017 12:07 am

ok so now i can see:

Code: Select all
/dev/mmcblk1
/dev/mmcblk1p1
/dev/mmcblk1p2


hmm dunno now? should i try it?
@Odroid what do you think ?
minca
 
Posts: 29
Joined: Fri Oct 06, 2017 5:23 am
languages_spoken: english
ODROIDs: xu4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Tue Oct 10, 2017 12:54 am

That's not the same thing. Can you check mmcblk0 as well? You're looking for the boot0 and boot1 devices
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby minca » Tue Oct 10, 2017 1:15 am

mad_ady wrote:That's not the same thing. Can you check mmcblk0 as well? You're looking for the boot0 and boot1 devices

you're right, no so I can't see the eMMC, it's probably not accessible due the boot switch...
minca
 
Posts: 29
Joined: Fri Oct 06, 2017 5:23 am
languages_spoken: english
ODROIDs: xu4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Tue Oct 10, 2017 2:34 pm

No, the boot switch just controls the boot. The emmc should be readable just like a normal storage device after boot. Is it still hot?
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby minca » Tue Oct 10, 2017 8:48 pm

mad_ady wrote:No, the boot switch just controls the boot. The emmc should be readable just like a normal storage device after boot. Is it still hot?

nope, only when I write to it from PC (card reader)
minca
 
Posts: 29
Joined: Fri Oct 06, 2017 5:23 am
languages_spoken: english
ODROIDs: xu4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby Technicavolous » Fri Nov 03, 2017 1:08 am

Looking forward to using the tool, but my drives look a little different than the guide, so I thought I'd ask before plowing forward ... beginning to like this particular setup so I want to back it up.

Should this be done on a 'live' system, or should I boot from SD and backup the eMMC not having booted from it?

Booting from the eMMC and running the tool with -a shows me partitions instead of drives,
Screenshot from 2017-11-02 11-40-37.png
eMMC shows the different partitions?
Screenshot from 2017-11-02 11-40-37.png (57.15 KiB) Viewed 2482 times

but the external SSD shows as SDA ...
Screenshot from 2017-11-02 11-52-38.png
SSD Shows as SDA
Screenshot from 2017-11-02 11-52-38.png (63.93 KiB) Viewed 2482 times

So should I continue or do I have an issue?

Am I just being dumb and missing a step?

Thanks ;]

.
What box?
Technicavolous
 
Posts: 53
Joined: Mon May 30, 2016 12:17 pm
Location: Howey In The Hills, FL
languages_spoken: Southern US English
ODROIDs: :

XU4 -> CloudShell, BoomBonnet,
eMMC64/Ubuntu
eMMC16/Armbian

C2 -> VU7, HiFiShield2
SD/Ubuntu
eMMC16/Armbian

HC1 -> http://ww2.tech-party.us
SD/Ubuntu
SD/Armbian
.

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Fri Nov 03, 2017 3:39 am

You can do a live backup, ideally on an idle system. The problem is that open files with unflushed buffers may be backed-up incompletely. In my case I haven't experienced it, so you can try it.

Regarding disks vs partitions: what you listed are disks. loop0 can have partitions, but it's a disk. Zram is also a "disk". The emmc has a couple hidden sections (mmcblk0boot0/1) which behave like disks. This tool does not backup/restore those. If you select mmcblk0 on the next screen you will be presented with the partitions (and mbr/uboot sections).

So go ahead. A backup has no risk.
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby Technicavolous » Fri Nov 03, 2017 4:29 am

I guess I'm learning the difference between backup and image ... I'm spoiled by the other boards I have where I can build a system that works and make an 'image' of that system for my friends or as a restore point during experimentation. I dig this eMMC and I would like to do the same with it. But I also have this particular desktop coming together nicely and a true backup as you've made is perfect for this. Plus I want to do as much as I can from this XU4 as I've adopted it as my new desktop.

Every now and then I have to re-learn the lesson of the right tool for the right job ...

Backed up and restored without problems to my attached SSD. Cool tool!

.
What box?
Technicavolous
 
Posts: 53
Joined: Mon May 30, 2016 12:17 pm
Location: Howey In The Hills, FL
languages_spoken: Southern US English
ODROIDs: :

XU4 -> CloudShell, BoomBonnet,
eMMC64/Ubuntu
eMMC16/Armbian

C2 -> VU7, HiFiShield2
SD/Ubuntu
eMMC16/Armbian

HC1 -> http://ww2.tech-party.us
SD/Ubuntu
SD/Armbian
.

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Tue Nov 07, 2017 8:37 pm

I've updated the first post with this information:

Known limitations
If you backup an emmc for XU3/4, the hidden sectors (/dev/mmcblk0boot0, /dev/mmcblk0boot1) are not backed-up/restored. These blocks contain parts of the UBoot loader. When restoring a backup on an SD card or on a new eMMC, the board might boot with an older UBoot version (stored before the first partition). As a result of this the UBoot environment might be incomplete (e.g. there is no ${board_name} set), and booting might be different than normal. Once you do boot it is recommended that you reinstall uboot with this command on the new card:
Code: Select all
$ sudo apt-get install --reinstall uboot

Details in this thread: viewtopic.php?f=95&t=28950
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby biru585 » Sat Dec 09, 2017 12:15 am

Hi,
i tried (again) to perform a backup with your tool, seemed to work great but then reading the output i found out that the last part the partcloned failed to reach the output directory.
Code: Select all
Starting backup process
*** Starting to backup mbr ***
Error code: 0
label: dos
label-id: 0xd3630000
device: /dev/mmcblk0
unit: sectors

/dev/mmcblk0p1 : start=        2048, size=      262144, type=c
/dev/mmcblk0p2 : start=      264192, size=    60805121, type=83
*** Starting to backup bootloader ***
2048+0 records in
2048+0 records out
1048576 bytes (1,0 MB, 1,0 MiB) copied, 0,356403 s, 2,9 MB/s
Error code: 0
*** Bootloader backup size: 1048576 bytes ***
*** Starting to backup /dev/mmcblk0p2 ***
Statistics for filesystem 0
* files successfully processed:....regfiles=146587, directories=17575, symlinks=59077, hardlinks=29, specials=86
* files with errors:...............regfiles=0, directories=0, symlinks=0, hardlinks=0, specials=0
Error code: 0
====================== archive information ======================
Archive type:          filesystems
Filesystems count:       1
Archive id:          5a206f94
Archive file format:       FsArCh_002
Archive created with:       0.6.22
Archive creation date:       2017-12-08_15-50-55
Archive label:          <none>
Minimum fsarchiver version:   0.6.4.0
Compression level:       3 (gzip level 6)
Encryption algorithm:       none

===================== filesystem information ====================
Filesystem id in archive:    0
Filesystem format:       ext4
Filesystem label:       rootfs
Filesystem uuid:       e139ce78-9841-40fe-8823-96a304a09859
Original device:       /dev/mmcblk0p2
Original filesystem size:    28.54 GB (30643646464 bytes)
Space used in filesystem:    5.31 GB (5698514944 bytes)

*** Starting to backup /dev/mmcblk0p1 ***
Partclone v0.2.86 http://partclone.org
Starting to clone device (/dev/mmcblk0p1) to image (/media/odroid/0123-4567/partition_1.img)
device (/dev/mmcblk0p1) is mounted at /media/boot
error exit
Partclone fail, please check /var/log/partclone.log !
Error code: 0
Partclone v0.2.86 http://partclone.org
Display image information
info: Can't open file(/media/odroid/0123-4567/partition_1.img)
Partclone fail, please check /var/log/partclone.log !

Can you guys help me?
Sorry for my English
biru585
 
Posts: 26
Joined: Thu May 12, 2016 4:33 pm
languages_spoken: Italian, english
ODROIDs: C2

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Sat Dec 09, 2017 1:50 am

Yes. partclone can't backup mounted vfat partitions, so you must unmount it before doing the backup.
Try this:
Code: Select all
sudo umount /media/boot
... run the backup as usual, but select only the vfat partition (no need to redo the rest)
sudo mount /media/boot


I need to revisit the script because it can't get the correct error code on failure, and maybe add a warning/check for mounted vfat partitions.
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby aunlead » Thu Dec 21, 2017 5:33 pm

Any way we can run backup tool via cron job?
aunlead
 
Posts: 3
Joined: Mon Jun 20, 2016 3:52 pm
languages_spoken: english
ODROIDs: Odroid C2

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Thu Dec 21, 2017 5:43 pm

At this point, no because it is interactive. I wanted to revisit it to make it scriptable, but this was not its original purpose. In theory you can do the same things the app does (since it's just a frontend for some programs):
1. dd the MBR + bootloader into a file
Code: Select all
$ sudo sfdisk -d /dev/mmcblk0 > $backupDir/partition_table.txt
$ sudo dd if=/dev/mmcblk0 of=$backupDir/bootloader.bin bs=512 count=49151

2. Use partclone to backup the vfat partition
Code: Select all
$ sudo umount /media/boot
$ sudo partclone.vfat -c -s /dev/mmcblk0p1 -O $backupDir/partition_1.img
$ sudo mount /media/boot

3. Backup the ext4 partition
Code: Select all
$ sudo fsarchiver -o -v -A -j 4 savefs $backupDir/partition_2.fsa /dev/mmcblk0p2
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby aunlead » Fri Dec 22, 2017 2:17 am

mad_ady wrote:At this point, no because it is interactive. I wanted to revisit it to make it scriptable, but this was not its original purpose. In theory you can do the same things the app does (since it's just a frontend for some programs):
1. dd the MBR + bootloader into a file
Code: Select all
$ sudo sfdisk -d /dev/mmcblk0 > $backupDir/partition_table.txt
$ sudo dd if=/dev/mmcblk0 of=$backupDir/bootloader.bin bs=512 count=49151

2. Use partclone to backup the vfat partition
Code: Select all
$ sudo umount /media/boot
$ sudo partclone.vfat -c -s /dev/mmcblk0p1 -O $backupDir/partition_1.img
$ sudo mount /media/boot

3. Backup the ext4 partition
Code: Select all
$ sudo fsarchiver -o -v -A -j 4 savefs $backupDir/partition_2.fsa /dev/mmcblk0p2


Thanks @mad_ady. This is much simpler to automate.
aunlead
 
Posts: 3
Joined: Mon Jun 20, 2016 3:52 pm
languages_spoken: english
ODROIDs: Odroid C2

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Fri Dec 22, 2017 3:29 pm

The best part is if you keep the naming convention you can restore with the gui version :)
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Tue Jan 23, 2018 11:17 pm

Small update to the code with the following two fixes:
1. Create backup directory if it doesn't exist (you could create a directory with the text version)
2. Report the correct exit code from the shell commands (it used to report 0 for every command)
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Fri Apr 20, 2018 10:40 pm

Update: I've added support for the upcoming Odroid N1 Flash SPI which stores bootloader, kernel and possibly boot.ini. I also documented this in the first post.
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mrperfekotne » Thu Jun 07, 2018 4:34 am

I have downloaded your program and will backup my emmc. Can I use the backup that I made from my emmc card to an SD card in case of my emmc error :)?
mrperfekotne
 
Posts: 76
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Thu Jun 07, 2018 4:58 am

Yes! Which odroid/emmc color?
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mrperfekotne » Thu Jun 07, 2018 5:10 am

I have made an ubuntu live (usb boot) as I booted on a laptop to run your backup program :) But when I run on ubuntu live:

$ sudo apt-get install libui-dialog-perl zenity dialog libnumber-bytes-human-perl libjson-perl fsarchiver udev util-linux coreutils partclone parted




Will I get :

E: Unable to locate package libui-dialog-perl
E: Package 'dialog' has no installation candidate
E: Unable to locate package libnumber-bytes-human-perl
E: Package 'libjson-perl' has no installation candidate
E: Unable to locate package fsarchiver
E: Unable to locate package partclone




why ? - The emmc is red 16 gb :)
mrperfekotne
 
Posts: 76
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Thu Jun 07, 2018 2:41 pm

I haven't tried it on a livecd. What is the ubuntu version? Have you run sudo apt-get update before?
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mrperfekotne » Thu Jun 07, 2018 5:31 pm

I just tried to run "sudo apt-get update" on an ubuntu live but I still get:

E: Unable to locate package libui dialog-perl
E: Package 'dialog' has no installation candidate
E: Unable to locate package libnumber-bytes-human-perl
E: Package 'libjson-perl' has no installation candidate
E: Unable to locate package fsarchiver
E: Unable to locate package partclone

It would be nice if it works on a "Live" because I have a windows machine laptop and therefore can not backup Emmc in another machine since I do not have a Linux machine :)

According to your guide, it is more safe to do it on a different machine than on the server (Odroidxu4) :)
mrperfekotne
 
Posts: 76
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby tobetter » Thu Jun 07, 2018 5:35 pm

Can you check if your /etc/apt/sources.list is correct before sudo apt-get update?
User avatar
tobetter
 
Posts: 2557
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mrperfekotne » Thu Jun 07, 2018 6:12 pm

I just tried a debian live to see if ubuntu was the problem but still getting the same issues:

"E: Unable to locate package libui dialog-perl
E: Package 'dialog' has no installation candidate
E: Unable to locate package libnumber-bytes-human-perl
E: Package 'libjson-perl' has no installation candidate
E: Unable to locate package fsarchiver
E: Unable to locate package partclone "

/etc/apt/sources.list.d/base.list:


"deb http://deb.debian.org/debian/ stretch main
# deb-src http://deb.debian.org/debian/ stretch main "
mrperfekotne
 
Posts: 76
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Thu Jun 07, 2018 7:02 pm

For ubuntu you may need to enable 'universe' repo, because they are all there:
Code: Select all
Do you want to continue? [Y/n] y
Get:1 http://ro.archive.ubuntu.com/ubuntu bionic/universe amd64 dialog amd64 1.3-20171209-1 [217 kB]
Get:2 http://ro.archive.ubuntu.com/ubuntu bionic/universe amd64 fsarchiver amd64 0.8.4-1 [96.5 kB]
Get:3 http://ro.archive.ubuntu.com/ubuntu bionic/universe amd64 libcommon-sense-perl amd64 3.74-2build2 [20.3 kB]
Get:4 http://ro.archive.ubuntu.com/ubuntu bionic/universe amd64 libjson-perl all 2.97001-1 [73.3 kB]
Get:5 http://ro.archive.ubuntu.com/ubuntu bionic/universe amd64 libtypes-serialiser-perl all 1.0-1 [12.1 kB]
Get:6 http://ro.archive.ubuntu.com/ubuntu bionic/universe amd64 libjson-xs-perl amd64 3.040-1 [81.2 kB]
Get:7 http://ro.archive.ubuntu.com/ubuntu bionic/universe amd64 libnumber-bytes-human-perl all 0.11-1 [13.6 kB]
Get:8 http://ro.archive.ubuntu.com/ubuntu bionic/universe amd64 nilfs-tools amd64 2.2.6-1 [121 kB]
Get:9 http://ro.archive.ubuntu.com/ubuntu bionic/universe amd64 partclone amd64 0.3.11-1build1 [559 kB]
Fetched 1,193 kB in 11s (108 kB/s)



Check that /etc/apt/sources.list has something like (needs to match your distro and country)
Code: Select all
deb http://ro.archive.ubuntu.com/ubuntu/ bionic universe


Regarding safety to do it live - I always back up my odroids live, and haven't had an issue with it. Just make sure they're relatively idle.

Edit: It seems that libui-dialog-perl is no longer a package in 18.04 (https://packages.ubuntu.com/search?keyw ... ialog-perl). You can either try to install an older deb (for 16.04), or install it from CPAN with:
Code: Select all
sudo perl -MCPAN -e 'install UI::Dialog'
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mrperfekotne » Thu Jun 07, 2018 8:45 pm

I just make it live if you say it okay :) - Should I just back up the bootloader / emmc data partion (openmediavault) with your program - And then write the two things on an SD card if I want it to work? - It seems a bit complicated :)
mrperfekotne
 
Posts: 76
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Fri Jun 08, 2018 1:39 am

Unfortunately yes. It was not designed as a transfer program from sd to emmc, so you need to do it in two steps. A tool that does it in one step would need to use rsync
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mrperfekotne » Fri Jun 08, 2018 2:35 am

What about "Mbr" do i need to backup / flash this if i flash from Emmc ----> Sd card ?


Neither I need to flash from Emmc to Sd but it may happen that emmc becomes defective and I'm forced to switch to SD card so that's nice to know :)
mrperfekotne
 
Posts: 76
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mrperfekotne » Fri Jun 08, 2018 5:57 am

Now I've been trying to run the command:

sudo apt-get install libui-dialog-perl zenity dialog libnumber-bytes-human-perl libjson-perl fsarchiver udev util-linux coreutils partclone parted

under openmediavault on Odroid xu4 (Debian stretch) and gets the following errors:

E: Unable to locate package libui dialog-perl

It's hard when you've chosen and used some packages that are hard to get on a standard Linux installation. The idea was that it should be easy to use the program or? It's very difficult when you can not get the packages you need for it to work.
mrperfekotne
 
Posts: 76
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Fri Jun 08, 2018 3:11 pm

Well, the packages exist under Ubuntu 16.04, but you're right, they don't exist under every distro (or not with the same name). You can replace it with
Code: Select all
sudo perl -MCPAN -e 'install UI::Dialog'

I will replace it in the script as well when I get a chance.
You should backup and restore MBR as well when doing full backup/restores. If you're doing partial restores (e.g. only a partition), then don't restore MBR.
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mrperfekotne » Sun Jun 10, 2018 2:37 am

Now I have installed "Perl" from Cpan with command:

sudo perl -MCPAN -e 'install UI :: Dialog'

When I try to run

odroid-backup.pl

There is nothing in the terminal (The program does not start)
mrperfekotne
 
Posts: 76
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Sun Jun 10, 2018 2:42 am

By default it tries to use graphical windows, but it may fail. Try starting it with:
Code: Select all
 sudo ./odroid-backup.pl -a -t

to run it in text mode (ncurses).
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mrperfekotne » Sun Jun 10, 2018 5:20 am

Thanks for your good help it works now :) - Can I use "Mbr" from Emmc when I write it on a brand new SD card? - Is not nerd therefore I ask :)
mrperfekotne
 
Posts: 76
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Sun Jun 10, 2018 5:23 am

Yes. Even if the sizes are different (e.g. restoring a 16G emmc to a 8G sd) - as long as it fits, the last partition will be reduced as needed.
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mrperfekotne » Sun Jun 10, 2018 5:27 am

I have another problem :) - Once I have chosen which partitions I want to backup in your program and press ok, it says "No destination selected for backup. Program will close"

I have 2 hardrive connected to my odroid xu4 in cloudshell 2 that I would like to choose and backup to. But I'm not able to choose them?
mrperfekotne
 
Posts: 76
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mad_ady » Sun Jun 10, 2018 2:45 pm

Which os are you running? Under debian I've noticed this as well, but I don't remember if under text mode or gui. The problem is that debian's zenity module doesn't implement the file select dialog, while it works under ubuntu. I don't remember how I worked around it, but I'll look into it. For now, if you ran the program in gui mode, run it in text mode and viceversa.
User avatar
mad_ady
 
Posts: 4890
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [Howto] Odroid-Backup tool - backup and restore tool

Unread postby mrperfekotne » Mon Jun 11, 2018 3:35 am

In run:

"ARMBIAN 5.38 stable Debian GNU / Linux 9.4 (stretch)"

I can not run the program in Gui mode when I have no desktop because it's a headless server with terminal?
mrperfekotne
 
Posts: 76
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4

PreviousNext

Return to Ubuntu (All Linux'es)

Who is online

Users browsing this forum: No registered users and 4 guests