Moode Forum
How to backup with "rpi-clone"? - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: How to backup with "rpi-clone"? (/showthread.php?tid=865)

Pages: 1 2


RE: How to backup with "rpi-clone"? - kitamura_design - 01-05-2019

(01-05-2019, 02:34 AM)Tim Curtis Wrote: Hi Kent,

It does live imaging or some sort of equavalent process?

I'll have to check it out :-)

Hi Tim,

Next, I tried the 'force initialized option (-f, and -f2)'.
Quote:pi@moode:~ $ sudo rpi-clone
No destination disk given.

usage: rpi-clone sdN {-v|--verbose} {-f|--force-initialize} {-f2}
         {-u|--unattended} {-U|--Unattended} {-q|--quiet}
         {-s|--setup host} {-e|--edit-fstab sdX } {-m|--mountdir dir }
         {-L|--label-partitions label} {-l|--leave-sd-usb-boot}
         {-a|--all-sync} {-F|--Force-sync} {-x} {-V|--version}
         {--convert-fstab-to-partuuid}

    -v    - verbose rsync, list all files as they are copied.
    -f    - force initialize the destination disk by imaging the booted disk
partition structure.  File systems are then synced or imaged.
    -f2    - force initialize only the first 2 partitions to the destination.
So a multi partition USB boot can initialize clone back to
a 2 partition SD card.
    -u    - unattended clone if not initializing.  No confirmations asked,
but abort if disk needs initializing or on error.
    -U      - unattended even if initializing. No confirmations asked,
                but abort only on errors.
    -q      - quiet mode, no output unless errors or initializing. Implies -u.
    -s host - add 'host' to args passed to script rpi-clone-setup and run it
                after cloning but before unmounting partitions. For setting
clone disk hostname, but args can be what the script expects.
                You can give multiple -s arg options.
    -e sdX  - edit destination fstab to change booted device names to new
             device 'sdX'.  This is Only for fstabs that use device names.
                Used for setting up a USB bootable disk.
    -m dir  - Add dir to a custom list of mounted directories to sync.  Then
                the custom list will be synced instead of the default of all
                mounted directories.  The root directory is always synced.
                Not for when initializing.
    -L lbl  - label for ext type partitions.  If ends with '#', replace with
                partition number and label all ext partitions. Otherwise,
                apply label to root partition only.
    -l      - leave SD card to USB boot alone when cloning to SD card mmcblk0
                from a USB boot.  This preserves a SD card to USB boot setup
                by leaving the SD card cmdline.txt using the USB root. When
                cloning to USB from SD card this option sets up the SD card
                cmdline.txt to boot to the USB disk.
    -a      - Sync all partitions if types compatible, not just mounted ones.
    -F      - force file system sync even if errors.
                If source used > destination space error, do the sync anyway.
If a source partition mount error, skip it and do other syncs.
    -x      - use set -x for very verbose bash shell script debugging
    -V      - print rpi-clone version.
.. and shows error massage like as below;

Code:
Syncing file systems (can take a long time)
Syncing mounted partitions:
 Mounting /dev/mmcblk0p2 on /mnt/clone
 => rsync // /mnt/clone with-root-excludes ...rsync: readlink_stat("/mnt/clone/debootstrap") failed: Structure needs cleaning (117)
IO error encountered -- skipping file deletion
rsync: recv_generator: failed to stat "/mnt/clone/bin/bzip2": Structure needs cleaning (117)
rsync: recv_generator: mkdir "/mnt/clone/debootstrap" failed: Structure needs cleaning (117)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: failed to stat "/mnt/clone/etc/memcached.conf": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/minidlna.conf": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/minidlna.conf.dpkg-dist": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/mpd.conf": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/passwd": Structure needs cleaning (117)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/pps/clients/pps-ldisc.ko) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/pps/clients/pps-gpio.ko) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/pps/clients
rsync: delete_file: rmdir(etc/alternatives/vi.1.gz/pps/clients) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/pps/pps_core.ko) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/pps
rsync: delete_file: rmdir(etc/alternatives/vi.1.gz/pps) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/power/supply/ltc2941-battery-gauge.ko) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/power/supply/ds2760_battery.ko) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/power/supply
rsync: delete_file: rmdir(etc/alternatives/vi.1.gz/power/supply) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/power
rsync: delete_file: rmdir(etc/alternatives/vi.1.gz/power) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/pinctrl/pinctrl-mcp23s08.ko) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/pinctrl
rsync: delete_file: rmdir(etc/alternatives/vi.1.gz/pinctrl) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/perf/raspberrypi_axi_monitor.ko) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/perf
.....

kitamura


RE: How to backup with "rpi-clone"? - Tim Curtis - 01-05-2019

(01-05-2019, 03:18 AM)JST1963 Wrote: Now, let's all get a beer together…. my threat...

The Dude's buyin!

After checking out rpi-clone Github I'd tend to agree with Kent that at minimum the failure scenario should be posted to the maintainer's issue list.

-Tim


RE: How to backup with "rpi-clone"? - Tim Curtis - 01-05-2019

(01-05-2019, 03:21 AM)kitamura_design Wrote:
(01-05-2019, 02:34 AM)Tim Curtis Wrote: Hi Kent,

It does live imaging or some sort of equavalent process?

I'll have to check it out :-)

Hi Tim,

Next, I tried the 'force initialized option (-f, and -f2)'.
Quote:pi@moode:~ $ sudo rpi-clone
No destination disk given.

usage: rpi-clone sdN {-v|--verbose} {-f|--force-initialize} {-f2}
         {-u|--unattended} {-U|--Unattended} {-q|--quiet}
         {-s|--setup host} {-e|--edit-fstab sdX } {-m|--mountdir dir }
         {-L|--label-partitions label} {-l|--leave-sd-usb-boot}
         {-a|--all-sync} {-F|--Force-sync} {-x} {-V|--version}
         {--convert-fstab-to-partuuid}

    -v    - verbose rsync, list all files as they are copied.
    -f    - force initialize the destination disk by imaging the booted disk
partition structure.  File systems are then synced or imaged.
    -f2    - force initialize only the first 2 partitions to the destination.
So a multi partition USB boot can initialize clone back to
a 2 partition SD card.
    -u    - unattended clone if not initializing.  No confirmations asked,
but abort if disk needs initializing or on error.
    -U      - unattended even if initializing. No confirmations asked,
                but abort only on errors.
    -q      - quiet mode, no output unless errors or initializing. Implies -u.
    -s host - add 'host' to args passed to script rpi-clone-setup and run it
                after cloning but before unmounting partitions. For setting
clone disk hostname, but args can be what the script expects.
                You can give multiple -s arg options.
    -e sdX  - edit destination fstab to change booted device names to new
             device 'sdX'.  This is Only for fstabs that use device names.
                Used for setting up a USB bootable disk.
    -m dir  - Add dir to a custom list of mounted directories to sync.  Then
                the custom list will be synced instead of the default of all
                mounted directories.  The root directory is always synced.
                Not for when initializing.
    -L lbl  - label for ext type partitions.  If ends with '#', replace with
                partition number and label all ext partitions. Otherwise,
                apply label to root partition only.
    -l      - leave SD card to USB boot alone when cloning to SD card mmcblk0
                from a USB boot.  This preserves a SD card to USB boot setup
                by leaving the SD card cmdline.txt using the USB root. When
                cloning to USB from SD card this option sets up the SD card
                cmdline.txt to boot to the USB disk.
    -a      - Sync all partitions if types compatible, not just mounted ones.
    -F      - force file system sync even if errors.
                If source used > destination space error, do the sync anyway.
If a source partition mount error, skip it and do other syncs.
    -x      - use set -x for very verbose bash shell script debugging
    -V      - print rpi-clone version.
.. and shows error massage like as below;

Code:
Syncing file systems (can take a long time)
Syncing mounted partitions:
 Mounting /dev/mmcblk0p2 on /mnt/clone
 => rsync // /mnt/clone with-root-excludes ...rsync: readlink_stat("/mnt/clone/debootstrap") failed: Structure needs cleaning (117)
IO error encountered -- skipping file deletion
rsync: recv_generator: failed to stat "/mnt/clone/bin/bzip2": Structure needs cleaning (117)
rsync: recv_generator: mkdir "/mnt/clone/debootstrap" failed: Structure needs cleaning (117)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: failed to stat "/mnt/clone/etc/memcached.conf": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/minidlna.conf": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/minidlna.conf.dpkg-dist": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/mpd.conf": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/passwd": Structure needs cleaning (117)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/pps/clients/pps-ldisc.ko) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/pps/clients/pps-gpio.ko) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/pps/clients
rsync: delete_file: rmdir(etc/alternatives/vi.1.gz/pps/clients) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/pps/pps_core.ko) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/pps
rsync: delete_file: rmdir(etc/alternatives/vi.1.gz/pps) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/power/supply/ltc2941-battery-gauge.ko) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/power/supply/ds2760_battery.ko) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/power/supply
rsync: delete_file: rmdir(etc/alternatives/vi.1.gz/power/supply) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/power
rsync: delete_file: rmdir(etc/alternatives/vi.1.gz/power) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/pinctrl/pinctrl-mcp23s08.ko) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/pinctrl
rsync: delete_file: rmdir(etc/alternatives/vi.1.gz/pinctrl) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/perf/raspberrypi_axi_monitor.ko) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/perf
.....

kitamura

I'd post the issue on the rpi-clone Git and mention that you are using a squashed file system for /var/www. The error messages though reference other directories which would suggest some other problem.

-Tim


RE: How to backup with "rpi-clone"? - kitamura_design - 01-05-2019

(01-05-2019, 03:41 AM)Tim Curtis Wrote:
(01-05-2019, 03:21 AM)kitamura_design Wrote:
(01-05-2019, 02:34 AM)Tim Curtis Wrote: Hi Kent,

It does live imaging or some sort of equavalent process?

I'll have to check it out :-)

Hi Tim,

Next, I tried the 'force initialized option (-f, and -f2)'.
Quote:...
    -f    - force initialize the destination disk by imaging the booted disk partition structure.  File systems are then synced or imaged.
    -f2    - force initialize only the first 2 partitions to the destination. So a multi partition USB boot can initialize clone back toa 2 partition SD card.
...
.. and shows error massage like as below;

Code:
Syncing file systems (can take a long time)
Syncing mounted partitions:
 Mounting /dev/mmcblk0p2 on /mnt/clone
 => rsync // /mnt/clone with-root-excludes ...rsync: readlink_stat("/mnt/clone/debootstrap") failed: Structure needs cleaning (117)
IO error encountered -- skipping file deletion
rsync: recv_generator: failed to stat "/mnt/clone/bin/bzip2": Structure needs cleaning (117)
rsync: recv_generator: mkdir "/mnt/clone/debootstrap" failed: Structure needs cleaning (117)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: failed to stat "/mnt/clone/etc/memcached.conf": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/minidlna.conf": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/minidlna.conf.dpkg-dist": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/mpd.conf": Structure needs cleaning (117)
rsync: recv_generator: failed to stat "/mnt/clone/etc/passwd": Structure needs cleaning (117)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/pps/clients/pps-ldisc.ko) failed: Read-only file system (30)
rsync: delete_file: unlink(etc/alternatives/vi.1.gz/pps/clients/pps-gpio.ko) failed: Read-only file system (30)
cannot delete non-empty directory: etc/alternatives/vi.1.gz/pps/clients
rsync: delete_file: rmdir(etc/alternatives/vi.1.gz/pps/clients) failed: Read-only file system (30)

.....

kitamura

I'd post the issue on the rpi-clone Git and mention that you are using a squashed file system for /var/www. The error messages though reference other directories which would suggest some other problem.

-Tim

Hi everyone,

Hi,
rpi-clone worked with option -F on my environment.

[before]
Code:
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    1 29.3G  0 disk
├─sda1        8:1    1 43.2M  0 part /boot
└─sda2        8:2    1    3G  0 part /
mmcblk0     179:0    0 14.5G  0 disk
├─mmcblk0p1 179:1    0 43.2M  0 part /media/boot
└─mmcblk0p2 179:2    0 14.4G  0 part

[after]
Code:
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    1 29.3G  0 disk
├─sda1        8:1    1 43.2M  0 part /media/boot
└─sda2        8:2    1    3G  0 part /media/rootfs
mmcblk0     179:0    0 14.5G  0 disk
├─mmcblk0p1 179:1    0 43.2M  0 part /boot
└─mmcblk0p2 179:2    0 14.4G  0 part /

The backup moOde on to uSD card booted and running.

FYI,
kitamura


RE: How to backup with "rpi-clone"? - TheOldPresbyope - 01-05-2019

(01-05-2019, 02:34 AM)Tim Curtis Wrote: Hi Kent,

It does live imaging or some sort of equavalent process?

I'll have to check it out :-)

Yes, it uses rsync to backup the live system. 

I don't want to deconstruct the script but this to me feels like living life on the edge.  How well does it assure the clone is self-consistent? I made my backup while moOde was quiescent. What happens if you run rpi-clone while databases are being updated, etc.? 

As for using an option to force completion in the face of errors, that feels like driving my car with a piece of black tape stuck over the engine trouble light. Some people are fine with that; I'd rather resolve what's causing the error.

'nuf said. This is FOSS---use it if it suits.

Regards,
Kent


RE: How to backup with "rpi-clone"? - Tim Curtis - 01-05-2019

lol, black tape trick.

Ya its on the edge for sure. I was hoping that it was a true live imaging utility similar to the utils for Mac and Windows.