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

mrperfekotne
Posts: 128
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4
Has thanked: 0
Been thanked: 1 time
Contact:

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

Unread post by mrperfekotne » Sun Sep 30, 2018 4:59 pm

Yes but I have not mounted it since the partition "mmcblk1p2" is a completely new partition that is being created during recovery with your script :/ -

Which you can also see in the log - Therefore, I do not understand openmediavault mount it :)

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Sun Sep 30, 2018 6:48 pm

Maybe omv has an automount feature? I mount it only if I need to

oddulf
Posts: 10
Joined: Mon Nov 12, 2018 8:42 pm
languages_spoken: english, swedish
ODROIDs: C1+, XU4Q
Has thanked: 0
Been thanked: 0
Contact:

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

Unread post by oddulf » Tue Nov 13, 2018 7:54 pm

Hi, thank you for such a good summary on cloning and backup odroids!

When I first run odroid-backup.pl I get

Code: Select all

root@kir1:~# odroid-backup.pl
Can't call method "msgbox" on an undefined value at /usr/local/bin/odroid-backup.pl line 936.
I started installing the dependencies, but it fails with

Code: Select all

root@kir1:~# apt install libui-dialog-perl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libui-dialog-perl
Since you said the program does a self-check on startup, I'd thought I won't go searching for PPAs until it tells me to.

Odroid C1+, eMMC 8GB, official Ubuntu 18.04.01 minimal

Many thanks!
Ulf

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Tue Nov 13, 2018 8:40 pm

Ubuntu 18.04 dropped the libui-dialog-perl package. If you update the odroid-backup script with the latest git version it will tell you need to install "UI::Dialog" from CPAN instead.
Try

Code: Select all

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

oddulf
Posts: 10
Joined: Mon Nov 12, 2018 8:42 pm
languages_spoken: english, swedish
ODROIDs: C1+, XU4Q
Has thanked: 0
Been thanked: 0
Contact:

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

Unread post by oddulf » Fri Nov 16, 2018 12:00 am

Thank you! - worked a treat on my Linux PC - will install it on the odroid too when the card is back in its place.

Apologies for the late reply - didn't get an email notification about your response...

ulfben
Posts: 109
Joined: Thu Jul 20, 2017 11:56 pm
languages_spoken: english
ODROIDs: XU4Q
Has thanked: 0
Been thanked: 1 time
Contact:

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

Unread post by ulfben » Mon Jan 28, 2019 9:07 pm

I just did a fresh install from the github master, following the instructions there. Two observations: it seems the dependencies listed isn't quite complete, and the interactive console GUI shuts down instead of letting me select an output folder.

The dependencies listed on github says:

Code: Select all

$ sudo apt-get install zenity dialog libnumber-bytes-human-perl libjson-perl fsarchiver udev util-linux coreutils partclone parted
$ sudo perl -MCPAN -e 'install UI::Dialog'
Which leaves out mtd-utils? Running the script with no arguments (or just --backup) provided no output, until I ran it with --text, at which point the (ncurses?) GUI rendered and told me what was missing.

So dumping diagnostics / help text to console by default would help, I think.

Currently running a test backup. Thanks for putting this together!

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Mon Jan 28, 2019 9:11 pm

Yes, mtd-utils was added later (indended for N1 with a SPI flash chip). Sadly, GUI and text are both a bit problematic on recent ubuntu distros because of some problems with the libraries I'm using. Might need a redesign/rewrite.

User avatar
emk2203
Posts: 41
Joined: Fri Oct 16, 2015 12:29 am
languages_spoken: english, german
ODROIDs: C1+, C2, XU4, HC1, HC2, N2
Has thanked: 1 time
Been thanked: 0
Contact:

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

Unread post by emk2203 » Wed Mar 13, 2019 9:32 pm

With the --text setting, I cannot restore a backup.

The menu says that I should select a directory, but whenever I press RETURN even after trying to select the NEXT button with TAB, the only action happening is that the directory opens.

When I try to select the /. entry there, I get a log of the backup process displayed in ncurses, but no restore action.

When I try to use command line only with

Code: Select all

root@XU4CS2T:/srv/samba/Stick60G/eMMC_backup# odroid-backup.pl --restore --disk mmcblk0 --partitions bootloader,mbr,1,2 --directory 20190205
an error occurs: Disk mmcblk0 is not a valid disk. Valid options are: sdb at /usr/local/bin/odroid-backup.pl line 559.

But obviously, mmcblk0 exists:

Code: Select all

root@XU4CS2T:/srv/samba/Stick60G/eMMC_backup# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    0  1.8T  0 disk 
└─sda1         8:1    0  1.8T  0 part 
sdb            8:16   1 60.1G  0 disk 
├─sdb1         8:17   1    4G  0 part 
└─sdb2         8:18   1 56.1G  0 part /srv/samba/Stick60G
mmcblk0      179:0    0 58.2G  0 disk 
├─mmcblk0p1  179:1    0  128M  0 part 
└─mmcblk0p2  179:2    0 58.1G  0 part 
mmcblk0boot0 179:16   0    4M  1 disk 
mmcblk0boot1 179:32   0    4M  1 disk 
mmcblk0rpmb  179:48   0    4M  0 disk 
mmcblk1      179:64   0 14.9G  0 disk 
├─mmcblk1p1  179:65   0  128M  0 part /media/boot
└─mmcblk1p2  179:66   0 14.7G  0 part /
A bit inconvient for my barebones rescue over SSH now. What can I do to make the script work again? I don't want to manually do every step...

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Wed Mar 13, 2019 10:14 pm

Sorry about that. The perl modules I relied on for display are a bit broken. Try adding -a to show all disks, because mmcblk0 is not considered removable by default.

User avatar
emk2203
Posts: 41
Joined: Fri Oct 16, 2015 12:29 am
languages_spoken: english, german
ODROIDs: C1+, C2, XU4, HC1, HC2, N2
Has thanked: 1 time
Been thanked: 0
Contact:

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

Unread post by emk2203 » Thu Mar 14, 2019 3:52 am

Wow, I feel stupid now. I always have to use --text -a when doing backups for the exact same reason, but I overlooked that it is missing in my 'restore' command line.

Thanks!

leo117
Posts: 13
Joined: Fri Feb 02, 2018 11:13 am
languages_spoken: english
ODROIDs: Odroid-C2
Has thanked: 0
Been thanked: 0
Contact:

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

Unread post by leo117 » Sat Mar 23, 2019 1:49 am

I just made a backup but when i try to restore, it just shows the backup status window and does not do anything

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Sat Mar 23, 2019 3:42 am

As I said a few posts above, the display modules I rely on are broken and some dialogs (directory selection) are not shown anymore. For now you can still use the command line parameters:

Code: Select all

sudo ./odroid-backup.pl -a --restore --directory /path/to/backup/dir --disk /dev/sdd --partitions mbr,bootloader,1,2

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Mon Apr 01, 2019 11:19 pm

Ok, I made some time and did some tests. I also made a couple of corrections in the code. It seems that it works correctly when using zenity (the X11 dialog alternative), but directory selection dialogs don't work when using dialog (the shell equivalent of windows). Now instead of closing, the program will tell you what alternative to try to skip the directory selection (if it doesn't work on your system).

Should be more user friendly, without requiring a rewrite...

User avatar
meveric
Posts: 10563
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105)
Has thanked: 19 times
Been thanked: 161 times
Contact:

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

Unread post by meveric » Mon Apr 01, 2019 11:38 pm

You could try using whiptail menus instead. There's a nice filebrowser based on whiptail that someone wrote:
https://github.com/pageauc/FileBrowser
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Mon Apr 01, 2019 11:40 pm

Haven't heard of whiptail until now. Will look into it, thanks

User avatar
meveric
Posts: 10563
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105)
Has thanked: 19 times
Been thanked: 161 times
Contact:

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

Unread post by meveric » Tue Apr 02, 2019 2:50 am

whiptail is what was used in odroid-utilities (created by @mdrjr), or in my setup-odroid, cpu-control, odroid-server, and other tools which we're using since 2014 or so.
It's quite easy to understand and configure, and in many cases already pre-installed on the system compared to "dialog" which I've never seen part of an OS by default.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Tue Apr 02, 2019 3:16 am

I must be very old school then... I remembered dialog from my linux youth. I see it has perl bindings, so I'll test it tomorrow.

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Tue Apr 02, 2019 4:02 pm

Tried whiptail with the perl bindings. Sadly the windows are drawn with only a gray background (no visible text/buttons on them). You can still select things if you know where they are, but sadly it's a mess :(
Thanks for the tip though.

User avatar
meveric
Posts: 10563
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105)
Has thanked: 19 times
Been thanked: 161 times
Contact:

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

Unread post by meveric » Tue Apr 02, 2019 7:06 pm

mad_ady wrote:
Tue Apr 02, 2019 4:02 pm
Tried whiptail with the perl bindings. Sadly the windows are drawn with only a gray background (no visible text/buttons on them). You can still select things if you know where they are, but sadly it's a mess :(
Thanks for the tip though.
That sounds odd.. I use it all the time over different OSes (including Ubuntu), can you give me an example what you tried was it the filebrowser example and under which OS?
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Tue Apr 02, 2019 7:20 pm

I suspect it's the perl wrapper library that I'm using, not whiptail directly.

User avatar
meveric
Posts: 10563
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105)
Has thanked: 19 times
Been thanked: 161 times
Contact:

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

Unread post by meveric » Tue Apr 02, 2019 7:37 pm

As I don't know what you use it for and how you use it I can't help with that :(
I had very little trouble with whiptail up to now and grew quite fond of it.
Maybe you can circumvent your wrapper by starting whiptail with LD_PRELOAD and load the required libraries for whiptail directly.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

User avatar
nhiblot
Posts: 5
Joined: Wed Feb 22, 2017 7:04 am
languages_spoken: French / English
ODROIDs: C2
Has thanked: 0
Been thanked: 1 time
Contact:

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

Unread post by nhiblot » Thu May 09, 2019 2:07 am

Hi and Thanks for this great perl script

Since new version I have a problem only for restoring partition
Back Up works perfectly -
But when I want to make a restore
Selected disk to restore to is: stays always blank

The result of the restore action is display automatically (not restoring in fact ...)
and the window contains data but the restore is not done ....
Do you have any idea ?


###########################################################################################


Starting backup process
*** Starting to backup mbr ***
Error code: 0
label: dos
label-id: 0xea4f0000
device: /dev/sdc
unit: sectors

/dev/sdc1 : start= 2048, size= 262144, type=c
/dev/sdc2 : start= 264192, size= 15003649, type=83
*** Starting to backup bootloader ***
2048+0 enregistrements lus
2048+0 enregistrements écrits
1048576 bytes (1,0 MB, 1,0 MiB) copied, 0,0527177 s, 19,9 MB/s
Error code: 0
*** Bootloader backup size: 1048576 bytes ***
*** Starting to backup /dev/sdc2 ***
Statistics for filesystem 0
* files successfully processed:....regfiles=44235, directories=4559, symlinks=10626, hardlinks=18, specials=79
* 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: 5cd9d3d3
Archive file format: FsArCh_002
Archive created with: 0.8.4
Archive creation date: 2019-05-08_18-22-31
Archive label: <none>
Minimum fsarchiver version: 0.6.4.0
Compression level: 8 (zstd level 8)
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/sdc2
Original filesystem size: 7.04 GB (7561109504 bytes)
Space used in filesystem: 1.58 GB (1692508160 bytes)

*** Starting to backup /dev/sdc1 ***
Using partclone binary: partclone.vfat
Unmounting /media/nhiblot/boot...
Partclone v0.3.11 http://partclone.org
Démarrage clonage périphérique (/dev/sdc1) vers image (/home/nhiblot/TEST/partition_1.img)
Reading Super Block
Calculating bitmap... Please wait...

Ecoulé: 00:00:01, Restant: 00:01:39, Complété: 1,00%,

Elapsed: 00:00:01, Remaining: 00:00:00, Completed: 100.00%
Durée totale: 00:00:01, 100.00% completed!
done!
Système de fichiers: FAT16
Device size: 134,2 MB = 262144 Blocks
Space in use: 18,8 MB = 36700 Blocks
Free Space: 115,4 MB = 225444 Blocks
Taille de bloc: 512 octet

Ecoulé: 00:00:01, Restant: 00:01:39, Complété: 1,00%,, 0,00byte/mn
current block: 0, total block: 262144, Complete: 0,00%[A

Elapsed: 00:00:02, Remaining: 00:00:00, Completed: 100.00%, Débit: 563,71MB/mn,

current block: 262144, total block: 262144, Complete: 100.00%
Durée totale: 00:00:02, Débit moyen: 563,7MB/mn, 100.00% completed!
Syncing... OK!
Partclone a réussi à cloner le périphérique (/dev/sdc1) vers l'image (/home/nhiblot/TEST/partition_1.img)
Cloned successfully.
Error code: 0
Mounting back /media/nhiblot/boot (if it's in fstab)...
mount: /media/nhiblot/boot : impossible à trouver dans /etc/fstab.
Partclone v0.3.11 http://partclone.org
Showing info of image (/home/nhiblot/TEST/partition_1.img)
Système de fichiers: FAT16
Device size: 134,2 MB = 262144 Blocks
Space in use: 18,8 MB = 36700 Blocks
Free Space: 115,4 MB = 225444 Blocks
Taille de bloc: 512 octets

image format: 0002
created on a: 64 bits platform
with partclone: v0.3.11
bitmap mode: BIT
checksum algo: CRC32
checksum size: 4
blocks/checksum: 2048
reseed checksum: yes


###########################################################################################

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Thu May 09, 2019 1:17 pm

If you don't see any disks in the restore window most likely they are not removable. Try running the command with "-a" so that it displays all disks.

User avatar
nhiblot
Posts: 5
Joined: Wed Feb 22, 2017 7:04 am
languages_spoken: French / English
ODROIDs: C2
Has thanked: 0
Been thanked: 1 time
Contact:

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

Unread post by nhiblot » Thu May 16, 2019 7:32 pm

Hi

The list in the window is Full and I can select the disk I want
But when I click on OK, the window is closed directly

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Thu May 16, 2019 8:32 pm

In that case you'll need to use the command-line parameters because the GUI isn't working correctly unfortunately :(
Here's an example:
Non-interactive operation
Here's how to use it in non-interactive mode. You will need to set the following parameters:

--backup -- to do a backup, or
--restore -- to do a restore. Both backup and restore are incompatible at the same time for obvious reasons
--disk sdc -- The disk name (without /dev) is validated and an error is printed if that name doesn't exist in your system. Valid options are shown in case you input something wrong
--partitions bootloader,mbr,/dev/sdc1 -- A comma separated list (with no spaces) of the partitions you want to backup or restore. Valid options are shown in case you input something wrong. When restoring, the partition names have only the number - e.g. bootloader,mbr,1,2
--directory -- The directory to backup to or to restore from. If it doesn't exist it will be created. Previous backups inside will be overwritten with no warning.

Example usage:
Backup
sudo odroid-backup.pl --backup --disk sdc --partitions bootloader,mbr,/dev/sdc1,/dev/sdc2 --directory backup-emmc
sudo odroid-backup.pl --backup --disk mmcblk0 --partitions bootloader,mbr,/dev/mmcblk0p1,/dev/mmcblk0p2 --directory backup-emmc

Restore
sudo odroid-backup.pl --restore --disk sdc --partitions bootloader,mbr,1,2 --directory backup-emmc
sudo odroid-backup.pl --restore --disk mmcblk0 --partitions bootloader,mbr,1,2 --directory backup-emmc
You can specify some parameters and what is missing should be asked interactively.

dbod
Posts: 73
Joined: Fri Apr 26, 2019 10:03 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 4 times
Been thanked: 1 time
Contact:

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

Unread post by dbod » Sat May 18, 2019 2:56 am

Code: Select all

db@odroid ~ ❯❯❯ sudo odroid-backup.pl --backup --disk mmcblk0 --partitions bootloader,mbr,/dev/mmcblk0p1,/dev/mmcblk0p2 --directory backup-emmc                                                                                       
DBG: rc=0
Disk mmcblk0 is not a valid disk. Valid options are:  at /usr/local/bin/odroid-backup.pl line 129, <NAND> line 0.000000.
db@odroid ~ ❯❯❯ ls /dev/mmc*  
/dev/mmcblk0  /dev/mmcblk0boot0  /dev/mmcblk0boot1  /dev/mmcblk0p1  /dev/mmcblk0p2  /dev/mmcblk0rpmb
db@odroid ~ ❯❯❯
The code is exactly taken from the example that you gave. The GUI version seems to work fine.

I guess there is a trivial solution to this. Which is it?

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Sat May 18, 2019 3:29 am

Run it with -a as well.

dbod
Posts: 73
Joined: Fri Apr 26, 2019 10:03 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 4 times
Been thanked: 1 time
Contact:

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

Unread post by dbod » Sat May 18, 2019 5:16 am

Will try. Thanks.

User avatar
nhiblot
Posts: 5
Joined: Wed Feb 22, 2017 7:04 am
languages_spoken: French / English
ODROIDs: C2
Has thanked: 0
Been thanked: 1 time
Contact:

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

Unread post by nhiblot » Sun Jun 16, 2019 2:31 am

Hi mad_ady

After some tests
The error when you select a disk is

Use of uninitialized value $selectedDisk in concatenation (.) or string at /usr/local/bin/odroid-backup.pl line 573.

I will try with command line but I prefer using GUI (because I'm not the only one to use it)

Regards

User avatar
mad_ady
Posts: 6854
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 234 times
Been thanked: 177 times
Contact:

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

Unread post by mad_ady » Sun Jun 16, 2019 3:08 am

Do you get a dialog window with available disks? Is it using gtk or ncurses (dialog) backend?

pat2
Posts: 65
Joined: Sun Jan 06, 2019 2:22 am
languages_spoken: english
ODROIDs: XU4Q
Has thanked: 2 times
Been thanked: 2 times
Contact:

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

Unread post by pat2 » Mon Jul 15, 2019 6:13 am

thanks a lot, mad.

I got an 32 GB eMMC and becoming crazy to move the contents of my 128 GB SD card to the eMMC (btw the SD content is less than 32 GB).
To avoid to build the eMMC from scratch.

At the end I succeded following your how-to post! With some difficulties, but I succeded. I will write better my suggestions.

Preliminarly:

- first, use Ubuntu 16.04 (I do not reccomend 18.04), I used a 16.04 istance on VMware,
- second, the tool with the graphic interface has issues, but the script works with commands -as suggested in the first post- through command line,
- third, if you have issues during restore phase you have to unmount the device you are trying to restore (I unmounted the first sdb1 and the second sdb2 partition in the hypothesis sdb is the target).

I will write a following post with the commands I used, That could be usefull for other newbie like me :-).

Anyway thanks Mad. You are great!
The system with eMMC (instead of SD) is more reactive and faster. And I avoided to rebuild from scratch.
Furthermore now the recovery backup copy is no more 128 GB long (previously obtained through dd command), but only 6 GB. :-)
These users thanked the author pat2 for the post:
mad_ady (Mon Jul 15, 2019 4:55 pm)

pat2
Posts: 65
Joined: Sun Jan 06, 2019 2:22 am
languages_spoken: english
ODROIDs: XU4Q
Has thanked: 2 times
Been thanked: 2 times
Contact:

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

Unread post by pat2 » Tue Jul 16, 2019 3:38 am

it works on Ubuntu 16.04

making the hypothesis that:

- the SD (the source) is in sdc
- the eMMC (the destination) is in sdb

Code: Select all

CTRL+ALT+T
you are in /home/michele

sudo apt-get install mtd-utils
sudo wget -O /usr/local/bin/odroid-backup.pl https://raw.githubusercontent.com/mad-ady/odroid-backup/master/odroid-backup.pl 
sudo chmod a+x /usr/local/bin/odroid-backup.pl
sudo apt-get install libui-dialog-perl zenity dialog libnumber-bytes-human-perl libjson-perl fsarchiver udev util-linux coreutils partclone parted

sudo su
mkdir backup-emmc
sudo /usr/local/bin/odroid-backup.pl --backup --disk sdc --partitions bootloader,mbr,/dev/sdc1,/dev/sdc2 --directory /home/michele/backup-emmc
sudo umount /dev/sdb -v
sudo umount /dev/sdb1 -v
sudo umount /dev/sdb2 -v
sudo /usr/local/bin/odroid-backup.pl --restore --disk sdb --partitions bootloader,mbr,1,2 --directory /home/michele/backup-emmc

ab1jx
Posts: 92
Joined: Wed Jul 10, 2019 8:25 am
languages_spoken: english
Has thanked: 8 times
Been thanked: 3 times
Contact:

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

Unread post by ab1jx » Fri Jul 19, 2019 11:49 am

Piclone and clonezilla are also options. But those are for full backups. Daily use of rsynch will copy just what's changed, it overwrites a copy of a file if the date and size are different. You could keep a spare SD plugged into a USB reader and write scripts to mount it, do backups with rsynch, unmount it again, call that from a cron job so you don't forget to do it. Or use a hard drive.

But if a good version of a file gets automatically overwritten by a bad one you're sunk.

User avatar
meveric
Posts: 10563
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105)
Has thanked: 19 times
Been thanked: 161 times
Contact:

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

Unread post by meveric » Fri Jul 19, 2019 2:56 pm

ab1jx wrote:
Fri Jul 19, 2019 11:49 am
Piclone and clonezilla are also options. But those are for full backups. Daily use of rsynch will copy just what's changed, it overwrites a copy of a file if the date and size are different. You could keep a spare SD plugged into a USB reader and write scripts to mount it, do backups with rsynch, unmount it again, call that from a cron job so you don't forget to do it. Or use a hard drive.

But if a good version of a file gets automatically overwritten by a bad one you're sunk.
That is why I use backuppc from a different ODROID to backup my data. It will use rsync to do it's daily backups but also keeps a history so you have access to older files, even if your files got corrupted you can just go back a couple of days and get that file.
It also does pooling and compression, means the same file is only stored once even if you backup multiple devices and compression makes sure your harddrive does not blow up :D
here some current statistics:

Code: Select all

 There are 6 hosts that have been backed up, for a total of:

    20 full backups of total size 4868.51GB (prior to pooling and compression),
    30 incr backups of total size 73.21GB (prior to pooling and compression). 
So it has stored a total of nearly 5TB of backups
And this is the actual size:

Code: Select all

Pool is 583.36GB comprising 8328093 files and 4369 directories (as of 2019-07-18 21:24), 
ca. 8 million unique files, well I have the same files on different ODROIDs (source code) for different architectures and OS versions, I know for sure that the three biggest are all over 5mio files each :D
So that's a really nice cleanup.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

ab1jx
Posts: 92
Joined: Wed Jul 10, 2019 8:25 am
languages_spoken: english
Has thanked: 8 times
Been thanked: 3 times
Contact:

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

Unread post by ab1jx » Fri Jul 19, 2019 10:05 pm

I was originally impressed by Piclone because it doesn't copy empty space. It sets up partitions on the destination to match the original, then it calls cp -ax to copy files, it's efficient that way. But I've found 2 flaws. (1) If you clone a Raspberry Pi SD card the Pi with the clone will get the same IP address from at least an Android DHCP server as the original. Different MAC address but if you clone a Pi they'll end up on the same IP and cause a conflict. The program author says it does what he intended it for and he's not going to fix it. The problem's unique to a Raspberry Pi I think and some of the files in /etc they use. The second I just found last night is that you can't use it to copy an SD in a reader to another SD in another reader on the same machine. It won't let you copy /dev/sdb to /dev/sdc if they're both SD cards. My /dev/sda is a hard drive in a USB case/adapter from Startech and I cloned it originally from an SD then modified my /etc/fstab and /boot/cmdline.txt so it would boot from the hard drive. But without rootwait in there it would crash whenever the hard drive spun down.

I just cloned the 32 GB card I was using yesterday onto a 128 GB by using dd, then adjusting the 2nd partition size with gparted and running fsck on it afterwards. Waiting for the 128 to arrive was what held up getting my Odroid running for a week.

I used to do backups as part of my last job, on a Windows NT server with a tape cartridge drive. There were daily incremental backups, weekly and monthly full backups, the log file was a spreadsheet with tape serial numbers, it was quite a project. But i was responsible for other people's data, never lost any in 9 years I was there. Now I don't do backups at all of my own stuff, I just copy stuff between machines often enough that not much is unique. I'm paranoid about losing my password files, I copy those around between machines.

Post Reply

Return to “Ubuntu (All Linux'es)”

Who is online

Users browsing this forum: No registered users and 0 guests