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

mrperfekotne
Posts: 109
Joined: Fri Nov 10, 2017 12:40 am
languages_spoken: Danish
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
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: 5664
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 9 times
Been thanked: 15 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: 5664
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 9 times
Been thanked: 15 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: 106
Joined: Thu Jul 20, 2017 11:56 pm
languages_spoken: english
ODROIDs: XU4Q
Has thanked: 0
Been thanked: 0
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: 5664
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 9 times
Been thanked: 15 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: 40
Joined: Fri Oct 16, 2015 12:29 am
languages_spoken: english, german
ODROIDs: C1+, C2, XU4, HC1
Has thanked: 0
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: 5664
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 9 times
Been thanked: 15 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: 40
Joined: Fri Oct 16, 2015 12:29 am
languages_spoken: english, german
ODROIDs: C1+, C2, XU4, HC1
Has thanked: 0
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: 7
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: 5664
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 9 times
Been thanked: 15 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: 5664
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 9 times
Been thanked: 15 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: 9925
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, N2
Has thanked: 1 time
Been thanked: 20 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: 5664
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 9 times
Been thanked: 15 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: 9925
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, N2
Has thanked: 1 time
Been thanked: 20 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: 5664
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 9 times
Been thanked: 15 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: 5664
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 9 times
Been thanked: 15 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: 9925
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, N2
Has thanked: 1 time
Been thanked: 20 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: 5664
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 9 times
Been thanked: 15 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: 9925
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, N2
Has thanked: 1 time
Been thanked: 20 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.

Post Reply

Return to “Ubuntu (All Linux'es)”

Who is online

Users browsing this forum: No registered users and 2 guests