• rsync backups

    From Vincent Coen@2:250/1 to All on Tue Jun 2 13:50:18 2020
    Hello All!

    I use rsync to make back ups of my boot partition and my /home directory as they are on different drives.

    How ever I did a restore for the boot one to go to another drive a SSD
    instead of a DASD.

    This is the back up one :

    -!- cat rsync-root.sh

    #!/bin/bash
    time rsync -avvuhh --stats --delete --exclude=/dev --exclude=/proc --exclude=/mnt --exclude=/run --exclude=/tmp --exclude=/home
    --exclude=/media --exclude=/sys /
    /home/vince/Music2/Backups/SSD-Mageia-v7-HDD > rsync-root.log
    rsync-root.err
    exit 0
    -!-

    ( line starting time continues down to 'rsync-root.err' )


    This is the restore :

    -!- cat rsync-restore-root.sh
    #!/bin/bash
    time rsync -avvuhh --stats --delete --exclude=/dev --exclude=/proc --exclude=/mnt --exclude=/run --exclude=/tmp --exclude=/home
    --exclude=/media --exclude=/sys
    /home/vince/Music2/Backups/SSD-Mageia-v7-HDD "/mnt/disk1" > rsync-restore-root.log 2 > rsync-restore-root.err
    exit 0
    -!-

    The back up goes from root / to
    /home/vince/Music2/Backups/SSD-Mageia-v7-HDD

    The restore goes from /home/vince/Music2/Backups/SSD-Mageia-v7-HDD to

    /mnt/disk1 and also tried "/mnt/disk1" as in above.

    But both end up producing report in rsync-restore-root.err (should be .log)
    but with a directory in my home directlry as 2/disk1 and SSD-Mageia-v7-HDD


    I am confused :(

    Is rsync changing destination location because the original source is not
    the same as the restore ? as I can find no reference to that it the info
    help file (via man rsync or info rsync).

    The SSD partition IS mounted as /mnt/disk1 : - -

    df - abbreviated :

    /dev/sdc4 83G 57M 78G 1% /mnt/disk2
    /dev/sdc6 118G 61M 112G 1% /mnt/disk3
    /dev/sdc3 88G 18G 66G 22% /mnt/disk1

    Mounted by root : - -

    ls -la /mnt
    drwxr-xr-x 13 root root 4096 May 27 15:50 ./
    drwxr-xr-x 22 root root 4096 May 26 22:53 ../
    drwxr-xr-x 13 root root 4096 May 26 22:52 disk1/
    drwxr-xr-x 3 root root 4096 May 26 18:44 disk2/
    drwxr-xr-x 3 root root 4096 May 26 18:44 disk3/

    and ls -la /mnt/disk1
    drwxr-xr-x 13 root root 4096 May 26 22:52 ./
    drwxr-xr-x 13 root root 4096 May 27 15:50 ../
    lrwxrwxrwx 1 root root 7 Sep 24 2018 bin -> usr/bin/
    drwxr-xr-x 5 root root 4096 May 25 15:24 boot/
    drwxr-xr-x 2 root root 4096 Aug 30 2018 cgroup/
    drwxr-xr-x 147 root root 12288 May 25 20:38 etc/
    drwxr-xr-x 2 root root 4096 Sep 24 2018 initrd/
    lrwxrwxrwx 1 root root 7 Sep 24 2018 lib -> usr/lib/
    lrwxrwxrwx 1 root root 9 Sep 24 2018 lib64 -> usr/lib64/
    drwx------ 2 root root 16384 Sep 22 2019 lost+found/
    drwxr-xr-x 7 root root 4096 May 26 21:08 opt/
    -rw-r--r-- 1 root root 0 May 1 04:42 .readahead_collect
    drwxr-x--- 19 root root 4096 May 26 21:10 root/
    lrwxrwxrwx 1 root root 8 Sep 24 2018 sbin -> usr/sbin/
    drwxr-xr-x 2 root root 4096 Sep 24 2018 srv/
    drwx------ 10 root root 4096 May 26 22:17 sys/
    drwxr-xr-x 15 root root 4096 Nov 19 2019 usr/
    drwxr-xr-x 18 root root 4096 May 25 20:38 var/


    What on earth is rsync doing ?

    I am trying to create an image of by DASD boot partition in the SSD so I
    can switch to using it instead of the DASD by reconnecting the Sata cables around between the two and yes I suspect I will have to run the Mag
    installer to fix up the /boot content and settings as they are different partitions with each drive.


    Vincent


    SEEN-BY: 250/1 3
  • From Bit Twister@2:250/1 to All on Tue Jun 2 14:46:17 2020
    On Tue, 02 Jun 2020 13:50:18 +0100, Vincent Coen wrote:
    Hello All!

    I use rsync to make back ups of my boot partition and my /home directory as they are on different drives.

    How ever I did a restore for the boot one to go to another drive a SSD instead of a DASD.


    I am confused :(

    Is rsync changing destination location because the original source is not
    the same as the restore ?

    No, rsync will move source location to target location as directed.

    If you wanted to restore /boot from a location it would be

    rsync args_here /src_loc/boot/ /dest_loc/boot

    Pay careful attention to above trailing slashes.
    Note that the /dest_loc argument does not have one.

    If you want the source directory in a sub directory on /dest_loc you
    would add a trailing /.

    Example: rsync /src_loc/boot/ /dest/boot/ would create a sub directory
    /boot in /dest/boot/

    To clarify you would windup having a /dest/boot/boot

    grub note: I have a multi-boot install, one of which is Cauldron.
    For testing, I do a clean Cauldron net install and use rsync to backup /,
    and change the boot location from /cauldron/boot to /mga7/boot.
    That way mga7 is the master/production boot manager.

    When I restore /cauldron from backup, and boot cauldron, grub feels
    sad about what it sees.

    I have to boot back into mga7, and reinstall grub with mga7 grub
    and everything goes back to normal.

    After your ssd boot restore, and you want to boot from ssd, then
    you have to tell grub to use the ssd data.

    --- MBSE BBS v1.0.7.13 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)