Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odroid-c2 - dd Backup fails #53

Closed
akidburn opened this issue May 30, 2018 · 38 comments
Closed

odroid-c2 - dd Backup fails #53

akidburn opened this issue May 30, 2018 · 38 comments
Assignees
Labels
enhancement Enhancement request

Comments

@akidburn
Copy link

akidburn commented May 30, 2018

Hi,
i have an odroid-c2 running Ubuntu 16.04 LTS using a 3.16 Kernel.
The System is using an eMMC and I am not sure if thats the issue, because just dd works, but I really dont want to code another script for one machine.

akidburn

Logfile:
20180531-000947: DBG  -- LOG_OUTPUT: 2
20180531-000947: DBG  -- Using logfile /root/odroid-c2-raspiBackup.log
20180531-000947: DBG  -- raspiBackup.sh 0.6.3.2a, 2018-05-12/17:14:41 - 1015c57
20180531-000947: DBG  -- BACKUPTARGET_DIR: /media/MyBook/#Backups/odroid-c2/odroid-c2-ddz-backup-20180531-000947
20180531-000947: DBG  -- BACKUPTARGET_FILE: /media/MyBook/#Backups/odroid-c2/odroid-c2-ddz-backup-20180531-000947/odroid-c2-ddz-backup-20180531-000947.img.gz
20180531-000947: DBG     >> logOptions
20180531-000947: DBG     -- NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.4 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
20180531-000947: DBG     -- stretch/sid
20180531-000947: DBG     -- Linux odroid-c2 3.16.56+ #1 SMP PREEMPT Tue May 29 18:08:16 CEST 2018 aarch64 aarch64 aarch64 GNU/Linux
20180531-000947: DBG     -- Options: 
20180531-000947: DBG  << logOptions
20180531-000947: DBG  -- APPEND_LOG=0
20180531-000947: DBG  -- BACKUPPATH=/media/MyBook/#Backups
20180531-000947: DBG  -- BACKUPTYPE=ddz
20180531-000947: DBG  -- CHECK_FOR_BAD_BLOCKS=0
20180531-000947: DBG  -- CONFIG_FILE=
20180531-000947: DBG  -- DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=0
20180531-000947: DBG  -- DD_BLOCKSIZE=1MB
20180531-000947: DBG  -- DD_PARMS=
20180531-000947: DBG  -- DEFAULT_DEPLOYMENT_HOSTS=
20180531-000947: DBG  -- DEFAULT_YES_NO_RESTORE_DEVICE=loop
20180531-000947: DBG  -- EMAIL=
20180531-000947: DBG  -- EMAIL_PARMS=
20180531-000947: DBG  -- EXCLUDE_LIST=
20180531-000947: DBG  -- EXTENSIONS=
20180531-000947: DBG  -- FAKE=0
20180531-000947: DBG  -- HANDLE_DEPRECATED=1
20180531-000947: DBG  -- KEEPBACKUPS=5
20180531-000947: DBG  -- LANGUAGE=DE
20180531-000947: DBG  -- LINK_BOOTPARTITIONFILES=1
20180531-000947: DBG  -- LOG_LEVEL=1
20180531-000947: DBG  -- LOG_OUTPUT=2
20180531-000947: DBG  -- MAIL_ON_ERROR_ONLY=0
20180531-000947: DBG  -- MAIL_PROGRAM=mail
20180531-000947: DBG  -- MSG_LEVEL=1
20180531-000947: DBG  -- NOTIFY_UPDATE=1
20180531-000947: DBG  -- PARTITIONBASED_BACKUP=0
20180531-000947: DBG  -- PARTITIONS_TO_BACKUP=*
20180531-000947: DBG  -- RESTORE_DEVICE=
20180531-000947: DBG  -- ROOT_PARTITION=
20180531-000947: DBG  -- RSYNC_BACKUP_ADDITIONAL_OPTIONS=
20180531-000947: DBG  -- RSYNC_BACKUP_OPTIONS=-aHAx
20180531-000947: DBG  -- SKIPLOCALCHECK=0
20180531-000947: DBG  -- STARTSERVICES=systemctl start fail2ban && systemctl start mysql && systemctl start nginx && systemctl start php7.2-fpm && systemctl start postfix && systemctl start redis-server && systemctl start xrdp
20180531-000947: DBG  -- STOPSERVICES=systemctl stop fail2ban && systemctl stop mysql && systemctl stop nginx && systemctl stop php7.2-fpm && systemctl stop postfix && systemctl stop redis-server && systemctl stop xrdp
20180531-000947: DBG  -- TAR_BACKUP_ADDITIONAL_OPTIONS=
20180531-000947: DBG  -- TAR_BACKUP_OPTIONS=-cpi
20180531-000947: DBG  -- TAR_BOOT_PARTITION_ENABLED=0
20180531-000947: DBG  -- TAR_RESTORE_ADDITIONAL_OPTIONS=
20180531-000948: DBG  -- VERBOSE=1
20180531-000948: DBG  -- ZIP_BACKUP=1
20180531-000948: DBG  -- RESIZE_ROOTFS=1
20180531-000948: DBG  -- TIMESTAMPS=0
20180531-000948: DBG  -- RSYNC_IGNORE_ERRORS=
20180531-000948: DBG  -- TAR_IGNORE_ERRORS=
20180531-000948: DBG  -- USE_HARDLINKS=1
20180531-000948: MSG  --- RBK0128I: Logdatei ist /media/MyBook/#Backups/odroid-c2/odroid-c2-ddz-backup-20180531-000947/odroid-c2-backup.log.
20180531-000948: DBG  -- /etc/config
#
# Default Konfigurationsdatei für raspiBackup.sh
#
# (C) 2013,2016 framp at linux-tips-and-tricks dot de
#
# Details zu den Parametern finden sich auf
# http://www.linux-tips-and-tricks.de/de/raspibackup/#parameter
#
# $Date: 2018-03-30 23:26:25 +0200$
# $Sha1: a6afcd4$

# Pfad wo das Backupfile gespeichert wird
DEFAULT_BACKUPPATH="/media/MyBook/#Backups"

# Anzahl der zu vorhaltenden Backups
DEFAULT_KEEPBACKUPS=5

# Typ des Backups: dd, tar, xbmc or rsync
DEFAULT_BACKUPTYPE="dd"

# zip tar oder dd backup (0 = nein, 1 = ja)
DEFAULT_ZIP_BACKUP=1

# Durch & getrennte Befehle, die vor dem Starten des Backups auszuführen sind
DEFAULT_STOPSERVICES="systemctl stop fail2ban && systemctl stop mysql && systemctl stop nginx && systemctl stop php7.2-fpm && systemctl stop postfix && systemctl stop redis-server && systemctl stop xrdp"

# Durch & getrennte Befehle, die nach dem Starten des Backups auszuführen sind
DEFAULT_STARTSERVICES="systemctl start fail2ban && systemctl start mysql && systemctl start nginx && systemctl start php7.2-fpm && systemctl start postfix && systemctl start redis-server && systemctl start xrdp"

# emailadresse die das Backupergebnis erhält
DEFAULT_EMAIL=""

# Weitere Parameter für das eMail programm (Optional)
DEFAULT_EMAIL_PARMS=""

# Log level  (0 = keiner, 1 = debug)
DEFAULT_LOG_LEVEL=1

# log Ausgabe ( 0 = /var/log/syslog, 1 = /var/log/raspiBackup/<hostname>.log, 2 = <backupPath>/raspiBackup.log, 3 = ./raspiBackup.log )
DEFAULT_LOG_OUTPUT=2

# Message level (0 = minimal, 1 = detailed)
DEFAULT_MSG_LEVEL=1

# mailprogram
DEFAULT_MAIL_PROGRAM="mail"

# Gerät wo das Backup restored wird
DEFAULT_RESTORE_DEVICE=""

# Log wird in eMail mitgeschickt (0 = nein, 1 = ja)
DEFAULT_APPEND_LOG=0

# Detailierte Logausgaben der Backupprogramme (0 = nein, 1 = ja)
DEFAULT_VERBOSE=1

# Check auf einen remoten Backupfad wird nicht vorgenommen (0 = nein, 1 = ja)
DEFAULT_SKIPLOCALCHECK=0

# Blocksize von dd
DEFAULT_DD_BLOCKSIZE=1MB

# Weitere Parameter für dd
DEFAULT_DD_PARMS=""

# Hardlinks werden für rsync benutzt (0 = nein, 1 = ja)
DEFAULT_HARDLINKS=1

# Excludeliste für das benutzte Backuprogramm
DEFAULT_EXCLUDE_LIST=""

# Notifizierung soll stattfinden wenn eine neue Scriptversion verfügbar ist (0 = nein, 1 = ja)
DEFAULT_NOTIFY_UPDATE=1

# Aufzurufende Erweiterungen
DEFAULT_EXTENSIONS=""

# partitionsbasierter backup modus (0 = nein, 1 = ja)
DEFAULT_PARTITIONBASED_BACKUP=0

# Partitionsnummern, die gesichert werden sollen beim partitionsbasierten Backup
DEFAULT_PARTITIONS_TO_BACKUP="*"

# Sprache der Meldungen (DE oder EN)
DEFAULT_LANGUAGE="DE"

# Systeme auf die raspiBackup mit dem Parameter -y übertragen wird
# ssh Zugang muss in der authorized keys Datei definiert sein
# Beispiel: "root@raspberrypi root@fhem root@openhab root@magicmirror"
DEFAULT_DEPLOYMENT_HOSTS=""

# Vorsichtig benutzen !
DEFAULT_YES_NO_RESTORE_DEVICE="loop"

# dd backup sichert nur den Platz der definierten Partitionen
DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=0

# Es werden Hardlinks für Partitionsbootfiles benutzt
DEFAULT_LINK_BOOTPARTITIONFILES=1

# eMail wird nur gesendet wenn ein Fehler aufgetreten ist. Vorsichtig benutzen !
DEFAULT_MAIL_ON_ERROR_ONLY=0

# Wenn eine Version als deprecated und fehlerhaft markiert ist wird automatisch upgraded
DEFAULT_HANDLE_DEPRECATED=1

# Reporte uuid
DEFAULT_USE_UUID=1

# teste auf bad blocks wenn beim restore eine Partition formatiert wird (Das dauert lange)
DEFAULT_CHECK_FOR_BAD_BLOCKS=0

# Das root Filesystem wird beim restore automatisch angepasst
DEFAULT_RESIZE_ROOTFS=1

# Zeitstempel werden vor den Meldungen ausgegeben
DEFAULT_TIMESTAMPS=0


# GENERATED - DO NOT DELETE 
UUID=86930432-16fa-4761-a629-561a61d19f25
20180531-000948: MSG  --- RBK0116I: Konfigurationsdatei /usr/local/etc/raspiBackup.conf wird benutzt.
20180531-000948: DBG     >> downloadPropertiesFile
20180531-000948: DBG        >> shouldDownloadPropertiesFile
20180531-000948: DBG        -- 20180531 : 20180531
20180531-000948: DBG        -- Skip download
20180531-000948: DBG     << shouldDownloadPropertiesFile - rc: 1
20180531-000948: DBG        >> parsePropertiesFile
20180531-000948: DBG        -- Properties: v: 0.6.3.2a i:  d:  b: 
20180531-000948: DBG     << parsePropertiesFile
20180531-000948: DBG  << downloadPropertiesFile - 0
20180531-000948: DBG     >> isVersionDeprecated 0.6.3.2a
20180531-000948: DBG  << isVersionDeprecated 1
20180531-000948: DBG     >> doit
20180531-000948: DBG     -- Startingdirectory: /root
20180531-000948: DBG     -- fdisk -l
Disk /dev/mmcblk0: 29,1 GiB, 31268536320 bytes, 61071360 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: 0xd3630000

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        2048   264191   262144  128M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      264192 61069312 60805121   29G 83 Linux


Disk /dev/zram0: 215,9 MiB, 226414592 bytes, 55277 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


Disk /dev/zram1: 215,9 MiB, 226414592 bytes, 55277 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


Disk /dev/zram2: 215,9 MiB, 226414592 bytes, 55277 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


Disk /dev/zram3: 215,9 MiB, 226414592 bytes, 55277 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
20180531-000948: DBG     -- mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=735892k,nr_inodes=183973,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=176888k,mode=755)
/dev/mmcblk0p2 on / type ext4 (rw,noatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (rw,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/debug type cgroup (rw,nosuid,nodev,noexec,relatime,debug)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb,release_agent=/run/cgmanager/agents/cgm-release-agent.hugetlb)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,clone_children)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event,release_agent=/run/cgmanager/agents/cgm-release-agent.perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=24,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /usr/local/tmp/cache type tmpfs (rw,nosuid,nodev,noexec,noatime,size=256000k)
tmpfs on /usr/local/tmp/sessions type tmpfs (rw,nosuid,nodev,noexec,noatime,size=256000k)
tmpfs on /var/tmp type tmpfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec,noatime)
/dev/mmcblk0p1 on /media/boot type vfat (rw,nosuid,nodev,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,flush,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
cgmfs on /run/cgmanager/fs type tmpfs (rw,relatime,size=100k,mode=755)
tmpfs on /run/user/118 type tmpfs (rw,nosuid,nodev,relatime,size=176888k,mode=700,uid=118,gid=123)
gvfsd-fuse on /run/user/118/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=118,group_id=123)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=176888k,mode=700)
//192.168.0.30/MyBook on /media/MyBook type cifs (rw,relatime,vers=1.0,cache=strict,username=#####,domain=#####,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.0.30,unix,posixpaths,serverino,acl,rsize=1048576,wsize=1048576,actimeo=1)
20180531-000948: DBG        >> doitBackup 0
20180531-000948: DBG        -- TRAP cleanup SIGINT SIGTERM EXIT
20180531-000948: DBG           >> reportNews
20180531-000948: DBG              >> isUpdatePossible
20180531-000948: DBG                 >> isNewVersionAvailable
20180531-000948: DBG                 -- Versionsplit: 0.6.3.2a - 
20180531-000948: DBG                 -- Returning: 0.0 0.0 0.6.3.2a
20180531-000948: DBG              << isNewVersionAvailable - RC: 99
20180531-000948: DBG           << isUpdatePossible
20180531-000948: DBG              >> isBetaAvailable
20180531-000948: DBG           << isBetaAvailable: 
20180531-000948: DBG        << reportNews
20180531-000948: DBG           >> getRootPartition
20180531-000948: DBG           -- cat /proc/cmdline
root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro console=ttyS0,115200n8 console=tty0 no_console_suspend hdmimode=1080p60hz  m_bpp=32 vout=hdmi fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=true max_freq=1536 maxcpus=4 monitor_onoff=false disableuhs=false mmc_removable=true usbmulticam=false usbhid.quirks=0x0eef:0x0005:0x0004
20180531-000948: DBG           -- RootPartition: UUID=e139ce78-9841-40fe-8823-96a304a09859
20180531-000948: DBG        << getRootPartition: UUID=e139ce78-9841-40fe-8823-96a304a09859
20180531-000948: DBG           >> inspect4Backup
20180531-000948: DBG           -- ls /dev/mmcblk*:
/dev/mmcblk0
/dev/mmcblk0p1
/dev/mmcblk0p2
20180531-000948: DBG           -- ls /dev/sd*:

20180531-000948: DBG           -- mountpoint /boot: /boot is not a mountpoint mountpoint /: 179:2
20180531-000948: DBG           -- part: 
20180531-000948: DBG           -- deviceNumber: /boot is not a mountpoint
20180531-000948: MSG           ??? RBK0142E: Bootgerät kann nicht erkannt werden.
20180531-000948: DBG              >> exitError 102
20180531-000948: DBG           << exitError 102
20180531-000948: DBG              >> cleanup
20180531-000948: DBG                 >> cleanupBackup
20180531-000948: DBG                 -- Got trap EXIT
20180531-000948: DBG                 -- rc: 102
Invocation parms: ''
20180531-000948: DBG                 -- emailTitle: odroid-c2: Backup nicht erfolgreich !!!.
20180531-000948: DBG                    >> cleanupBackupDirectory
20180531-000948: DBG                    -- BackupDir created: 1
20180531-000948: MSG                    --- RBK0026I: Logdatei wird in /root/odroid-c2-raspiBackup.log gesichert.
20180531-000948: MSG                    --- RBK0105I: Neues Backupverzeichnis /media/MyBook/#Backups/odroid-c2/odroid-c2-ddz-backup-20180531-000947 wird gelöscht.
20180531-000948: MSG                    ??? RBK0005E: Backup fehlerhaft beendet. Siehe vorhergehende Fehlermeldungen.
20180531-000948: DBG                 << cleanupBackup
20180531-000948: DBG                    >> cleanupTempFiles
20180531-000948: DBG                    -- Removing mailfile /tmp/raspiBackup.maillog
20180531-000948: DBG                 << cleanupTempFiles
20180531-000948: DBG                 -- Terminate now with rc 102

@framps framps added the question Some question about raspiBackup label Jun 4, 2018
@framps
Copy link
Owner

framps commented Jun 4, 2018

20180531-000948: DBG           -- mountpoint /boot: /boot is not a mountpoint mountpoint /: 179:2
20180531-000948: DBG           -- part: 
20180531-000948: DBG           -- deviceNumber: /boot is not a mountpoint

Every Raspberry has the /boot partition as a dedicated partition. There is a check in raspiBackup which requires this. Actually it doesn't make sense for a dd or ddz backup. I can create a hotfix and remove this test for a dd and ddz backup if you are willing to test it and provide feedback.

@framps framps added bug Issue accepted as a bug and removed question Some question about raspiBackup labels Jun 4, 2018
@framps
Copy link
Owner

framps commented Jun 4, 2018

Just a question: You mentioned dd works. But I guess it's a system without am eMMC - right ?

@akidburn
Copy link
Author

akidburn commented Jun 4, 2018

No, it is an odroid with eMMC only, no sdcard.

And this dd works for me:

dd status=progress if=/dev/mmcblk0 bs=512 count=61069312| gzip > /media/MyBook/#Backups/odroid-c2/server.img.gz

And I would be happy to test it.

akidburn

@framps
Copy link
Owner

framps commented Jun 4, 2018

Ok. I will build a fix in a branch on the current master and let you.

@framps
Copy link
Owner

framps commented Jun 6, 2018

@akidburn I just commited in the development banch code which should allow you to create a dd backup.
I didn't test the code because of missing HW. So there is still a chance it still doesn't work :-( Please grab the development branch and test a dd backup and restore. If it still fails please provide the full debuglog.

@framps framps self-assigned this Jun 11, 2018
@framps framps added to be verified Request was accepted and implemented and waiting for requestor verification of fix accepted enhancement Enhancement request and removed bug Issue accepted as a bug labels Jun 11, 2018
@akidburn
Copy link
Author

Alright. While it didnt work immediately, with a few adjustments i was able to make it work.

Line 3866: + part=$(for d in $(find /dev -type b); do [ "$(mountpoint -d /media/boot)" = "$(mountpoint  -x $d)" ] && echo $d && break; done)
           - part=$(for d in $(find /dev -type b); do [ "$(mountpoint -d /boot)" = "$(mountpoint -x $d)" ] && echo $d && break; done)

Line 3868: + local bootDeviceNumber=$(mountpoint -d /media/boot)
           - local bootDeviceNumber=$(mountpoint -d /boot)

Line 4120: + if (( $PROGRESS )) && [[ "$BACKUPTYPE" == "$BACKUPTYPE_DD" || "$BACKUPTYPE" == "$BACKUPTYPE_DDZ" ]] && [[ $(which pv &>/dev/null) ]]; then
           - if (( $PROGRESS )) && [[ "$BACKUPTYPE" == "$BACKUPTYPE_DD" || "$BACKUPTYPE" == "$BACKUPTYPE_DDZ" ]] && [[ ! $(which pv &>/dev/null) ]]; then

Havent tried the restore yet, but the backup works.

I had to remove the ! at the pv test, or it wouldnt work.

@framps
Copy link
Owner

framps commented Jun 13, 2018

Thank you very much for testing and feedback 👍

Your changes in 3866 and 3868 fixed the logic error on the raspiBackup /boot and /root detection. This has to be fixed in a different way but your change helped me to understand what I have to change. Unfortunately the previous log does not contain the output of mount. Would you please show the result of mount on your system - just to make sure my understanding is correct?

Line 4120 should be OK. It's testing whether you request a progress indicator with dd. Then you have to have pv installed. If you don't request a progress indicator pv is not required. Looks like you requested a progress indicator with option -g and didn't install pv.

Crossing fingers the restore will work ...

@framps framps added fixed Issue fixed and removed accepted labels Jun 21, 2018
@framps
Copy link
Owner

framps commented Jul 1, 2018

There is a beta available which includes a fix for this issue. Feel free to grab the beta and verify the fix.

@framps
Copy link
Owner

framps commented Jul 8, 2018

@akidburn Next version of raspiBackup is available as beta and includes a fix for your issue. Please verify the fix.

@Nexxxy
Copy link

Nexxxy commented Jul 10, 2018

@framps Got a similar Problem:
My boot mount is /boot/firmware :
ubuntu@git-raspberry:~/tmp/raspiBackup$ sudo findmnt /boot/firmware
TARGET SOURCE FSTYPE OPTIONS
/boot/firmware /dev/mmcblk0p1 vfat rw

changed the search for the /boot mountpoint to /boot/firmware -> works
got 2 partitions on my sd card :

~: ls /dev/mmc*
/dev/mmcblk0 /dev/mmcblk0p1 /dev/mmcblk0p2

sudo mount | grep mmc
/dev/mmcblk0p1 on /boot/firmware type vfat
/dev/mmcblk0p2 on / type ext4

my suggestion is to scan for mountpoints used by the partitions instead of searching the mountpoints of hardcoded pathes?

Greetings
Nexxy

@framps
Copy link
Owner

framps commented Jul 10, 2018

@Nexxxy

my suggestion is to scan for mountpoints used by the partitions instead of searching the mountpoints of hardcoded pathes?

Not sure I get your point. Would you please elaborate on your suggestion and give an example?

@Nexxxy
Copy link

Nexxxy commented Jul 12, 2018

Hi @framps,
tbh, I didn't read the whole code.
But as far as I understood it, it looks for the mountpoints of / and /boot in the code and then passes them on.
Instead, you could use "ls /dev/mmc*" to fetch all partitions of the card or alternatively use the output of "sudo mount | grep mmc".
My problem was that /boot is not the mountpoint, instead it is /boot/firmware
Resulting Error : RBK0142E /boot not a mountpoint

Greetings
Nexxy

@framps
Copy link
Owner

framps commented Jul 12, 2018

Thank you very much @Nexxxy for your reply. That's a restriction of raspiBackup because it's target OS was Raspbian. I see your point and I already have plans to change the boot/root partition detection logic to support other OS which either don't have boot and root partition separated or use a different path. Unfortunately this is critical code which has to be tested carefully and I need some bigger time slot for this. I will create a dedicated code branch for this and update this issue when it's ready.

@framps framps removed fixed Issue fixed to be verified Request was accepted and implemented and waiting for requestor verification of fix labels Jul 12, 2018
@framps
Copy link
Owner

framps commented Jul 14, 2018

I rewrote the boot device discovery and the Raspbian regression tests finished successfully.

I now need your help on testing the new discovery which should handle your use case also. Please grab the code branched from the current beta branch and test whether it works for you now 😄

@framps framps added the to be verified Request was accepted and implemented and waiting for requestor verification of fix label Jul 14, 2018
@framps framps added the fixed Issue fixed label Jul 15, 2018
@framps
Copy link
Owner

framps commented Jul 21, 2018

@Nexxxy Would you please verify the fix 😃 ?

@Nexxxy
Copy link

Nexxxy commented Jul 21, 2018

@framps Hi, yep i will. Currently Im in vacation, will test it on monday or tuesday.

Greetings
Nexxy

@jobenvil
Copy link

@framps no, it still doesn't work. I have a odroidXU42. It has the same /boot mount point structure. It means that /boot is mounted on /media/boot.

root@hiperborea ~ # mount
...
/dev/mmcblk1p1 on /media/boot type vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
....

Here the logs:

root@hiperborea ~ # raspiBackup.sh
--- RBK0009I: hiperborea: raspiBackup.sh V0.6.4-beta (0cb26d6) started at So 22. Jul 12:52:30 CEST 2018.
!!! RBK0165W: =========> NOTE  <=========
!!! RBK0165W: This is a betaversion and should not be used in production.
!!! RBK0165W: =========> NOTE <=========
--- RBK0128I: Using logfile /media/sda/Backup_Devices/hiperborea/hiperborea-rsync-backup-20180722-125230/hiperborea-backup.log.
--- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
??? RBK0142E: Unable to detect boot device.
--- RBK0026I: Saving logfile in /root/hiperborea-raspiBackup.log.
--- RBK0195I: Logfile saved in /root/hiperborea-raspiBackup.log.
--- RBK0105I: Deleting new backup directory /media/sda/Backup_Devices/hiperborea/hiperborea-rsync-backup-20180722-125230.
??? RBK0005E: Backup failed. Check previous error messages for details.
root@hiperborea ~ # cat /root/hiperborea-raspiBackup.log
20180722-125231: DBG  -- LOG_OUTPUT: 2
20180722-125231: DBG  -- Using logfile /root/hiperborea-raspiBackup.log
20180722-125231: DBG  -- raspiBackup.sh 0.6.4-beta, 2018-07-04/19:52:41 - 0cb26d6
20180722-125231: DBG  -- BACKUPTARGET_DIR: /media/sda/Backup_Devices/hiperborea/hiperborea-rsync-backup-20180722-125230
20180722-125231: DBG  -- BACKUPTARGET_FILE: /media/sda/Backup_Devices/hiperborea/hiperborea-rsync-backup-20180722-125230/hiperborea-rsync-backup-20180722-125230
20180722-125231: DBG     >> logOptions
20180722-125231: DBG     -- Linux hiperborea 4.14.52-145 #1 SMP PREEMPT Wed Jun 27 11:07:47 -03 2018 armv7l armv7l armv7l GNU/Linux
20180722-125231: DBG     -- Options:
20180722-125231: DBG     << logOptions
20180722-125231: DBG  -- APPEND_LOG=0
20180722-125231: DBG  -- APPEND_LOG_OPTION=-a
20180722-125231: DBG  -- BACKUPPATH=/media/sda/Backup_Devices
20180722-125231: DBG  -- BACKUPTYPE=rsync
20180722-125231: DBG  -- CHECK_FOR_BAD_BLOCKS=0
20180722-125231: DBG  -- CONFIG_FILE=
20180722-125231: DBG  -- DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=0
20180722-125231: DBG  -- DD_BLOCKSIZE=1MB
20180722-125231: DBG  -- DD_PARMS=
20180722-125231: DBG  -- DEFAULT_DEPLOYMENT_HOSTS=
20180722-125231: DBG  -- DEFAULT_YES_NO_RESTORE_DEVICE=loop
20180722-125231: DBG  -- EMAIL=
20180722-125231: DBG  -- EMAIL_PARMS=
20180722-125231: DBG  -- EXCLUDE_LIST=
20180722-125231: DBG  -- EXTENSIONS=
20180722-125231: DBG  -- FAKE=0
20180722-125231: DBG  -- HANDLE_DEPRECATED=1
20180722-125231: DBG  -- KEEPBACKUPS=2
20180722-125231: DBG  -- LANGUAGE=EN
20180722-125231: DBG  -- LINK_BOOTPARTITIONFILES=0
20180722-125231: DBG  -- LOG_LEVEL=1
20180722-125231: DBG  -- LOG_OUTPUT=2
20180722-125231: DBG  -- MAIL_ON_ERROR_ONLY=0
20180722-125231: DBG  -- MAIL_PROGRAM=mail
20180722-125231: DBG  -- MSG_LEVEL=1
20180722-125231: DBG  -- NOTIFY_UPDATE=1
20180722-125231: DBG  -- PARTITIONBASED_BACKUP=0
20180722-125231: DBG  -- PARTITIONS_TO_BACKUP=*
20180722-125231: DBG  -- RESIZE_ROOTFS=1
20180722-125231: DBG  -- RESTORE_DEVICE=
20180722-125231: DBG  -- ROOT_PARTITION=
20180722-125231: DBG  -- RSYNC_BACKUP_ADDITIONAL_OPTIONS=
20180722-125231: DBG  -- RSYNC_BACKUP_OPTIONS=-aHAxX
20180722-125231: DBG  -- RSYNC_IGNORE_ERRORS=
20180722-125231: DBG  -- SENDER_EMAIL=
20180722-125231: DBG  -- SKIPLOCALCHECK=0
20180722-125231: DBG  -- STARTSERVICES=service cron start && service mysql start && service noip2 start && service nmbd start && service nginx start && service php7.0-fpm start && service memcached start && service smbd start && service webmin start && service subsonic start && service minidlna start && service seafile start && service seahub start
20180722-125231: DBG  -- STOPSERVICES=service seahub stop && service seafile stop && service minidlna stop && service subsonic stop &&  service webmin stop && service memcached stop && service php7.0-fpm stop && service nginx stop && service smbd stop && service nmbd stop && service noip2 stop && service mysql stop && service cron stop
20180722-125231: DBG  -- SYSTEMSTATUS=0
20180722-125231: DBG  -- TAR_BACKUP_ADDITIONAL_OPTIONS=
20180722-125231: DBG  -- TAR_BACKUP_OPTIONS=-cpi
20180722-125231: DBG  -- TAR_BOOT_PARTITION_ENABLED=0
20180722-125231: DBG  -- TAR_IGNORE_ERRORS=
20180722-125231: DBG  -- TAR_RESTORE_ADDITIONAL_OPTIONS=
20180722-125231: DBG  -- TIMESTAMPS=0
20180722-125231: DBG  -- USE_HARDLINKS=1
20180722-125231: DBG  -- VERBOSE=1
20180722-125231: DBG  -- ZIP_BACKUP=0
20180722-125231: DBG     >> logSystem
20180722-125231: DBG     -- NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.5 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
20180722-125231: DBG     -- stretch/sid
20180722-125231: DBG     << logSystem
20180722-125231: MSG  --- RBK0128I: Using logfile /media/sda/Backup_Devices/hiperborea/hiperborea-rsync-backup-20180722-125230/hiperborea-backup.log.
20180722-125231: DBG  -- /etc/config
#
# Default configuration file for raspiBackup.sh
#
# (C) 2013,2018 framp at linux-tips-and-tricks dot de
#
# Details for the options see
# http://www.linux-tips-and-tricks.de/de/raspibackup/#parameter
#
# $Date: 2018-03-30 23:26:25 +0200$
# $Sha1: a6afcd4$

# path to store the backupfile
DEFAULT_BACKUPPATH="/media/sda/Backup_Devices"

# how many backups to keep
DEFAULT_KEEPBACKUPS="2"

# type of backup: dd, tar or rsync
DEFAULT_BACKUPTYPE="rsync"

# zip tar or dd backup (0 = false, 1 = true)
DEFAULT_ZIP_BACKUP="0"

# commands to stop services before backup separated by &
DEFAULT_STOPSERVICES="service seahub stop && service seafile stop && service minidlna stop && service subsonic stop &&  service webmin stop && service memcached stop && service php7.0-fpm stop && service nginx stop && service smbd stop && service nmbd stop && service noip2 stop && service mysql stop && service cron stop"

# commands to start services after backup separated by &
DEFAULT_STARTSERVICES="service cron start && service mysql start && service noip2 start && service nmbd start && service nginx start && service php7.0-fpm start && service memcached start && service smbd start && service webmin start && service subsonic start && service minidlna start && service seafile start && service seahub start"

# email to send completion status
DEFAULT_EMAIL=""

# Additional parameters for email program (optional)
DEFAULT_EMAIL_PARMS=""

# log level  (0 = none, 1 = debug)
DEFAULT_LOG_LEVEL=1

# log output ( 0 = syslog, 1 = /var/log, 2 = backuppath)
DEFAULT_LOG_OUTPUT=2

# msg level (0 = minimal, 1 = detailed)
DEFAULT_MSG_LEVEL="1"

# mailprogram
DEFAULT_MAIL_PROGRAM="mail"

# restore device
DEFAULT_RESTORE_DEVICE=""

# default append log (0 = false, 1 = true)
DEFAULT_APPEND_LOG=0

# default verbose log (0 = false, 1 = true)
DEFAULT_VERBOSE=1

# skip check for remote mount of backup path (0 = false, 1 = true)
DEFAULT_SKIPLOCALCHECK=0

# blocksize used for dd
DEFAULT_DD_BLOCKSIZE=1MB

# addition parms used for dd
DEFAULT_DD_PARMS=""

# exclude list
DEFAULT_EXCLUDE_LIST=""

# notify in email if there is an updated script version available  (0 = false, 1 = true)
DEFAULT_NOTIFY_UPDATE=1

# extensions to call
DEFAULT_EXTENSIONS=""

# partition based backup  (0 = false, 1 = true)
DEFAULT_PARTITIONBASED_BACKUP="0"

# partition numbers of partitions to save in partitionbased backup mode
DEFAULT_PARTITIONS_TO_BACKUP="*"

# language (DE or EN)
DEFAULT_LANGUAGE="EN"

# hosts which will get the updated backup script with parm -y - non pwd access with keys has to be enabled
# Example: "root@raspberrypi root@fhem root@openhab root@magicmirror"
DEFAULT_DEPLOYMENT_HOSTS=""

# Don't ask for restore confirmation if restore device is loop. Use with care !
DEFAULT_YES_NO_RESTORE_DEVICE="loop"

# with dd backup save only space used by partitions
DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=0

# Use hardlinks for partitionbootfiles
DEFAULT_LINK_BOOTPARTITIONFILES=0

# Send email only in case of errors. Use with care !
DEFAULT_MAIL_ON_ERROR_ONLY=0

# If version is marked as deprecated and buggy then update version
DEFAULT_HANDLE_DEPRECATED=1

# report uuid
DEFAULT_USE_UUID=1

# Check for bad blocks when formating restore device (Will take a long time)
DEFAULT_CHECK_FOR_BAD_BLOCKS=0

# Resize root filesystem during restore
DEFAULT_RESIZE_ROOTFS=1

# add timestamps in front of messages
DEFAULT_TIMESTAMPS=0


# GENERATED - DO NOT DELETE
UUID=8917146e-f71f-479b-a698-93ae33027eb4
20180722-125231: MSG  --- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
20180722-125231: DBG     >> downloadPropertiesFile
20180722-125231: DBG        >> shouldDownloadPropertiesFile
20180722-125231: DBG        -- 20180722 : 20180722
20180722-125231: DBG        -- Skip download
20180722-125231: DBG        << shouldDownloadPropertiesFile - rc: 1
20180722-125231: DBG        >> parsePropertiesFile
20180722-125232: DBG        -- Properties: v: 0.6.3.2a i:  d:  b: 0.6.4
20180722-125232: DBG        << parsePropertiesFile
20180722-125232: DBG     << downloadPropertiesFile - 0
20180722-125232: DBG     >> isVersionDeprecated 0.6.4-beta
20180722-125232: DBG     << isVersionDeprecated 1
20180722-125232: DBG     >> doit
20180722-125232: DBG     -- Startingdirectory: /root
20180722-125232: DBG     -- fdisk -l
Disk /dev/ram0: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mmcblk1: 29,8 GiB, 32010928128 bytes, 62521344 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: 0x0003f9f7

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk1p1        2048   264191   262144  128M  c W95 FAT32 (LBA)
/dev/mmcblk1p2      264192 62521343 62257152 29,7G 83 Linux


Disk /dev/sda: 465,8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x37442cfb

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1        2048 976773167 976771120 465,8G 83 Linux
20180722-125232: DBG     -- mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=950948k,nr_inodes=186195,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=204244k,mode=755)
/dev/mmcblk1p2 on / type ext4 (rw,noatime,nobarrier,errors=remount-ro,commit=300,stripe=32596)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,sync,size=524288k)
/dev/sda1 on /media/sda type ext4 (rw,noatime,nobarrier,errors=remount-ro,stripe=8191,data=ordered)
/dev/sda1 on /var/www/Album type ext4 (rw,noatime,nobarrier,errors=remount-ro,stripe=8191,data=ordered)
/dev/sda1 on /var/www/_h5ai/public/cache/thumbs type ext4 (rw,noatime,nobarrier,errors=remount-ro,stripe=8191,data=ordered)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
/dev/mmcblk1p1 on /media/boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=204244k,mode=700)
20180722-125232: DBG        >> doitBackup 0
20180722-125232: DBG        -- TRAP cleanup SIGINT SIGTERM EXIT
20180722-125232: DBG           >> reportNews
20180722-125232: DBG              >> isUpdatePossible
20180722-125232: DBG                 >> isNewVersionAvailable
20180722-125232: DBG                 -- Versionsplit: 0.6.4 - beta
20180722-125232: DBG                 -- Returning: 0.0 0.0 0.6.4-beta
20180722-125232: DBG                 << isNewVersionAvailable - RC: 99
20180722-125232: DBG              << isUpdatePossible
20180722-125232: DBG           << reportNews
20180722-125232: DBG           >> getRootPartition
20180722-125232: DBG           -- cat /proc/cmdline
console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0  HPD=true vout=hdmi usbhid.quirks=0x0eef:0x0005:0x0004 smsc95xx.macaddr=00:1e:06:61:7a:39 false s5p_mfc.mem=16M
20180722-125232: DBG           -- RootPartition: UUID=e139ce78-9841-40fe-8823-96a304a09859
20180722-125232: DBG           << getRootPartition: UUID=e139ce78-9841-40fe-8823-96a304a09859
20180722-125232: DBG           >> inspect4Backup
20180722-125232: DBG           -- ls /dev/mmcblk*:
/dev/mmcblk1
/dev/mmcblk1p1
/dev/mmcblk1p2
20180722-125232: DBG           -- ls /dev/sd*:
/dev/sda
/dev/sda1
20180722-125232: DBG           -- mountpoint /boot: /boot is not a mountpoint mountpoint /: 179:2
20180722-125232: DBG           -- part:
20180722-125232: DBG           -- bootDeviceNumber: /boot is not a mountpoint
20180722-125232: DBG           -- rootDeviceNumber: 179:2
20180722-125232: MSG           ??? RBK0142E: Unable to detect boot device.
20180722-125232: DBG              >> exitError 102
20180722-125232: DBG              << exitError 102
20180722-125232: DBG              >> cleanup
20180722-125233: DBG                 >> cleanupBackup
20180722-125233: DBG                 -- Got trap EXIT
20180722-125233: DBG                 -- rc: 102
Invocation parms: ''
20180722-125233: DBG                    >> sendEMail
20180722-125233: DBG                    << sendEMail
20180722-125233: DBG                    >> cleanupBackupDirectory
20180722-125233: DBG                    -- BackupDir created: 1
20180722-125233: MSG                    --- RBK0026I: Saving logfile in /root/hiperborea-raspiBackup.log.
20180722-125233: MSG                    --- RBK0195I: Logfile saved in /root/hiperborea-raspiBackup.log.
20180722-125233: MSG                    --- RBK0105I: Deleting new backup directory /media/sda/Backup_Devices/hiperborea/hiperborea-rsync-backup-20180722-125230.
20180722-125233: MSG                    ??? RBK0005E: Backup failed. Check previous error messages for details.
20180722-125233: DBG                    << cleanupBackup
20180722-125233: DBG                    >> cleanupTempFiles
20180722-125233: DBG                    -- Removing mailfile /tmp/raspiBackup.maillog
20180722-125233: DBG                    << cleanupTempFiles
20180722-125233: DBG                 -- Terminate now with rc 102
root@hiperborea ~ #

If you need more infos, let me know.

Thanks for your really great support and contribution and

have fun :-)

@framps
Copy link
Owner

framps commented Jul 22, 2018

@jobenvil Thank you very much for trying to test the new boot discovery code. But it looks like you didn't grab the fix 😢 . Your debug log shows sha 0cb26d6 but the fix has sha f223b2c. Please grab this file and run raspiBackup again to test the new boot discovery code 😃

@jobenvil
Copy link

@framps I have to thank you!, no issue. I tried with the f223b2c, but I get this error:

root@hiperborea ~ # bash raspiBackup.sh
--- RBK0009I: hiperborea: raspiBackup.sh V0.6.4-beta (f223b2c) started at So 22. Jul 17:57:25 CEST 2018.
!!! RBK0165W: =========> NOTE  <=========
!!! RBK0165W: This is a betaversion and should not be used in production.
!!! RBK0165W: =========> NOTE <=========
--- RBK0128I: Using logfile /media/sda/autohiperboreabackup/hiperborea/hiperborea-tgz-backup-20180722-175725/hiperborea-backup.log.
--- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
/boot
/boot/.firmware_revision
/boot/exynos5422-odroidhc1.dtb
/boot/zImage
/boot/uInitrd-4.14.52-145
/boot/initrd.img-4.14.52-145
/boot/exynos5422-odroidxu3.dtb
/boot/exynos5422-odroidxu4-kvm.dtb
/boot/exynos5422-odroidxu3-lite.dtb
/boot/exynos5422-odroidxu4.dtb
find: ‘cmdline.txt’: No such file or directory
??? RBK0142E: Unable to detect boot device or directory.
--- RBK0026I: Saving logfile in /root/hiperborea-raspiBackup.log.
--- RBK0195I: Logfile saved in /root/hiperborea-raspiBackup.log.
--- RBK0105I: Deleting new backup directory /media/sda/autohiperboreabackup/hiperborea/hiperborea-tgz-backup-20180722-175725.
??? RBK0005E: Backup failed. Check previous error messages for details.
root@hiperborea ~ # cat hiperborea-raspiBackup.log
20180722-175725: DBG  -- LOG_OUTPUT: 2
20180722-175725: DBG  -- Using logfile /root/hiperborea-raspiBackup.log
20180722-175725: DBG  -- raspiBackup.sh 0.6.4-beta, 2018-07-14/16:09:25 - f223b2c
20180722-175725: DBG  -- BACKUPTARGET_DIR: /media/sda/autohiperboreabackup/hiperborea/hiperborea-tgz-backup-20180722-175725
20180722-175725: DBG  -- BACKUPTARGET_FILE: /media/sda/autohiperboreabackup/hiperborea/hiperborea-tgz-backup-20180722-175725/hiperborea-tgz-backup-20180722-175725.tgz
20180722-175725: DBG     >> logOptions
20180722-175725: DBG     -- Linux hiperborea 4.14.52-145 #1 SMP PREEMPT Wed Jun 27 11:07:47 -03 2018 armv7l armv7l armv7l GNU/Linux
20180722-175725: DBG     -- Options:
20180722-175725: DBG     << logOptions
20180722-175725: DBG  -- APPEND_LOG=0
20180722-175725: DBG  -- APPEND_LOG_OPTION=-a
20180722-175725: DBG  -- BACKUPPATH=/media/sda/autohiperboreabackup
20180722-175725: DBG  -- BACKUPTYPE=tgz
20180722-175725: DBG  -- CHECK_FOR_BAD_BLOCKS=0
20180722-175725: DBG  -- CONFIG_FILE=
20180722-175725: DBG  -- DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=0
20180722-175725: DBG  -- DD_BLOCKSIZE=1MB
20180722-175725: DBG  -- DD_PARMS=
20180722-175725: DBG  -- DEFAULT_DEPLOYMENT_HOSTS=
20180722-175725: DBG  -- DEFAULT_YES_NO_RESTORE_DEVICE=loop
20180722-175725: DBG  -- EMAIL=
20180722-175725: DBG  -- EMAIL_PARMS=
20180722-175726: DBG  -- EXCLUDE_LIST=
20180722-175726: DBG  -- EXTENSIONS=
20180722-175726: DBG  -- FAKE=0
20180722-175726: DBG  -- HANDLE_DEPRECATED=1
20180722-175726: DBG  -- KEEPBACKUPS=2
20180722-175726: DBG  -- LANGUAGE=EN
20180722-175726: DBG  -- LINK_BOOTPARTITIONFILES=0
20180722-175726: DBG  -- LOG_LEVEL=1
20180722-175726: DBG  -- LOG_OUTPUT=2
20180722-175726: DBG  -- MAIL_ON_ERROR_ONLY=0
20180722-175726: DBG  -- MAIL_PROGRAM=mail
20180722-175726: DBG  -- MSG_LEVEL=1
20180722-175726: DBG  -- NOTIFY_UPDATE=1
20180722-175726: DBG  -- PARTITIONBASED_BACKUP=0
20180722-175726: DBG  -- PARTITIONS_TO_BACKUP=*
20180722-175726: DBG  -- RESIZE_ROOTFS=1
20180722-175726: DBG  -- RESTORE_DEVICE=
20180722-175726: DBG  -- ROOT_PARTITION=
20180722-175726: DBG  -- RSYNC_BACKUP_ADDITIONAL_OPTIONS=
20180722-175726: DBG  -- RSYNC_BACKUP_OPTIONS=-aHAxX
20180722-175726: DBG  -- RSYNC_IGNORE_ERRORS=
20180722-175726: DBG  -- SENDER_EMAIL=
20180722-175726: DBG  -- SKIPLOCALCHECK=0
20180722-175726: DBG  -- STARTSERVICES=service cron start && service mysql start && service noip2 start && service nmbd start && service nginx start && service php7.0-fpm start && service memcached start && service smbd start && service webmin start && service subsonic start && service minidlna start && service seafile start && service seahub start
20180722-175726: DBG  -- STOPSERVICES=service seahub stop && service seafile stop && service minidlna stop && service subsonic stop &&  service webmin stop && service memcached stop && service php7.0-fpm stop && service nginx stop && service smbd stop && service nmbd stop && service noip2 stop && service mysql stop && service cron stop
20180722-175726: DBG  -- SYSTEMSTATUS=0
20180722-175726: DBG  -- TAR_BACKUP_ADDITIONAL_OPTIONS=
20180722-175726: DBG  -- TAR_BACKUP_OPTIONS=-cpi
20180722-175726: DBG  -- TAR_BOOT_PARTITION_ENABLED=0
20180722-175726: DBG  -- TAR_IGNORE_ERRORS=
20180722-175726: DBG  -- TAR_RESTORE_ADDITIONAL_OPTIONS=
20180722-175726: DBG  -- TIMESTAMPS=0
20180722-175726: DBG  -- USE_HARDLINKS=1
20180722-175726: DBG  -- VERBOSE=0
20180722-175726: DBG  -- ZIP_BACKUP=1
20180722-175726: DBG     >> logSystem
20180722-175726: DBG     -- NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.5 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
20180722-175726: DBG     -- stretch/sid
20180722-175726: DBG     << logSystem
20180722-175726: MSG  --- RBK0128I: Using logfile /media/sda/autohiperboreabackup/hiperborea/hiperborea-tgz-backup-20180722-175725/hiperborea-backup.log.
20180722-175726: DBG  -- /etc/config
#
# Default configuration file for raspiBackup.sh
#
# (C) 2013,2018 framp at linux-tips-and-tricks dot de
#
# Details for the options see
# http://www.linux-tips-and-tricks.de/de/raspibackup/#parameter
#
# $Date: 2018-03-30 23:26:25 +0200$
# $Sha1: a6afcd4$

# path to store the backupfile
DEFAULT_BACKUPPATH="/media/sda/autohiperboreabackup"

# how many backups to keep
DEFAULT_KEEPBACKUPS="2"

# type of backup: dd, tar or rsync
DEFAULT_BACKUPTYPE="tar"

# zip tar or dd backup (0 = false, 1 = true)
DEFAULT_ZIP_BACKUP="1"

# commands to stop services before backup separated by &
DEFAULT_STOPSERVICES="service seahub stop && service seafile stop && service minidlna stop && service subsonic stop &&  service webmin stop && service memcached stop && service php7.0-fpm stop && service nginx stop && service smbd stop && service nmbd stop && service noip2 stop && service mysql stop && service cron stop"

# commands to start services after backup separated by &
DEFAULT_STARTSERVICES="service cron start && service mysql start && service noip2 start && service nmbd start && service nginx start && service php7.0-fpm start && service memcached start && service smbd start && service webmin start && service subsonic start && service minidlna start && service seafile start && service seahub start"

# email to send completion status
DEFAULT_EMAIL=""

# Additional parameters for email program (optional)
DEFAULT_EMAIL_PARMS=""

# log level  (0 = none, 1 = debug)
DEFAULT_LOG_LEVEL=1

# log output ( 0 = syslog, 1 = /var/log, 2 = backuppath)
DEFAULT_LOG_OUTPUT=2

# msg level (0 = minimal, 1 = detailed)
DEFAULT_MSG_LEVEL="1"

# mailprogram
DEFAULT_MAIL_PROGRAM="mail"

# restore device
DEFAULT_RESTORE_DEVICE=""

# default append log (0 = false, 1 = true)
DEFAULT_APPEND_LOG=0

# default verbose log (0 = false, 1 = true)
DEFAULT_VERBOSE=0

# skip check for remote mount of backup path (0 = false, 1 = true)
DEFAULT_SKIPLOCALCHECK=0

# blocksize used for dd
DEFAULT_DD_BLOCKSIZE=1MB

# addition parms used for dd
DEFAULT_DD_PARMS=""

# exclude list
DEFAULT_EXCLUDE_LIST=""

# notify in email if there is an updated script version available  (0 = false, 1 = true)
DEFAULT_NOTIFY_UPDATE=1

# extensions to call
DEFAULT_EXTENSIONS=""

# partition based backup  (0 = false, 1 = true)
DEFAULT_PARTITIONBASED_BACKUP="0"

# partition numbers of partitions to save in partitionbased backup mode
DEFAULT_PARTITIONS_TO_BACKUP="*"

# language (DE or EN)
DEFAULT_LANGUAGE="EN"

# hosts which will get the updated backup script with parm -y - non pwd access with keys has to be enabled
# Example: "root@raspberrypi root@fhem root@openhab root@magicmirror"
DEFAULT_DEPLOYMENT_HOSTS=""

# Don't ask for restore confirmation if restore device is loop. Use with care !
DEFAULT_YES_NO_RESTORE_DEVICE="loop"

# with dd backup save only space used by partitions
DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=0

# Use hardlinks for partitionbootfiles
DEFAULT_LINK_BOOTPARTITIONFILES=0

# Send email only in case of errors. Use with care !
DEFAULT_MAIL_ON_ERROR_ONLY=0

# If version is marked as deprecated and buggy then update version
DEFAULT_HANDLE_DEPRECATED=1

# report uuid
DEFAULT_USE_UUID=1

# Check for bad blocks when formating restore device (Will take a long time)
DEFAULT_CHECK_FOR_BAD_BLOCKS=0

# Resize root filesystem during restore
DEFAULT_RESIZE_ROOTFS=1

# add timestamps in front of messages
DEFAULT_TIMESTAMPS=0


# GENERATED - DO NOT DELETE
UUID=438d420a-e7f8-4642-8749-98b9efbe92be
20180722-175726: MSG  --- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
20180722-175726: DBG     >> downloadPropertiesFile
20180722-175726: DBG        >> shouldDownloadPropertiesFile
20180722-175726: DBG        -- 20180722 : 20180722
20180722-175726: DBG        -- Skip download
20180722-175726: DBG        << shouldDownloadPropertiesFile - rc: 1
20180722-175726: DBG        >> parsePropertiesFile
20180722-175726: DBG        -- Properties: v: 0.6.3.2a i:  d:  b: 0.6.4
20180722-175726: DBG        << parsePropertiesFile
20180722-175726: DBG     << downloadPropertiesFile - 0
20180722-175726: DBG     >> isVersionDeprecated 0.6.4-beta
20180722-175726: DBG     << isVersionDeprecated 1
20180722-175726: DBG     >> doit
20180722-175726: DBG     -- Startingdirectory: /root
20180722-175726: DBG     -- fdisk -l
Disk /dev/ram0: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mmcblk1: 29,8 GiB, 32010928128 bytes, 62521344 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: 0x0003f9f7

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk1p1        2048   264191   262144  128M  c W95 FAT32 (LBA)
/dev/mmcblk1p2      264192 62521343 62257152 29,7G 83 Linux


Disk /dev/sda: 465,8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x37442cfb

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1        2048 976773167 976771120 465,8G 83 Linux
20180722-175726: DBG     -- mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=950948k,nr_inodes=186195,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=204244k,mode=755)
/dev/mmcblk1p2 on / type ext4 (rw,noatime,nobarrier,errors=remount-ro,commit=300,stripe=32596)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=25,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,sync,size=524288k)
/dev/mmcblk1p1 on /media/boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/sda1 on /media/sda type ext4 (rw,noatime,nobarrier,errors=remount-ro,stripe=8191,data=ordered)
/dev/sda1 on /var/www/Album type ext4 (rw,noatime,nobarrier,errors=remount-ro,stripe=8191,data=ordered)
/dev/sda1 on /var/www/_h5ai/public/cache/thumbs type ext4 (rw,noatime,nobarrier,errors=remount-ro,stripe=8191,data=ordered)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=204244k,mode=700)
20180722-175726: DBG        >> doitBackup 0
20180722-175726: DBG        -- TRAP cleanup SIGINT SIGTERM EXIT
20180722-175726: DBG           >> reportNews
20180722-175726: DBG              >> isUpdatePossible
20180722-175726: DBG                 >> isNewVersionAvailable
20180722-175726: DBG                 -- Versionsplit: 0.6.4 - beta
20180722-175726: DBG                 -- Returning: 0.0 0.0 0.6.4-beta
20180722-175726: DBG                 << isNewVersionAvailable - RC: 99
20180722-175726: DBG              << isUpdatePossible
20180722-175726: DBG           << reportNews
20180722-175726: DBG           >> getRootPartition
20180722-175726: DBG           -- cat /proc/cmdline
console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0  HPD=true vout=hdmi usbhid.quirks=0x0eef:0x0005:0x0004 smsc95xx.macaddr=00:1e:06:61:7a:39 false s5p_mfc.mem=16M
20180722-175726: DBG           -- RootPartition: UUID=e139ce78-9841-40fe-8823-96a304a09859
20180722-175726: DBG           << getRootPartition: UUID=e139ce78-9841-40fe-8823-96a304a09859
20180722-175726: DBG           >> inspect4Backup
20180722-175726: DBG           -- /boot mounted?
20180722-175726: DBG           -- Some path in /boot mounted? /dev/mmcblk1p1
20180722-175726: DBG           -- / mounted? /dev/mmcblk1p2
/boot
/boot/.firmware_revision
/boot/exynos5422-odroidhc1.dtb
/boot/zImage
/boot/uInitrd-4.14.52-145
/boot/initrd.img-4.14.52-145
/boot/exynos5422-odroidxu3.dtb
/boot/exynos5422-odroidxu4-kvm.dtb
/boot/exynos5422-odroidxu3-lite.dtb
/boot/exynos5422-odroidxu4.dtb
find: ‘cmdline.txt’: No such file or directory
20180722-175726: MSG           ??? RBK0142E: Unable to detect boot device or directory.
20180722-175726: DBG              >> exitError 102
20180722-175726: DBG              << exitError 102
20180722-175726: DBG              >> cleanup
20180722-175726: DBG                 >> cleanupBackup
20180722-175727: DBG                 -- Got trap EXIT
20180722-175727: DBG                 -- rc: 102
Invocation parms: ''
20180722-175727: DBG                    >> sendEMail
20180722-175727: DBG                    << sendEMail
20180722-175727: DBG                    >> cleanupBackupDirectory
20180722-175727: DBG                    -- BackupDir created: 1
20180722-175727: MSG                    --- RBK0026I: Saving logfile in /root/hiperborea-raspiBackup.log.
20180722-175727: MSG                    --- RBK0195I: Logfile saved in /root/hiperborea-raspiBackup.log.
20180722-175727: MSG                    --- RBK0105I: Deleting new backup directory /media/sda/autohiperboreabackup/hiperborea/hiperborea-tgz-backup-20180722-175725.
20180722-175727: MSG                    ??? RBK0005E: Backup failed. Check previous error messages for details.
20180722-175727: DBG                    << cleanupBackup
20180722-175727: DBG                    >> cleanupTempFiles
20180722-175727: DBG                    -- Removing mailfile /tmp/raspiBackup.maillog
20180722-175727: DBG                    << cleanupTempFiles
20180722-175727: DBG                 -- Terminate now with rc 102

I tested the backup with the changes of @akidburn and it worked!:

+ part=$(for d in $(find /dev -type b); do [ "$(mountpoint -d /media/boot)" = "$(mountpoint  -x $d)" ] && echo $d && break; done)
           - part=$(for d in $(find /dev -type b); do [ "$(mountpoint -d /boot)" = "$(mountpoint -x $d)" ] && echo $d && break; done)

+ local bootDeviceNumber=$(mountpoint -d /media/boot)
           - local bootDeviceNumber=$(mountpoint -d /boot)

but the restore only worked with the "dd" option. I think that it is related to the odroid blobs which are NOT copied with "tar" and "rsysnc".

Framp, take your time, the issue is not urgent...

@framps
Copy link
Owner

framps commented Jul 22, 2018

@jobenvil Thank you very much for testing. Your log helped me to understand what's going wrong. I updated raspiBackup in this branch again. It should now work with you odroid.

but the restore only worked with the "dd" option.

Yes, you are right. That's something which is not saved when tar or rsync is used. That's something which may be done when using the wrapper script. But you also have to write a wrapper script for the restore.

raspiBackup is designed for Raspberry 😢 but I try to support other SOCs with raspiBackup if it's possible with acceptable effort and get help testing the support because I don't own other HW.

Framp, take your time, the issue is not urgent...

I see, but I don't have an odroid and if there is somebody willing to test raspiBackup on odroid as you do I take the time 😄 .

@jobenvil
Copy link

yes @framps testing without odroid ist not easy! don't worry.

I got the following error:


root@hiperborea ~/raspi # bash raspiBackup.sh
--- RBK0009I: hiperborea: raspiBackup.sh V0.6.4-beta (68542b2) started at Mo 23. Jul 20:37:40 CEST 2018.
!!! RBK0165W: =========> NOTE  <=========
!!! RBK0165W: This is a betaversion and should not be used in production.
!!! RBK0165W: =========> NOTE <=========
--- RBK0128I: Using logfile /media/sda/autohiperboreabackup/hiperborea/hiperborea-ddz-backup-20180723-203740/hiperborea-backup.log.
--- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
--- RBK0200I: /boot and root located on same device .
??? RBK0001E: Unexpected program error occured. Git commit: 68542b2, Linenumber: 1507, Error: Unable to retrieve partition prefix for device .
??? RBK0148E: @@@@@@@@@@@@@@@@@@@@ Stacktrace @@@@@@@@@@@@@@@@@@@@
??? RBK0016E: No sd card /dev/ found.
--- RBK0026I: Saving logfile in /root/hiperborea-raspiBackup.log.
--- RBK0195I: Logfile saved in /root/hiperborea-raspiBackup.log.
--- RBK0105I: Deleting new backup directory /media/sda/autohiperboreabackup/hiperborea/hiperborea-ddz-backup-20180723-203740.
??? RBK0005E: Backup failed. Check previous error messages for details.
root@hiperborea ~/raspi # cat /root/hiperborea-raspiBackup.log
20180723-203740: DBG  -- LOG_OUTPUT: 2
20180723-203740: DBG  -- Using logfile /root/hiperborea-raspiBackup.log
20180723-203740: DBG  -- raspiBackup.sh 0.6.4-beta, 2018-07-21/22:30:15 - 68542b2
20180723-203740: DBG  -- BACKUPTARGET_DIR: /media/sda/autohiperboreabackup/hiperborea/hiperborea-ddz-backup-20180723-203740
20180723-203740: DBG  -- BACKUPTARGET_FILE: /media/sda/autohiperboreabackup/hiperborea/hiperborea-ddz-backup-20180723-203740/hiperborea-ddz-backup-20180723-203740.img.gz
20180723-203740: DBG     >> logOptions
20180723-203740: DBG     -- Linux hiperborea 4.14.52-145 #1 SMP PREEMPT Wed Jun 27 11:07:47 -03 2018 armv7l armv7l armv7l GNU/Linux
20180723-203740: DBG     -- Options:
20180723-203740: DBG     << logOptions
20180723-203740: DBG  -- APPEND_LOG=0
20180723-203740: DBG  -- APPEND_LOG_OPTION=-a
20180723-203740: DBG  -- BACKUPPATH=/media/sda/autohiperboreabackup
20180723-203740: DBG  -- BACKUPTYPE=ddz
20180723-203740: DBG  -- CHECK_FOR_BAD_BLOCKS=0
20180723-203740: DBG  -- CONFIG_FILE=
20180723-203740: DBG  -- DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=0
20180723-203740: DBG  -- DD_BLOCKSIZE=1MB
20180723-203740: DBG  -- DD_PARMS=
20180723-203740: DBG  -- DEFAULT_DEPLOYMENT_HOSTS=
20180723-203740: DBG  -- DEFAULT_YES_NO_RESTORE_DEVICE=loop
20180723-203740: DBG  -- EMAIL=elespiritudel82@gmail.com
20180723-203740: DBG  -- EMAIL_PARMS=
20180723-203740: DBG  -- EXCLUDE_LIST=
20180723-203740: DBG  -- EXTENSIONS=
20180723-203740: DBG  -- FAKE=0
20180723-203740: DBG  -- HANDLE_DEPRECATED=1
20180723-203740: DBG  -- KEEPBACKUPS=2
20180723-203741: DBG  -- LANGUAGE=EN
20180723-203741: DBG  -- LINK_BOOTPARTITIONFILES=0
20180723-203741: DBG  -- LOG_LEVEL=1
20180723-203741: DBG  -- LOG_OUTPUT=2
20180723-203741: DBG  -- MAIL_ON_ERROR_ONLY=0
20180723-203741: DBG  -- MAIL_PROGRAM=mail
20180723-203741: DBG  -- MSG_LEVEL=1
20180723-203741: DBG  -- NOTIFY_UPDATE=1
20180723-203741: DBG  -- PARTITIONBASED_BACKUP=0
20180723-203741: DBG  -- PARTITIONS_TO_BACKUP=*
20180723-203741: DBG  -- RESIZE_ROOTFS=1
20180723-203741: DBG  -- RESTORE_DEVICE=
20180723-203741: DBG  -- ROOT_PARTITION=
20180723-203741: DBG  -- RSYNC_BACKUP_ADDITIONAL_OPTIONS=
20180723-203741: DBG  -- RSYNC_BACKUP_OPTIONS=-aHAxX
20180723-203741: DBG  -- RSYNC_IGNORE_ERRORS=
20180723-203741: DBG  -- SENDER_EMAIL=
20180723-203741: DBG  -- SKIPLOCALCHECK=0
20180723-203741: DBG  -- STARTSERVICES=service exim4 start && service cron start && service mysql start && service noip2 start && service nmbd start && service nginx start && service php7.0-fpm start && service memcached start && service smbd start && service webmin start && service subsonic start && service minidlna start && service seafile start && service seahub start
20180723-203741: DBG  -- STOPSERVICES=service seahub stop && service seafile stop && service minidlna stop && service subsonic stop &&  service webmin stop && service memcached stop && service php7.0-fpm stop && service nginx stop && service smbd stop && service nmbd stop && service noip2 stop && service mysql stop && service cron stop && service exim4 stop
20180723-203741: DBG  -- SYSTEMSTATUS=0
20180723-203741: DBG  -- TAR_BACKUP_ADDITIONAL_OPTIONS=
20180723-203741: DBG  -- TAR_BACKUP_OPTIONS=-cpi
20180723-203741: DBG  -- TAR_BOOT_PARTITION_ENABLED=0
20180723-203741: DBG  -- TAR_IGNORE_ERRORS=
20180723-203741: DBG  -- TAR_RESTORE_ADDITIONAL_OPTIONS=
20180723-203741: DBG  -- TIMESTAMPS=0
20180723-203741: DBG  -- USE_HARDLINKS=1
20180723-203741: DBG  -- VERBOSE=0
20180723-203741: DBG  -- ZIP_BACKUP=1
20180723-203741: DBG     >> logSystem
20180723-203741: DBG     -- NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.5 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
20180723-203741: DBG     -- stretch/sid
20180723-203741: DBG     << logSystem
20180723-203741: MSG  --- RBK0128I: Using logfile /media/sda/autohiperboreabackup/hiperborea/hiperborea-ddz-backup-20180723-203740/hiperborea-backup.log.
20180723-203741: DBG  -- /etc/config
#
# Default configuration file for raspiBackup.sh
#
# (C) 2013,2018 framp at linux-tips-and-tricks dot de
#
# Details for the options see
# http://www.linux-tips-and-tricks.de/de/raspibackup/#parameter
#
# $Date: 2018-03-30 23:26:25 +0200$
# $Sha1: a6afcd4$

# path to store the backupfile
DEFAULT_BACKUPPATH="/media/sda/autohiperboreabackup"

# how many backups to keep
DEFAULT_KEEPBACKUPS="2"

# type of backup: dd, tar or rsync
DEFAULT_BACKUPTYPE="dd"

# zip tar or dd backup (0 = false, 1 = true)
DEFAULT_ZIP_BACKUP="1"

# commands to stop services before backup separated by &
DEFAULT_STOPSERVICES="service seahub stop && service seafile stop && service minidlna stop && service subsonic stop &&  service webmin stop && service memcached stop && service php7.0-fpm stop && service nginx stop && service smbd stop && service nmbd stop && service noip2 stop && service mysql stop && service cron stop && service exim4 stop"

# commands to start services after backup separated by &
DEFAULT_STARTSERVICES="service exim4 start && service cron start && service mysql start && service noip2 start && service nmbd start && service nginx start && service php7.0-fpm start && service memcached start && service smbd start && service webmin start && service subsonic start && service minidlna start && service seafile start && service seahub start"

# email to send completion status
DEFAULT_EMAIL="elespiritudel82@gmail.com"

# Additional parameters for email program (optional)
DEFAULT_EMAIL_PARMS=""

# log level  (0 = none, 1 = debug)
DEFAULT_LOG_LEVEL=1

# log output ( 0 = syslog, 1 = /var/log, 2 = backuppath)
DEFAULT_LOG_OUTPUT=2

# msg level (0 = minimal, 1 = detailed)
DEFAULT_MSG_LEVEL="1"

# mailprogram
DEFAULT_MAIL_PROGRAM="mail"

# restore device
DEFAULT_RESTORE_DEVICE=""

# default append log (0 = false, 1 = true)
DEFAULT_APPEND_LOG=0

# default verbose log (0 = false, 1 = true)
DEFAULT_VERBOSE=0

# skip check for remote mount of backup path (0 = false, 1 = true)
DEFAULT_SKIPLOCALCHECK=0

# blocksize used for dd
DEFAULT_DD_BLOCKSIZE=1MB

# addition parms used for dd
DEFAULT_DD_PARMS=""

# exclude list
DEFAULT_EXCLUDE_LIST=""

# notify in email if there is an updated script version available  (0 = false, 1 = true)
DEFAULT_NOTIFY_UPDATE=1

# extensions to call
DEFAULT_EXTENSIONS=""

# partition based backup  (0 = false, 1 = true)
DEFAULT_PARTITIONBASED_BACKUP="0"

# partition numbers of partitions to save in partitionbased backup mode
DEFAULT_PARTITIONS_TO_BACKUP="*"

# language (DE or EN)
DEFAULT_LANGUAGE="EN"

# hosts which will get the updated backup script with parm -y - non pwd access with keys has to be enabled
# Example: "root@raspberrypi root@fhem root@openhab root@magicmirror"
DEFAULT_DEPLOYMENT_HOSTS=""

# Don't ask for restore confirmation if restore device is loop. Use with care !
DEFAULT_YES_NO_RESTORE_DEVICE="loop"

# with dd backup save only space used by partitions
DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=0

# Use hardlinks for partitionbootfiles
DEFAULT_LINK_BOOTPARTITIONFILES=0

# Send email only in case of errors. Use with care !
DEFAULT_MAIL_ON_ERROR_ONLY=0

# If version is marked as deprecated and buggy then update version
DEFAULT_HANDLE_DEPRECATED=1

# report uuid
DEFAULT_USE_UUID=1

# Check for bad blocks when formating restore device (Will take a long time)
DEFAULT_CHECK_FOR_BAD_BLOCKS=0

# Resize root filesystem during restore
DEFAULT_RESIZE_ROOTFS=1

# add timestamps in front of messages
DEFAULT_TIMESTAMPS=0


# GENERATED - DO NOT DELETE
UUID=438d420a-e7f8-4642-8749-98b9efbe92be
20180723-203741: MSG  --- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
20180723-203741: DBG     >> downloadPropertiesFile
20180723-203741: DBG        >> shouldDownloadPropertiesFile
20180723-203741: DBG        -- 20180723 : 20180723
20180723-203741: DBG        -- Skip download
20180723-203741: DBG        << shouldDownloadPropertiesFile - rc: 1
20180723-203741: DBG        >> parsePropertiesFile
20180723-203741: DBG        -- Properties: v: 0.6.3.2a i:  d:  b: 0.6.4
20180723-203741: DBG        << parsePropertiesFile
20180723-203741: DBG     << downloadPropertiesFile - 0
20180723-203741: DBG     >> isVersionDeprecated 0.6.4-beta
20180723-203741: DBG     << isVersionDeprecated 1
20180723-203741: DBG     >> doit
20180723-203741: DBG     -- Startingdirectory: /root/raspi
20180723-203741: DBG     -- fdisk -l
Disk /dev/ram0: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mmcblk1: 29,8 GiB, 32010928128 bytes, 62521344 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: 0x0003f9f7

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk1p1        2048   264191   262144  128M  c W95 FAT32 (LBA)
/dev/mmcblk1p2      264192 62521343 62257152 29,7G 83 Linux


Disk /dev/sda: 465,8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x37442cfb

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1        2048 976773167 976771120 465,8G 83 Linux
20180723-203741: DBG     -- mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=950948k,nr_inodes=186195,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=204244k,mode=755)
/dev/mmcblk1p2 on / type ext4 (rw,noatime,nobarrier,errors=remount-ro,commit=300,stripe=32596)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=37,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,sync,size=524288k)
/dev/mmcblk1p1 on /media/boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/sda1 on /media/sda type ext4 (rw,noatime,nobarrier,errors=remount-ro,stripe=8191,data=ordered)
/dev/sda1 on /var/www/Album type ext4 (rw,noatime,nobarrier,errors=remount-ro,stripe=8191,data=ordered)
/dev/sda1 on /var/www/_h5ai/public/cache/thumbs type ext4 (rw,noatime,nobarrier,errors=remount-ro,stripe=8191,data=ordered)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=204244k,mode=700)
20180723-203741: DBG        >> doitBackup 0
20180723-203741: DBG        -- TRAP cleanup SIGINT SIGTERM EXIT
20180723-203741: DBG           >> reportNews
20180723-203741: DBG              >> isUpdatePossible
20180723-203741: DBG                 >> isNewVersionAvailable
20180723-203741: DBG                 -- Versionsplit: 0.6.4 - beta
20180723-203741: DBG                 -- Returning: 0.0 0.0 0.6.4-beta
20180723-203741: DBG                 << isNewVersionAvailable - RC: 99
20180723-203741: DBG              << isUpdatePossible
20180723-203741: DBG           << reportNews
20180723-203741: DBG           >> getRootPartition
20180723-203741: DBG           -- cat /proc/cmdline
console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0  HPD=true vout=hdmi usbhid.quirks=0x0eef:0x0005:0x0004 smsc95xx.macaddr=00:1e:06:61:7a:39 false s5p_mfc.mem=16M
20180723-203741: DBG           -- RootPartition: UUID=e139ce78-9841-40fe-8823-96a304a09859
20180723-203741: DBG           << getRootPartition: UUID=e139ce78-9841-40fe-8823-96a304a09859
20180723-203741: DBG           >> inspect4Backup
20180723-203741: DBG           -- /boot mounted?
20180723-203741: DBG           -- Some path in /boot mounted? /dev/mmcblk1p1 on /media/boot
20180723-203741: DBG           -- / mounted? /dev/mmcblk1p2
20180723-203741: DBG              >> deviceInfo: /dev/mmcblk1p1
20180723-203741: DBG              << deviceInfo: mmcblk1 1
20180723-203741: DBG              >> deviceInfo: /dev/mmcblk1p2
20180723-203741: DBG              << deviceInfo: mmcblk1 2
20180723-203741: DBG           -- boot:
20180723-203741: DBG           -- root:
20180723-203741: MSG           --- RBK0200I: /boot and root located on same device .
20180723-203741: DBG           -- BOOT_DEVICE:
20180723-203741: DBG           -- BOOT_DEVICENAME: /dev/
20180723-203741: DBG              >> getPartitionPrefix:
20180723-203741: DBG              -- device:
20180723-203742: MSG              ??? RBK0001E: Unexpected program error occured. Git commit: 68542b2, Linenumber: 1507, Error: Unable to retrieve partition prefix for device .
20180723-203742: MSG              ??? RBK0148E: @@@@@@@@@@@@@@@@@@@@ Stacktrace @@@@@@@@@@@@@@@@@@@@
20180723-203742: DBG           -- BOOT_PARTITION_PREFIX:   File "raspiBackup.sh", line 5796, in main
    doit #      no return for backup
  File "raspiBackup.sh", line 3686, in doit
                doitBackup
  File "raspiBackup.sh", line 4072, in doitBackup
        inspect4Backup
  File "raspiBackup.sh", line 3954, in inspect4Backup
        BOOT_PARTITION_PREFIX="$(getPartitionPrefix $BOOT_DEVICE)" # mmcblk0p - sda
  File "raspiBackup.sh", line 1507, in getPartitionPrefix
                assertionFailed $LINENO "Unable to retrieve partition prefix for device $1"
  File "raspiBackup.sh", line 1110, in assertionFailed
        logStack
20180723-203742: DBG           << inspect4Backup
20180723-203742: DBG           >> commonChecks
20180723-203742: DBG           << commonChecks
20180723-203742: DBG           >> getFsType: /media/sda/autohiperboreabackup
20180723-203742: DBG           << getFsType: ext4
20180723-203742: MSG        ??? RBK0016E: No sd card /dev/ found.
20180723-203742: DBG           >> exitError 107
20180723-203742: DBG           << exitError 107
20180723-203742: DBG           >> cleanup
20180723-203742: DBG              >> cleanupBackup
20180723-203742: DBG              -- Got trap EXIT
20180723-203742: DBG              -- rc: 107
Invocation parms: ''
20180723-203742: DBG                 >> sendEMail
20180723-203742: DBG                 -- Sending eMail with program mail and parms ''
20180723-203742: DBG                 -- Parm1:??? RBK0005E: Backup failed. Check previous error messages for details. Parm2:hiperborea: Backup failed !!!.
20180723-203742: DBG                 -- Content:
--- RBK0009I: hiperborea: raspiBackup.sh V0.6.4-beta (68542b2) started at Mo 23. Jul 20:37:40 CEST 2018.
!!! RBK0165W: =========> NOTE  <=========
!!! RBK0165W: This is a betaversion and should not be used in production.
!!! RBK0165W: =========> NOTE <=========
--- RBK0128I: Using logfile /media/sda/autohiperboreabackup/hiperborea/hiperborea-ddz-backup-20180723-203740/hiperborea-backup.log.
--- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
--- RBK0200I: /boot and root located on same device .
??? RBK0001E: Unexpected program error occured. Git commit: 68542b2, Linenumber: 1507, Error: Unable to retrieve partition prefix for device .
??? RBK0148E: @@@@@@@@@@@@@@@@@@@@ Stacktrace @@@@@@@@@@@@@@@@@@@@
??? RBK0016E: No sd card /dev/ found.
??? RBK0005E: Backup failed. Check previous error messages for details.

20180723-203742: DBG                 -- echo
--- RBK0009I: hiperborea: raspiBackup.sh V0.6.4-beta (68542b2) started at Mo 23. Jul 20:37:40 CEST 2018.
!!! RBK0165W: =========> NOTE  <=========
!!! RBK0165W: This is a betaversion and should not be used in production.
!!! RBK0165W: =========> NOTE <=========
--- RBK0128I: Using logfile /media/sda/autohiperboreabackup/hiperborea/hiperborea-ddz-backup-20180723-203740/hiperborea-backup.log.
--- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
--- RBK0200I: /boot and root located on same device .
??? RBK0001E: Unexpected program error occured. Git commit: 68542b2, Linenumber: 1507, Error: Unable to retrieve partition prefix for device .
??? RBK0148E: @@@@@@@@@@@@@@@@@@@@ Stacktrace @@@@@@@@@@@@@@@@@@@@
??? RBK0016E: No sd card /dev/ found.
??? RBK0005E: Backup failed. Check previous error messages for details.
 | mail  -s hiperborea: Backup failed !!!.  elespiritudel82@gmail.com
20180723-203742: DBG                 -- mail: RC: 0
20180723-203742: DBG                 << sendEMail
20180723-203742: DBG                 >> cleanupBackupDirectory
20180723-203742: DBG                 -- BackupDir created: 1
20180723-203742: MSG                 --- RBK0026I: Saving logfile in /root/hiperborea-raspiBackup.log.
20180723-203742: MSG                 --- RBK0195I: Logfile saved in /root/hiperborea-raspiBackup.log.
20180723-203742: MSG                 --- RBK0105I: Deleting new backup directory /media/sda/autohiperboreabackup/hiperborea/hiperborea-ddz-backup-20180723-203740.
20180723-203742: MSG                 ??? RBK0005E: Backup failed. Check previous error messages for details.
20180723-203742: DBG                 << cleanupBackup
20180723-203742: DBG                 >> cleanupTempFiles
20180723-203742: DBG                 -- Removing mailfile /tmp/raspiBackup.maillog
20180723-203742: DBG                 << cleanupTempFiles

@framps
Copy link
Owner

framps commented Jul 23, 2018

20180723-203741: DBG >> deviceInfo: /dev/mmcblk1p1
20180723-203741: DBG << deviceInfo: mmcblk1 1
20180723-203741: DBG >> deviceInfo: /dev/mmcblk1p2
20180723-203741: DBG << deviceInfo: mmcblk1 2
20180723-203741: DBG -- boot:
20180723-203741: DBG -- root:

looks pretty good. The discovery of boot and root succeeded and logged. But the result was not returned from deviceInfo to it's caller and caused the panic 😞

Fixed now 😃

@jobenvil
Copy link

awesome, it works! it looks like really good... 👍

root@hiperborea ~/raspi # bash raspiBackup.sh
--- RBK0009I: hiperborea: raspiBackup.sh V0.6.4-beta (68542b2) started at Mo 23. Jul 21:04:36 CEST 2018.
!!! RBK0165W: =========> NOTE  <=========
!!! RBK0165W: This is a betaversion and should not be used in production.
!!! RBK0165W: =========> NOTE <=========
--- RBK0128I: Using logfile /media/sda/autohiperboreabackup/hiperborea/hiperborea-ddz-backup-20180723-210436/hiperborea-backup.log.
--- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
--- RBK0200I: /boot and / located on same device mmcblk1.
--- RBK0151I: Using backuppath /media/sda/autohiperboreabackup.
--- RBK0008I: Stopping services: 'service seahub stop %1%1 service seafile stop %1%1 service minidlna stop %1%1 service subsonic stop %1%1  service webmin stop %1%1 service memcached stop %1%1 service php7.0-fpm stop %1%1 service nginx stop %1%1 service smbd stop %1%1 service nmbd stop %1%1 service noip2 stop %1%1 service mysql stop %1%1 service cron stop %1%1 service exim4 stop'.
--- RBK0081I: Creating backup of type ddz in /media/sda/autohiperboreabackup/hiperborea/hiperborea-ddz-backup-20180723-210436.
--- RBK0085I: Backup of type ddz started. Please be patient.

@framps
Copy link
Owner

framps commented Jul 23, 2018

Thank you very much for your tests 👍

Note: Even this version is called V0.6.4-beta this code will not make it into v0.6.4 which will be published end of this month. This discovery change has to be tested thoroughly and I'm waiting for others to test the discovery also. But this change will most probably make it into v0.6.5. If you want to keep this new discovery you shouldn't upgrade to v0.6.4 end of this month.

@jobenvil
Copy link

Thanks again @framps , I will consider this. The "dd" backup script worked perfectly. The "dd" option restore process as well. I tested the restore image with a brand new Samsung Evo plus microSD card in order to be totally sure that the odroid blobs were successfully copied. Maybe you should advise or warn them, the Odroid users, that the only possible back/restore method is the "dd".

One note remark. After the system comes up with new restored image, it is necessary to fix the journal. You see that at the end of dmesg logfile. It is only necessary to shutdown the system with the friendly option "-r" in order to be checked the file system at the next start up. Because I have "fsck.repair=yes" on the start command line, the posible journal errors will be fixed. After the new restart, the journal it is fixed.

@framps
Copy link
Owner

framps commented Jul 24, 2018

Thank you very much to point out the fsck issue. Frankly the regression tests are executed on a stretch image which includes fsck.repair=yes. But it's a good idea to force fsck the first time a restored image is started. That's another step to execute when restoring the image. I'll create an issue for this.

Maybe you should advise or warn them, the Odroid users, that the only possible back/restore method is the "dd".

raspiBackup target and supported platform is Raspberry but it's working on other SOCs and I know it's also successfully used by users. I frankly have no complete picture which SOCs work with raspiBackup and thus don't have any table of SOCs capable to run raspiBackup. I will take your idea and create a table of tolerated SOCs. Will add Odroid with a remark to use DD only. Hope other's will comment on this table so more and more SOCs will be populated in there.

@framps
Copy link
Owner

framps commented Aug 11, 2018

The development branch for next release includes the new boot discovery code. Please use this code for verification now.

@tpm8
Copy link

tpm8 commented Aug 20, 2018

Just tested raspiBackup on a Odroid HC1 running armbian debian stretch from the development branch for next release.

But it's failing because of deviceInfo:

root@hc1:/usr/local/bin# ./raspiBackup.sh -l Debug
--- RBK0009I: hc1: raspiBackup.sh V0.6.4.1-dev (beba3df) started at Mon Aug 20 22:44:41 CEST 2018.
!!! RBK0192W: =========> NOTE  <=========
!!! RBK0173W: This is a development version and should not be used in production.
!!! RBK0173W: =========> NOTE <=========
--- RBK0128I: Using logfile /nfs/hc1/raspiBackup/hc1/hc1-dd-backup-20180820-224441/hc1-backup.log.
--- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
./raspiBackup.sh: line 3943: deviceInfo: command not found
./raspiBackup.sh: line 3944: deviceInfo: command not found
--- RBK0200I: /boot and root located on same device .
??? RBK0001E: Unexpected program error occured. Git commit: beba3df, Linenumber: 1515, Error: Unable to retrieve partition prefix for device .
??? RBK0148E: @@@@@@@@@@@@@@@@@@@@ Stacktrace @@@@@@@@@@@@@@@@@@@@
??? RBK0016E: No sd card /dev/ found.
--- RBK0026I: Saving logfile in /root/hc1-raspiBackup.log.
--- RBK0195I: Logfile saved in /root/hc1-raspiBackup.log.
--- RBK0105I: Deleting new backup directory /nfs/hc1/raspiBackup/hc1/hc1-dd-backup-20180820-224441.
??? RBK0005E: Backup failed. Check previous error messages for details.

Searched for deviceInfo using apt-find ( even on a raspian rpi3 ) but without success. What am I missing?

@framps
Copy link
Owner

framps commented Aug 21, 2018

@tpm8 Thank you very much for testing. Unfortunately i missed to copy a function called deviceInfo in the dev branch code 😢 . I just fixed it. Please try again 😄

@tpm8
Copy link

tpm8 commented Aug 21, 2018

Thanks for fixing @framps I'm glad to help testing for armbian based devices. Unfortunately we're not quite there - now the dd backup fails with error RBK0016E:

20180821-225825: DBG  -- LOG_OUTPUT: 2
20180821-225825: DBG  -- Using logfile /root/hc1-raspiBackup.log
20180821-225825: DBG  -- raspiBackup.sh 0.6.4.1-dev, 2018-08-21/21:03:50 - 8f3b75d
20180821-225825: DBG  -- BACKUPTARGET_DIR: /nfs/hc1/raspiBackup/hc1/hc1-dd-backup-20180821-225824
20180821-225825: DBG  -- BACKUPTARGET_FILE: /nfs/hc1/raspiBackup/hc1/hc1-dd-backup-20180821-225824/hc1-dd-backup-20180821-225824.img
20180821-225825: DBG     >> logOptions
20180821-225825: DBG     -- Linux hc1 4.14.54-odroidxu4 #2 SMP PREEMPT Sun Jul 8 17:16:37 CEST 2018 armv7l GNU/Linux
20180821-225825: DBG     -- Options:  -l Debug
20180821-225825: DBG     << logOptions
20180821-225825: DBG  -- APPEND_LOG=0
20180821-225825: DBG  -- APPEND_LOG_OPTION=-a
20180821-225825: DBG  -- BACKUPPATH=/nfs/hc1/raspiBackup
20180821-225825: DBG  -- BACKUPTYPE=dd
20180821-225825: DBG  -- CHECK_FOR_BAD_BLOCKS=0
20180821-225825: DBG  -- CONFIG_FILE=
20180821-225825: DBG  -- DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=0
20180821-225825: DBG  -- DD_BLOCKSIZE=1MB
20180821-225825: DBG  -- DD_PARMS=
20180821-225825: DBG  -- DEFAULT_DEPLOYMENT_HOSTS=
20180821-225825: DBG  -- DEFAULT_YES_NO_RESTORE_DEVICE=loop
20180821-225825: DBG  -- EMAIL=
20180821-225825: DBG  -- EMAIL_PARMS=
20180821-225825: DBG  -- EXCLUDE_LIST=
20180821-225825: DBG  -- EXTENSIONS=
20180821-225825: DBG  -- FAKE=0
20180821-225825: DBG  -- HANDLE_DEPRECATED=1
20180821-225825: DBG  -- KEEPBACKUPS=2
20180821-225825: DBG  -- LANGUAGE=EN
20180821-225825: DBG  -- LINK_BOOTPARTITIONFILES=0
20180821-225825: DBG  -- LOG_LEVEL=1
20180821-225825: DBG  -- LOG_OUTPUT=2
20180821-225825: DBG  -- MAIL_ON_ERROR_ONLY=0
20180821-225825: DBG  -- MAIL_PROGRAM=mail
20180821-225825: DBG  -- MSG_LEVEL=1
20180821-225825: DBG  -- NOTIFY_UPDATE=1
20180821-225825: DBG  -- PARTITIONBASED_BACKUP=0
20180821-225825: DBG  -- PARTITIONS_TO_BACKUP=*
20180821-225825: DBG  -- RESIZE_ROOTFS=1
20180821-225825: DBG  -- RESTORE_DEVICE=
20180821-225825: DBG  -- RESTORE_REMINDER_INTERVAL=6
20180821-225825: DBG  -- RESTORE_REMINDER_REPEAT=3
20180821-225825: DBG  -- ROOT_PARTITION=
20180821-225825: DBG  -- RSYNC_BACKUP_ADDITIONAL_OPTIONS=
20180821-225825: DBG  -- RSYNC_BACKUP_OPTIONS=-aHAxX
20180821-225825: DBG  -- RSYNC_IGNORE_ERRORS=
20180821-225825: DBG  -- SENDER_EMAIL=
20180821-225825: DBG  -- SKIPLOCALCHECK=0
20180821-225825: DBG  -- STARTSERVICES=systemctl start smbd
20180821-225825: DBG  -- STOPSERVICES=systemctl stop smbd
20180821-225825: DBG  -- SYSTEMSTATUS=0
20180821-225825: DBG  -- TAR_BACKUP_ADDITIONAL_OPTIONS=
20180821-225825: DBG  -- TAR_BACKUP_OPTIONS=-cpi
20180821-225825: DBG  -- TAR_BOOT_PARTITION_ENABLED=0
20180821-225825: DBG  -- TAR_IGNORE_ERRORS=
20180821-225825: DBG  -- TAR_RESTORE_ADDITIONAL_OPTIONS=
20180821-225825: DBG  -- TIMESTAMPS=0
20180821-225825: DBG  -- USE_HARDLINKS=1
20180821-225825: DBG  -- VERBOSE=0
20180821-225825: DBG  -- ZIP_BACKUP=0
20180821-225825: DBG     >> logSystem
20180821-225825: DBG     -- PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
20180821-225825: DBG     -- 9.5
20180821-225825: DBG     << logSystem
20180821-225825: MSG  --- RBK0128I: Using logfile /nfs/hc1/raspiBackup/hc1/hc1-dd-backup-20180821-225824/hc1-backup.log.
20180821-225825: DBG  -- /etc/config
#
# Default configuration file for raspiBackup.sh
#
# (C) 2013,2018 framp at linux-tips-and-tricks dot de
#
# Details for options see
# http://www.linux-tips-and-tricks.de/de/raspibackup/#parameter
#
# $Date: 2018-08-10 22:33:43 +0200$
# $Sha1: aee8ddc$

#####################################################
# Note:
#
# 0 turns an option off
# 1 turns an option on
#####################################################

# path to store the backupfile
DEFAULT_BACKUPPATH="/nfs/hc1/raspiBackup"

# how many backups to keep
DEFAULT_KEEPBACKUPS="2"

# type of backup: dd, tar or rsync
DEFAULT_BACKUPTYPE="dd"

# zip tar or dd backup
DEFAULT_ZIP_BACKUP="0"

# dd backup will save space used by partitions only
DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=0

# commands to stop services before backup separated by &&
DEFAULT_STOPSERVICES="systemctl stop smbd"

# commands to start services after backup separated by &&
DEFAULT_STARTSERVICES="systemctl start smbd"

# email to send completion status
DEFAULT_EMAIL=""

# Additional parameters for email program (optional)
DEFAULT_EMAIL_PARMS=""

# log level
DEFAULT_LOG_LEVEL=0

# log output ( 0 = syslog, 1 = /var/log, 2 = backuppath)
DEFAULT_LOG_OUTPUT=2

# msg level (0 = minimal, 1 = detailed)
DEFAULT_MSG_LEVEL="1"

# mailprogram
DEFAULT_MAIL_PROGRAM="mail"

# restore device
DEFAULT_RESTORE_DEVICE=""

# default append log
DEFAULT_APPEND_LOG=0

# option used by mail program to append log (for example -a or -A)
DEFAULT_APPEND_LOG_OPTION="-a"

# default verbose log
DEFAULT_VERBOSE=0

# skip check for remote mount of backup path (0 = false, 1 = true)
DEFAULT_SKIPLOCALCHECK=0

# blocksize used for dd
DEFAULT_DD_BLOCKSIZE=1MB

# addition parms used for dd
DEFAULT_DD_PARMS=""

# exclude list
DEFAULT_EXCLUDE_LIST=""

# notify in email if there is an updated script version available  (0 = false, 1 = true)
DEFAULT_NOTIFY_UPDATE=1

# extensions to call
DEFAULT_EXTENSIONS=""

# partition based backup
DEFAULT_PARTITIONBASED_BACKUP="0"

# partition numbers of partitions to save in partitionbased backup mode
DEFAULT_PARTITIONS_TO_BACKUP="*"

# language (DE or EN)
DEFAULT_LANGUAGE="EN"

# hosts which will get the updated backup script with parm -y - non pwd access with keys has to be enabled
# Example: "root@raspberrypi root@fhem root@openhab root@magicmirror"
DEFAULT_DEPLOYMENT_HOSTS=""

# Don't ask for restore confirmation if restore device is loop. Use with care !
DEFAULT_YES_NO_RESTORE_DEVICE="loop"

# with dd backup save only space used by partitions
DEFAULT_DD_BACKUP_SAVE_USED_PARTITIONS_ONLY=0

# Use hardlinks for partitionbootfiles
DEFAULT_LINK_BOOTPARTITIONFILES=0

# use hardlinks for rsync if possible
DEFAULT_USE_HARDLINKS=1

# save boot partition with tar
DEFAULT_TAR_BOOT_PARTITION_ENABLED=0

# Backup and restore options used for tar and rsync. Change these options only if you know what you are doing !!!
DEFAULT_RSYNC_BACKUP_OPTIONS="-aHAxX"
DEFAULT_RSYNC_BACKUP_ADDITIONAL_OPTIONS=""
DEFAULT_TAR_BACKUP_OPTIONS="-cpi"
DEFAULT_TAR_BACKUP_ADDITIONAL_OPTIONS=""
DEFAULT_TAR_RESTORE_ADDITIONAL_OPTIONS=""

# Send email only in case of errors. Use with care !
DEFAULT_MAIL_ON_ERROR_ONLY=0

# If version is marked as deprecated and buggy then update version
DEFAULT_HANDLE_DEPRECATED=1

# report uuid
DEFAULT_USE_UUID=1

# Check for bad blocks when formating restore device (Will take a long time)
DEFAULT_CHECK_FOR_BAD_BLOCKS=0

# Resize root filesystem during restore
DEFAULT_RESIZE_ROOTFS=1

# add timestamps in front of messages
DEFAULT_TIMESTAMPS=0

# add system status in debug log (Attention: may expose sensible information)
DEFAULT_SYSTEMSTATUS=0

# GENERATED - DO NOT DELETE
UUID=cf711a56-29af-473b-9a01-c29363bcea3f
20180821-225825: MSG  --- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
20180821-225825: DBG     >> downloadPropertiesFile
20180821-225825: DBG        >> shouldDownloadPropertiesFile
20180821-225825: DBG        -- 20180821 : 20180821
20180821-225825: DBG        -- Skip download
20180821-225825: DBG        << shouldDownloadPropertiesFile - rc: 1
20180821-225825: DBG        >> parsePropertiesFile
20180821-225825: DBG        -- Properties: v: 0.6.4 i:  d:  b:
20180821-225825: DBG        << parsePropertiesFile
20180821-225825: DBG     << downloadPropertiesFile - 0
20180821-225826: DBG     >> isVersionDeprecated 0.6.4.1-dev
20180821-225826: DBG     << isVersionDeprecated 1
20180821-225826: DBG     >> updateRestoreReminder
20180821-225826: DBG     << updateRestoreReminder
20180821-225826: DBG     >> doit
20180821-225826: DBG     -- Startingdirectory: /usr/local/bin
20180821-225826: DBG     -- fdisk -l
Disk /dev/ram0: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 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: 0xcb1abb4b

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       8192 59836159 59827968 28.5G 83 Linux


Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0xe5eb8eae

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1        2048 488397167 488395120 232.9G 83 Linux


Disk /dev/zram0: 50 MiB, 52428800 bytes, 12800 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


Disk /dev/zram1: 249.4 MiB, 261484544 bytes, 63839 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


Disk /dev/zram2: 249.4 MiB, 261484544 bytes, 63839 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


Disk /dev/zram3: 249.4 MiB, 261484544 bytes, 63839 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


Disk /dev/zram4: 249.4 MiB, 261484544 bytes, 63839 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
20180821-225826: DBG     -- mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=952548k,nr_inodes=186994,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=204284k,mode=755)
/dev/mmcblk0p1 on / type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,relatime)
/dev/sda1 on /opt type xfs (rw,noatime,nodiratime,attr2,inode64,noquota)
/dev/mmcblk0p1 on /var/log.hdd type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600)
/dev/zram0 on /var/log type ext4 (rw,relatime,block_validity,delalloc,nojournal_checksum,barrier,user_xattr,acl)
/etc/auto.nfs on /nfs type autofs (rw,relatime,fd=6,pgrp=1498,timeout=300,minproto=5,maxproto=5,indirect)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=204280k,mode=700)
qnastm08:/share/Backup/hc1 on /nfs/hc1 type nfs (rw,relatime,vers=3,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.8.8,mountvers=3,mountport=30000,mountproto=udp,local_lock=none,addr=192.168.8.8)
20180821-225826: DBG        >> doitBackup 0
20180821-225826: DBG        -- TRAP cleanup SIGINT SIGTERM EXIT
20180821-225826: DBG           >> reportNews
20180821-225826: DBG              >> isUpdatePossible
20180821-225826: DBG                 >> isNewVersionAvailable
20180821-225826: DBG                 -- Versionsplit: 0.6.4.1 - dev
20180821-225826: DBG                 -- Returning: 0.0 0.0 0.6.4.1-dev
20180821-225826: DBG                 << isNewVersionAvailable - RC: 99
20180821-225826: DBG              << isUpdatePossible
20180821-225826: DBG              >> isBetaAvailable
20180821-225826: DBG              << isBetaAvailable:
20180821-225826: DBG           << reportNews
20180821-225826: DBG           >> getRootPartition
20180821-225826: DBG           -- cat /proc/cmdline
console=tty1 console=ttySAC2,115200n8 consoleblank=0 loglevel=1 panic=10 root=UUID=c010aada-af30-48ea-8142-6fc986d2d05a rootfstype=ext4 rootwait rw  smsc95xx.macaddr=00:1e:06:61:7a:55 governor=performance hdmi_tx_amp_lvl=31 hdmi_tx_lvl_ch0=3 hdmi_tx_lvl_ch1=3 hdmi_tx_lvl_ch2=3 hdmi_tx_emp_lvl=6 hdmi_clk_amp_lvl=31 hdmi_tx_res=0 HPD=true vout=hdmi usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u net.ifnames=0 s3c2410-wdt.tmr_margin=30 s3c2410-wdt.tmr_atboot=1 s3c2410-wdt.nowayout=0 s3c2410-wdt.debug=1 s5p_mfc.mem=16M
20180821-225826: DBG           -- RootPartition: UUID=c010aada-af30-48ea-8142-6fc986d2d05a
20180821-225826: DBG           << getRootPartition: UUID=c010aada-af30-48ea-8142-6fc986d2d05a
20180821-225826: DBG           >> inspect4Backup
20180821-225826: DBG           -- ls /dev/mmcblk*:
/dev/mmcblk0
/dev/mmcblk0p1
20180821-225826: DBG           -- ls /dev/sd*:
/dev/sda
/dev/sda1
20180821-225826: DBG           -- mountpoint /boot: /boot is not a mountpoint mountpoint /: 179:1
20180821-225826: DBG           -- Legacy boot discovery
20180821-225826: DBG           -- part:
20180821-225826: DBG           -- bootDeviceNumber: /boot is not a mountpoint
20180821-225826: DBG           -- rootDeviceNumber: 179:1
20180821-225826: DBG           -- Starting alternate boot discovery
20180821-225826: DBG           -- /boot mounted?
20180821-225827: DBG           -- Some path in /boot mounted?  on
20180821-225827: DBG           -- / mounted? /dev/mmcblk0p1
20180821-225827: DBG           -- Bootpartition is located on rootpartition /dev/mmcblk0p1
20180821-225827: DBG              >> deviceInfo: /dev/mmcblk0p1
20180821-225827: DBG              << deviceInfo: mmcblk0 1
20180821-225827: DBG              >> deviceInfo: /dev/mmcblk0p1
20180821-225827: DBG              << deviceInfo: mmcblk0 1
20180821-225827: DBG           -- boot:
20180821-225827: DBG           -- root:
20180821-225827: MSG           --- RBK0200I: /boot and root located on same device .
20180821-225827: DBG           -- BOOT_DEVICE:
20180821-225827: DBG           -- BOOT_DEVICENAME: /dev/
20180821-225827: DBG              >> getPartitionPrefix:
20180821-225827: DBG              -- device:
20180821-225827: MSG              ??? RBK0001E: Unexpected program error occured. Git commit: 8f3b75d, Linenumber: 1515, Error: Unable to retrieve partition prefix for device .
20180821-225827: MSG              ??? RBK0148E: @@@@@@@@@@@@@@@@@@@@ Stacktrace @@@@@@@@@@@@@@@@@@@@
20180821-225827: DBG           -- BOOT_PARTITION_PREFIX:   File "./raspiBackup.sh", line 5910, in main
    doit #      no return for backup
  File "./raspiBackup.sh", line 3689, in doit
                doitBackup
  File "./raspiBackup.sh", line 4111, in doitBackup
        inspect4Backup
  File "./raspiBackup.sh", line 3993, in inspect4Backup
        BOOT_PARTITION_PREFIX="$(getPartitionPrefix $BOOT_DEVICE)" # mmcblk0p - sda
  File "./raspiBackup.sh", line 1515, in getPartitionPrefix
                assertionFailed $LINENO "Unable to retrieve partition prefix for device $1"
  File "./raspiBackup.sh", line 1108, in assertionFailed
        logStack
20180821-225827: DBG           << inspect4Backup
20180821-225827: DBG           >> commonChecks
20180821-225827: DBG           << commonChecks
20180821-225827: DBG           >> getFsType: /nfs/hc1/raspiBackup
20180821-225827: DBG           << getFsType:
20180821-225827: MSG        ??? RBK0016E: No sd card /dev/ found.
20180821-225827: DBG           >> exitError 107
20180821-225827: DBG           << exitError 107
20180821-225827: DBG           >> cleanup
20180821-225827: DBG              >> cleanupBackup
20180821-225827: DBG              -- Got trap EXIT
20180821-225827: DBG              -- rc: 107
Invocation parms: ' -l Debug'
20180821-225827: DBG                 >> sendEMail
20180821-225827: DBG                 << sendEMail
20180821-225827: DBG                 >> cleanupBackupDirectory
20180821-225827: DBG                 -- BackupDir created: 1
20180821-225827: MSG                 --- RBK0026I: Saving logfile in /root/hc1-raspiBackup.log.
20180821-225827: MSG                 --- RBK0195I: Logfile saved in /root/hc1-raspiBackup.log.
20180821-225827: MSG                 --- RBK0105I: Deleting new backup directory /nfs/hc1/raspiBackup/hc1/hc1-dd-backup-20180821-225824.
20180821-225827: MSG                 ??? RBK0005E: Backup failed. Check previous error messages for details.
20180821-225827: DBG                 << cleanupBackup
20180821-225827: DBG                 >> cleanupTempFiles
20180821-225827: DBG                 -- Removing mailfile /tmp/raspiBackup.maillog
20180821-225827: DBG                 << cleanupTempFiles
20180821-225827: DBG              -- Terminate now with rc 107

@framps
Copy link
Owner

framps commented Aug 22, 2018

@tpm8 Thank you again for testing. I just uploaded a fix into the dev branch. Please try again 😄

@tpm8
Copy link

tpm8 commented Aug 22, 2018

@framps Thanks - now the backup seems to work perfectly. Still have to do a restore test, but restoring a dd image won't be a problem.

root@hc1:/usr/local/bin# ./raspiBackup.sh -l Debug
--- RBK0009I: hc1: raspiBackup.sh V0.6.4.1-dev (3452782) started at Wed Aug 22 21:00:50 CEST 2018.
!!! RBK0192W: =========> NOTE  <=========
!!! RBK0173W: This is a development version and should not be used in production.
!!! RBK0173W: =========> NOTE <=========
--- RBK0128I: Using logfile /nfs/hc1/raspiBackup/hc1/hc1-dd-backup-20180822-210049/hc1-backup.log.
--- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
--- RBK0031I: Checking whether a new version of raspiBackup.sh is available.
--- RBK0200I: /boot and root located on same device mmcblk0.
--- RBK0151I: Using backuppath /nfs/hc1/raspiBackup.
--- RBK0008I: Stopping services: 'systemctl stop smbd'.
--- RBK0081I: Creating backup of type dd in /nfs/hc1/raspiBackup/hc1/hc1-dd-backup-20180822-210049.
--- RBK0085I: Backup of type dd started. Please be patient.
--- RBK0007I: Starting services: 'systemctl start smbd'.
--- RBK0010I: hc1: raspiBackup.sh V0.6.4.1-dev (3452782) stopped at Wed Aug 22 21:13:05 CEST 2018.
--- RBK0017I: Backup finished successfully.

@framps
Copy link
Owner

framps commented Aug 22, 2018

@tpm8 Great the discovery works now. Frankly you don't need to execute a restore test with dd. That will work - for sure. I want to enable also tar and rsync backups when boot and root are located on the same device. I didn't find any spare time to implement this until now. Do you volunteer to execute a backup and restore test when this feature is available (ETA approx in 2 months) 😆

@tpm8
Copy link

tpm8 commented Aug 22, 2018

Yes - for sure I'm keen to test rsync / tar backup functions, when they are available. Currently I'm using rsnapshot for file based, versioned backups. But I'd rather consolidate all the backups ( dd and file based ) into just one tool. Just drop me a line then...

@framps
Copy link
Owner

framps commented Sep 19, 2018

@tpm See https://github.com/framps/raspiBackup/tree/shared_backup_restore for a version of raspiBackup which should backup/restore images where the root and boot directory are on one partition. Please grab the code an verify with tar and/or rsync with your system.

@tpm8
Copy link

tpm8 commented Sep 24, 2018

@framps - tested with above code on two armbian based systems with root and boot directory on one partition. Backup tests ( dd, rsync, tar ) all worked without errror.

dd - Image:

root@opizero:/usr/local/bin# ./raspiBackup.sh -l Debug
--- RBK0009I: opizero: raspiBackup.sh V0.6.4.1-dev (4862cdc) started at Fri Sep 21 22:38:41 CEST 2018.
!!! RBK0192W: =========> NOTE  <=========
!!! RBK0173W: This is a development version and should not be used in production.
!!! RBK0173W: =========> NOTE <=========
--- RBK0128I: Using logfile /nfs/opizero/raspiBackup/opizero/opizero-dd-backup-20180921-223840/opizero-backup.log.
--- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
--- RBK0031I: Checking whether a new version of raspiBackup.sh is available.
--- RBK0200I: /boot and / located on same device mmcblk0.
--- RBK0151I: Using backuppath /nfs/opizero/raspiBackup.
--- RBK0008I: Stopping services: 'systemctl stop fhem'.
--- RBK0081I: Creating backup of type dd in /nfs/opizero/raspiBackup/opizero/opizero-dd-backup-20180921-223840.
--- RBK0085I: Backup of type dd started. Please be patient.
--- RBK0007I: Starting services: 'systemctl start fhem'.
--- RBK0010I: opizero: raspiBackup.sh V0.6.4.1-dev (4862cdc) stopped at Fri Sep 21 23:21:19 CEST 2018.
--- RBK0017I: Backup finished successfully.

root@opizero:/usr/local/etc# lsof / | awk 'NR==1 || $4~/[0-9][uw]/'
COMMAND     PID       USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
dhclient   1036       root    4w   REG  179,1     6636  37408 /var/lib/dhcp/dhclient.eth0.leases
tee        1248       root    3w   REG  179,1    20086   1113 /root/opizero-raspiBackup.log
tee        1250       root    3w   REG  179,1    20086   1113 /root/opizero-raspiBackup.log

I've noticed that during image (dd) backup, a log file -raspiBackup.log is written to /root. This could be a problem, as write accesses to the partition should be avoided during backup. Isn't there the risk of filesystem corruption after a restore?

rsync / tar:


root@opizero:/usr/local/bin# ./raspiBackup.sh -l Debug -g -t rsync
--- RBK0009I: opizero: raspiBackup.sh V0.6.4.1-dev (4862cdc) started at Sat Sep 22 10:21:57 CEST 2018.
!!! RBK0192W: =========> NOTE  <=========
!!! RBK0173W: This is a development version and should not be used in production.
!!! RBK0173W: =========> NOTE <=========
--- RBK0128I: Using logfile /nfs/opizero/raspiBackup/opizero/opizero-rsync-backup-20180922-102156/opizero-backup.log.
--- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
--- RBK0031I: Checking whether a new version of raspiBackup.sh is available.
--- RBK0200I: /boot and / located on same device mmcblk0.
--- RBK0151I: Using backuppath /nfs/opizero/raspiBackup.
--- RBK0008I: Stopping services: 'systemctl stop fhem'.
--- RBK0081I: Creating backup of type rsync in /nfs/opizero/raspiBackup/opizero/opizero-rsync-backup-20180922-102156.
--- RBK0158I: Creating native rsync backup "/nfs/opizero/raspiBackup/opizero/opizero-rsync-backup-20180922-102156".
--- RBK0085I: Backup of type rsync started. Please be patient.
  1,244,845,950  99%  989.32kB/s    0:20:28 (xfr#34882, to-chk=0/42920)
--- RBK0007I: Starting services: 'systemctl start fhem'.
--- RBK0010I: opizero: raspiBackup.sh V0.6.4.1-dev (4862cdc) stopped at Sat Sep 22 10:42:35 CEST 2018.
--- RBK0017I: Backup finished successfully.

root@opizero:/usr/local/bin# ./raspiBackup.sh -l Debug -g -t tar -z
--- RBK0009I: opizero: raspiBackup.sh V0.6.4.1-dev (4862cdc) started at Sat Sep 22 11:09:58 CEST 2018.
!!! RBK0192W: =========> NOTE  <=========
!!! RBK0173W: This is a development version and should not be used in production.
!!! RBK0173W: =========> NOTE <=========
--- RBK0128I: Using logfile /nfs/opizero/raspiBackup/opizero/opizero-tgz-backup-20180922-110957/opizero-backup.log.
--- RBK0116I: Using config file /usr/local/etc/raspiBackup.conf.
--- RBK0200I: /boot and / located on same device mmcblk0.
--- RBK0151I: Using backuppath /nfs/opizero/raspiBackup.
--- RBK0008I: Stopping services: 'systemctl stop fhem'.
--- RBK0081I: Creating backup of type tgz in /nfs/opizero/raspiBackup/opizero/opizero-tgz-backup-20180922-110957.
--- RBK0158I: Creating native tgz backup "/nfs/opizero/raspiBackup/opizero/opizero-tgz-backup-20180922-110957/opizero-tgz-backup-20180922-110957.tgz".
--- RBK0085I: Backup of type tgz started. Please be patient.
tar: Removing leading `/' from member names
/
/var/
/var/log/
/var/tmp/
/var/swap
...
/sys/
/selinux/
--- RBK0007I: Starting services: 'systemctl start fhem'.
--- RBK0010I: opizero: raspiBackup.sh V0.6.4.1-dev (4862cdc) stopped at Sat Sep 22 11:07:10 CEST 2018.
--- RBK0017I: Backup finished successfully.

Hadn't had the time to do a restore test so far.

@framps
Copy link
Owner

framps commented Sep 25, 2018

@tpm8 Thank you very much for your test. You don't need to execute a restore because I noticed there are some backup files missing for tar and rsync. I have to fix this. Will keep you posted.

Re you comment about log file in /root. There is no risk of file corruption but tar or rsync may complain about changing files during backup. I have to fix this also (Actually I worked on this issue already-but it looks like I missed some code path 😢 ).

@framps framps removed fixed Issue fixed to be verified Request was accepted and implemented and waiting for requestor verification of fix labels Sep 25, 2018
@framps
Copy link
Owner

framps commented Sep 25, 2018

Just noticed the issue actually is closed: dd backup. But there is an issue with tar and rsync backup. therefore I created new issue #73 and set this issue to fixed and closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement request
Projects
None yet
Development

No branches or pull requests

5 participants