• backup machine to main server.

    From William Unruh@2:250/1 to All on Sat Nov 28 21:54:23 2020
    I want to have one of my other machines be a backup machine to main
    server. I and making it a mirror of the main server, in that all of the
    files are mirrored daily on it (call the mirror B and the original A)
    including all the system files.
    Now, I need to change /etc/fstab to reflect the different file
    architecture on B from A. But I also have to alter the boot files and
    sequence. I run mkinitrd on the mirror (using chroot) but my worry is
    about setting up grub properly. How do I make grub see the correct
    kernels to boot. (for example right now B is running Mga6 while A is
    Mga7)


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Chris Elvidge@2:250/1 to All on Sat Nov 28 23:09:15 2020
    On 28/11/2020 09:54 pm, William Unruh wrote:
    I want to have one of my other machines be a backup machine to main
    server. I and making it a mirror of the main server, in that all of the
    files are mirrored daily on it (call the mirror B and the original A) including all the system files.
    Now, I need to change /etc/fstab to reflect the different file
    architecture on B from A. But I also have to alter the boot files and sequence. I run mkinitrd on the mirror (using chroot) but my worry is
    about setting up grub properly. How do I make grub see the correct
    kernels to boot. (for example right now B is running Mga6 while A is
    Mga7)


    Different OS rev. doesn't really matter. No need to mess about with grub/mkinitrd. No changes to fstab needed.

    Use rsync to mirror the root drive of A to a _directory_ on B.
    rsync will work with ssh. Best way, use B to pull the root directory of
    A. In that case make sure you can ssh from B to A without a password -
    see ssh-copy-id. As root, obviously.

    You could mount your backup disk on B at /Abackup.

    rootonB: /backup $ ssh ipaddressofA # must work without password
    rootonB: /backup $ rsync -avzx ipaddressofA:/ /Abackup/

    -avzx = -a=archive mode, -v=verbose, -z=use compression during transfer, -x=only one file system. note the :/ after the source ip address.

    rsync will make a full backup at first, then incrementally overwrite.
    If you need "proper" incrementals, see --backup and --backup-dir in the
    rsync manual.


    --
    Chris Elvidge
    England

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Sat Nov 28 23:30:41 2020
    On 2020-11-28, Chris Elvidge <chris@mshome.net> wrote:
    On 28/11/2020 09:54 pm, William Unruh wrote:
    I want to have one of my other machines be a backup machine to main
    server. I and making it a mirror of the main server, in that all of the
    files are mirrored daily on it (call the mirror B and the original A)
    including all the system files.
    Now, I need to change /etc/fstab to reflect the different file
    architecture on B from A. But I also have to alter the boot files and
    sequence. I run mkinitrd on the mirror (using chroot) but my worry is
    about setting up grub properly. How do I make grub see the correct
    kernels to boot. (for example right now B is running Mga6 while A is
    Mga7)


    Different OS rev. doesn't really matter. No need to mess about with grub/mkinitrd. No changes to fstab needed.

    ???? The disk names and partitions on B are entirely different from
    what they are on A. On A some partitions are even on different disks,
    while they are on the same disk on B. The UUIDs on B are different from
    what they are on A.

    Also since the machines are different, the disks and partitions are
    different, I surely need to have different initrd files. They preload a
    bunch of junk and need to know where that junk is on the disks on B.
    Finally, the location of the root directory for the mirror of A on B is different so I surely need to tell grub where to look for them.


    Use rsync to mirror the root drive of A to a _directory_ on B.
    rsync will work with ssh. Best way, use B to pull the root directory of
    A. In that case make sure you can ssh from B to A without a password -
    see ssh-copy-id. As root, obviously.

    You could mount your backup disk on B at /Abackup.

    rootonB: /backup $ ssh ipaddressofA # must work without password
    rootonB: /backup $ rsync -avzx ipaddressofA:/ /Abackup/

    Yes. There are two different disks on A and one disk on B (but different partitions)


    -avzx = -a=archive mode, -v=verbose, -z=use compression during transfer, -x=only one file system. note the :/ after the source ip address.

    rsync will make a full backup at first, then incrementally overwrite.
    If you need "proper" incrementals, see --backup and --backup-dir in the rsync manual.

    Yup, that I have already. The question is making sure B can be booted
    pretend to be A when A developes problems. Note that otherwise B is used
    as a spare computer for people to use.




    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From David W. Hodgins@2:250/1 to All on Sat Nov 28 23:37:53 2020
    On Sat, 28 Nov 2020 16:54:23 -0500, William Unruh <unruh@invalid.ca> wrote:

    I want to have one of my other machines be a backup machine to main
    server. I and making it a mirror of the main server, in that all of the
    files are mirrored daily on it (call the mirror B and the original A) including all the system files.
    Now, I need to change /etc/fstab to reflect the different file
    architecture on B from A. But I also have to alter the boot files and sequence. I run mkinitrd on the mirror (using chroot) but my worry is
    about setting up grub properly. How do I make grub see the correct
    kernels to boot. (for example right now B is running Mga6 while A is
    Mga7)

    What do you mean by file architecture?

    Cloning the system to a new computer or even a new disk drive and then modifying it
    to be bootable on that system is one thing.

    Using it for daily backups is another thing that is contradictory to the above since
    by definition, system files include the grub configuration files, fstab, etc.

    How to properly backup any system depends on what it's running.

    Files being backed up must not be being written to, so for example, mariadb database
    file backups are useless if mariadb was running while file level backups were being
    created. To create useable backups either mariadb must be stopped, or utilities
    built for mariadb must be used.

    What is the purpose of the backup? Is it to be able to recover the main system if needed or something else? If it's just recovery, just install Mageia on it, use something like nfs, or sshfs to mount a directory on the remote system and then use rsync to backup the desired files, ensuring they are not in use at when
    the backup is being run.

    Regards, Dave Hodgins

    --
    Change dwhodgins@nomail.afraid.org to davidwhodgins@teksavvy.com for
    email replies.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From David W. Hodgins@2:250/1 to All on Sat Nov 28 23:44:46 2020
    On Sat, 28 Nov 2020 18:30:41 -0500, William Unruh <unruh@invalid.ca> wrote:
    Yup, that I have already. The question is making sure B can be booted
    pretend to be A when A developes problems. Note that otherwise B is used
    as a spare computer for people to use.

    That is not a great idea. It would require customized backup scripts to reapply
    the changes at the end of each backup as the grub config files will change each
    time a kernel is installed or removed.

    I'd just do a normal install on the backup system, and have a directory on it for backing up the main system to, which would then be used for recovering later, if needed.

    Regards, Dave Hodgins

    --
    Change dwhodgins@nomail.afraid.org to davidwhodgins@teksavvy.com for
    email replies.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From David W. Hodgins@2:250/1 to All on Sat Nov 28 23:46:50 2020
    On Sat, 28 Nov 2020 18:30:41 -0500, William Unruh <unruh@invalid.ca> wrote:
    Yup, that I have already. The question is making sure B can be booted
    pretend to be A when A developes problems. Note that otherwise B is used
    as a spare computer for people to use.

    Are you using the main system as a server? Which server applications?

    Regards, Dave Hodgins

    --
    Change dwhodgins@nomail.afraid.org to davidwhodgins@teksavvy.com for
    email replies.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Sun Nov 29 01:12:41 2020
    On 2020-11-28, David W. Hodgins <dwhodgins@nomail.afraid.org> wrote:

    On Sat, 28 Nov 2020 18:30:41 -0500, William Unruh <unruh@invalid.ca> wrote:
    Yup, that I have already. The question is making sure B can be booted
    pretend to be A when A developes problems. Note that otherwise B is used
    as a spare computer for people to use.

    That is not a great idea. It would require customized backup scripts to
    reapply
    the changes at the end of each backup as the grub config files will change
    each
    time a kernel is installed or removed.

    Yes. That is what I am asking.

    I'd just do a normal install on the backup system, and have a directory on
    it
    for backing up the main system to, which would then be used for recovering later, if needed.

    Since it is important that the server be up, I cannot wait 3 days while
    another computer to replace my server arrives. I want to just swap to
    this backup and keep going, so that the other computers do not know what
    has happened.

    Regards, Dave Hodgins

    --
    Change dwhodgins@nomail.afraid.org to davidwhodgins@teksavvy.com for
    email replies.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Sun Nov 29 01:15:06 2020
    On 2020-11-28, David W. Hodgins <dwhodgins@nomail.afraid.org> wrote:
    On Sat, 28 Nov 2020 18:30:41 -0500, William Unruh <unruh@invalid.ca> wrote:
    Yup, that I have already. The question is making sure B can be booted
    pretend to be A when A developes problems. Note that otherwise B is used
    as a spare computer for people to use.

    Are you using the main system as a server? Which server applications?

    NFS mainly-- including the html directory to another machine which is
    the web server, and including all the home directories and root
    management directories.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Sun Nov 29 01:23:42 2020
    On 2020-11-28, David W. Hodgins <dwhodgins@nomail.afraid.org> wrote:
    On Sat, 28 Nov 2020 16:54:23 -0500, William Unruh <unruh@invalid.ca> wrote:

    I want to have one of my other machines be a backup machine to main
    server. I and making it a mirror of the main server, in that all of the
    files are mirrored daily on it (call the mirror B and the original A)
    including all the system files.
    Now, I need to change /etc/fstab to reflect the different file
    architecture on B from A. But I also have to alter the boot files and
    sequence. I run mkinitrd on the mirror (using chroot) but my worry is
    about setting up grub properly. How do I make grub see the correct
    kernels to boot. (for example right now B is running Mga6 while A is
    Mga7)

    What do you mean by file architecture?

    Cloning the system to a new computer or even a new disk drive and then
    modifying it
    to be bootable on that system is one thing.

    Using it for daily backups is another thing that is contradictory to the
    above since
    by definition, system files include the grub configuration files, fstab,
    etc.

    No, it is not contradictory, just more work. I have fstab being altered,
    initrd being recreated so as to take acount of the different hardware on
    the new system, but my main concern is grub. I could just change the
    UUID of the root location from A to that on B in the grub2/grub.conf
    file, but I am worried that that is not enough.
    I could do a chroot and force-reinstall all of the kernels present on A
    which should recompile the initrd and redo grub, but I am not sure if
    that would work (while this does take time, my backups go at 4AM when I
    am fast asleep anyway)

    How to properly backup any system depends on what it's running.

    Files being backed up must not be being written to, so for example, mariadb
    database
    file backups are useless if mariadb was running while file level backups
    were being
    created. To create useable backups either mariadb must be stopped, or
    utilities
    built for mariadb must be used.

    What is the purpose of the backup? Is it to be able to recover the main
    system
    if needed or something else? If it's just recovery, just install Mageia on
    it,

    To have a seemless fallback in case the main system dies.

    use something like nfs, or sshfs to mount a directory on the remote system
    and
    then use rsync to backup the desired files, ensuring they are not in use at
    when
    the backup is being run.

    Yes, the backups I am managing. It is the fallback I am worried about.


    Regards, Dave Hodgins


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From David W. Hodgins@2:250/1 to All on Sun Nov 29 01:44:19 2020
    On Sat, 28 Nov 2020 20:15:06 -0500, William Unruh <unruh@invalid.ca> wrote:
    On 2020-11-28, David W. Hodgins <dwhodgins@nomail.afraid.org> wrote:
    On Sat, 28 Nov 2020 18:30:41 -0500, William Unruh <unruh@invalid.ca> wrote: >>> Yup, that I have already. The question is making sure B can be booted
    pretend to be A when A developes problems. Note that otherwise B is used >>> as a spare computer for people to use.
    Are you using the main system as a server? Which server applications?

    NFS mainly-- including the html directory to another machine which is
    the web server, and including all the home directories and root
    management directories.

    I would just do a normal install, and only sync the data for the servers, not the whole os. That way the only things you need to worry about are ensuring the
    things being backed up are not being written to during the backup, keeping the same version of the server packages installed on both, and changing the ip address
    etc, if switching from the main to the backup server.

    If you really do want to ensure everything is duplicated, with appropriate customizations for each computer, something like puppet can be used, but that is a complicated tool to learn to setup and use.

    Regards, Dave Hodgins

    --
    Change dwhodgins@nomail.afraid.org to davidwhodgins@teksavvy.com for
    email replies.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Jasen Betts@2:250/1 to All on Sun Nov 29 02:00:43 2020
    On 2020-11-29, William Unruh <unruh@invalid.ca> wrote:
    On 2020-11-28, David W. Hodgins <dwhodgins@nomail.afraid.org> wrote:

    On Sat, 28 Nov 2020 18:30:41 -0500, William Unruh <unruh@invalid.ca> wrote: >>> Yup, that I have already. The question is making sure B can be booted
    pretend to be A when A developes problems. Note that otherwise B is used >>> as a spare computer for people to use.

    That is not a great idea. It would require customized backup scripts to reapply
    the changes at the end of each backup as the grub config files will change each
    time a kernel is installed or removed.

    Yes. That is what I am asking.

    I'd just do a normal install on the backup system, and have a directory on it
    for backing up the main system to, which would then be used for recovering >> later, if needed.

    Since it is important that the server be up, I cannot wait 3 days while another computer to replace my server arrives. I want to just swap to
    this backup and keep going, so that the other computers do not know what
    has happened.

    That can be done by having two installs on the backup manchine one
    install that runs rsync, and a second install that is a clone of the
    other machine. when the other machine fails nust boot the second
    install.

    There will be some requirement to maintain the grub install so that the
    backup can be booted.


    This might be a good time to use labels instead of UUIDs to identify partitions.

    --
    Jasen.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: JJ's own news server (2:250/1@fidonet)
  • From David W. Hodgins@2:250/1 to All on Sun Nov 29 03:16:37 2020
    On Sat, 28 Nov 2020 21:00:43 -0500, Jasen Betts <usenet@revmaps.no-ip.org> wrote:

    This might be a good time to use labels instead of UUIDs to identify partitions.

    Thinking more about it, the uuid really only has to be unique within one computer
    so the correct filesystem gets mounted when booting or selected by grub.

    There is no reason the uuid cannot be duplicated on two different systems, so if both computers use the same uuid for the root filesystem, the grub config files, etc. could be identical. The various mkfs commands all support specifying
    the uuid instead of using a dynamically generated one. Only the fstab would have
    to be different due to the number of drives being different. That file could easily be excluded from rsync.

    The only thing that would have to be different is the ip address. Even the hostname
    could be duplicated, as long as it is not used to select the ip address by having
    the router assign the ip address based on the mac address. Switching from the main to the backup system would just require altering the router settings and would be easy to do when testing the that the backup system is working properly.
    Also the file (probably in /etc/cron.daily) that activates the backup would have
    to be excluded from being copied to the backup server.

    Not trying to backup files that are being written to is still a concern, but that
    applies no matter what configuration is chosen.

    Regards, Dave Hodgins

    --
    Change dwhodgins@nomail.afraid.org to davidwhodgins@teksavvy.com for
    email replies.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Sun Nov 29 05:45:52 2020
    On 2020-11-29, Jasen Betts <usenet@revmaps.no-ip.org> wrote:
    On 2020-11-29, William Unruh <unruh@invalid.ca> wrote:
    On 2020-11-28, David W. Hodgins <dwhodgins@nomail.afraid.org> wrote:

    On Sat, 28 Nov 2020 18:30:41 -0500, William Unruh <unruh@invalid.ca> wrote:
    Yup, that I have already. The question is making sure B can be booted
    pretend to be A when A developes problems. Note that otherwise B is used >>>> as a spare computer for people to use.

    That is not a great idea. It would require customized backup scripts to reapply
    the changes at the end of each backup as the grub config files will change each
    time a kernel is installed or removed.

    Yes. That is what I am asking.

    I'd just do a normal install on the backup system, and have a directory on it
    for backing up the main system to, which would then be used for recovering >>> later, if needed.

    Since it is important that the server be up, I cannot wait 3 days while
    another computer to replace my server arrives. I want to just swap to
    this backup and keep going, so that the other computers do not know what
    has happened.

    That can be done by having two installs on the backup manchine one
    install that runs rsync, and a second install that is a clone of the
    other machine. when the other machine fails nust boot the second
    install.

    There will be some requirement to maintain the grub install so that the backup can be booted.

    Precisely what I am asking.



    This might be a good time to use labels instead of UUIDs to identify partitions.

    I have thought of that, but I have never learned to label partitions.

    I suppose I could also give the /boot partition and the /local partition
    on the other machine the same UUID as well. But I still need to remake
    the initrd, and I still worry about grub

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From J.O. Aho@2:250/1 to All on Sun Nov 29 08:52:50 2020
    On 28/11/2020 22.54, William Unruh wrote:
    I want to have one of my other machines be a backup machine to main
    server. I and making it a mirror of the main server, in that all of the
    files are mirrored daily on it (call the mirror B and the original A) including all the system files.
    Now, I need to change /etc/fstab to reflect the different file
    architecture on B from A. But I also have to alter the boot files and sequence. I run mkinitrd on the mirror (using chroot) but my worry is
    about setting up grub properly. How do I make grub see the correct
    kernels to boot. (for example right now B is running Mga6 while A is
    Mga7)

    I wouldn't it call mirror as A and B won't be identical. Simplest would
    just use rsync or similar, tell which files should be copied over from A
    to B. You will need to exclude any binary data installed by package
    manager and in some cases including configuration files.


    If you want to have all the packages to be updated in the same manner, I
    do suggest you have B installed with the same version of the OS. The
    tricky part is to get the all the updates and things to B from A without breaking it. Had you used btrfs (send/recieve) is had been quite simple
    to do, with a reboot required to switch to the new file system.

    To solve the etc issue, I would recommend you label the partitions, this
    way the fstab can look identical on both machines.

    Solving the grub issue, you can solve that with file system label too.

    --

    //Aho


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)
  • From Chris Elvidge@2:250/1 to All on Sun Nov 29 10:57:03 2020
    On 28/11/2020 11:30 pm, William Unruh wrote:
    On 2020-11-28, Chris Elvidge <chris@mshome.net> wrote:
    On 28/11/2020 09:54 pm, William Unruh wrote:
    I want to have one of my other machines be a backup machine to main
    server. I and making it a mirror of the main server, in that all of the
    files are mirrored daily on it (call the mirror B and the original A)
    including all the system files.
    Now, I need to change /etc/fstab to reflect the different file
    architecture on B from A. But I also have to alter the boot files and
    sequence. I run mkinitrd on the mirror (using chroot) but my worry is
    about setting up grub properly. How do I make grub see the correct
    kernels to boot. (for example right now B is running Mga6 while A is
    Mga7)


    Different OS rev. doesn't really matter. No need to mess about with
    grub/mkinitrd. No changes to fstab needed.

    ???? The disk names and partitions on B are entirely different from
    what they are on A. On A some partitions are even on different disks,
    while they are on the same disk on B. The UUIDs on B are different from
    what they are on A.

    Also since the machines are different, the disks and partitions are different, I surely need to have different initrd files. They preload a
    bunch of junk and need to know where that junk is on the disks on B.
    Finally, the location of the root directory for the mirror of A on B is different so I surely need to tell grub where to look for them.


    Use rsync to mirror the root drive of A to a _directory_ on B.
    rsync will work with ssh. Best way, use B to pull the root directory of
    A. In that case make sure you can ssh from B to A without a password -
    see ssh-copy-id. As root, obviously.

    You could mount your backup disk on B at /Abackup.

    rootonB: /backup $ ssh ipaddressofA # must work without password
    rootonB: /backup $ rsync -avzx ipaddressofA:/ /Abackup/

    Yes. There are two different disks on A and one disk on B (but different partitions)


    -avzx = -a=archive mode, -v=verbose, -z=use compression during transfer,
    -x=only one file system. note the :/ after the source ip address.

    rsync will make a full backup at first, then incrementally overwrite.
    If you need "proper" incrementals, see --backup and --backup-dir in the
    rsync manual.

    Yup, that I have already. The question is making sure B can be booted
    pretend to be A when A developes problems. Note that otherwise B is used
    as a spare computer for people to use.




    Sorry I thought you just wanted a full backup, I didn't realize you
    wanted a fall-over system.

    --
    Chris Elvidge
    England

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Sun Nov 29 19:24:51 2020
    On 2020-11-29, J.O. Aho <user@example.net> wrote:
    On 28/11/2020 22.54, William Unruh wrote:
    I want to have one of my other machines be a backup machine to main
    server. I and making it a mirror of the main server, in that all of the
    files are mirrored daily on it (call the mirror B and the original A)
    including all the system files.
    Now, I need to change /etc/fstab to reflect the different file
    architecture on B from A. But I also have to alter the boot files and
    sequence. I run mkinitrd on the mirror (using chroot) but my worry is
    about setting up grub properly. How do I make grub see the correct
    kernels to boot. (for example right now B is running Mga6 while A is
    Mga7)

    I wouldn't it call mirror as A and B won't be identical. Simplest would
    just use rsync or similar, tell which files should be copied over from A
    to B. You will need to exclude any binary data installed by package
    manager and in some cases including configuration files.


    If you want to have all the packages to be updated in the same manner, I
    do suggest you have B installed with the same version of the OS. The
    tricky part is to get the all the updates and things to B from A without breaking it. Had you used btrfs (send/recieve) is had been quite simple
    to do, with a reboot required to switch to the new file system.

    To solve the etc issue, I would recommend you label the partitions, this
    way the fstab can look identical on both machines.

    Solving the grub issue, you can solve that with file system label too.

    At present I am simply altering the UUID of the root partition in grub2/grub.conf.
    But it is hard to test since, when booted into the mirror of A on B, it
    has the same IP and hostname (needed so that change is transparent to
    all the other machines) and having two machines with the same IP (as in
    a test) would be a disaster.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From J.O. Aho@2:250/1 to All on Sun Nov 29 20:27:56 2020
    On 29/11/2020 20.24, William Unruh wrote:

    At present I am simply altering the UUID of the root partition in
    grub2/grub.conf.

    Think if you had used the same LABEL instead, then you wouldn't need to
    tweak even if the partition setup is different on the different machines.

    But it is hard to test since, when booted into the mirror of A on B, it
    has the same IP and hostname (needed so that change is transparent to
    all the other machines) and having two machines with the same IP (as in
    a test) would be a disaster.

    To test things, I do suggest you shutdown/disconnect A, so that you can
    see if all the clients can talk with B. No point in tweaking IP, as it's
    meant to replace A when it goes down.

    Otherwise you will need to setup a keepalive service on a third machine
    which serves you either from A or B depending on which one is up and
    running. The data sync would be a lot more difficult as changes can be
    on both machines.


    --

    //Aho




    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)
  • From Bit Twister@2:250/1 to All on Sun Nov 29 21:01:31 2020
    On Sun, 29 Nov 2020 21:27:56 +0100, J.O. Aho wrote:
    On 29/11/2020 20.24, William Unruh wrote:

    At present I am simply altering the UUID of the root partition in grub2/grub.conf.

    Think if you had used the same LABEL instead, then you wouldn't need to
    tweak even if the partition setup is different on the different machines.

    LABEL or PARTLABEL will solve the /etc/fstab problem, assuming there are
    no duplicate *ABELed partitions. :(

    Although not so much for grub.

    For LABEL to work in grub, I suggest Unruh would have a custom script
    in /etc/grub.d to allow grub to boot via LABEL.

    All four systems I support use either LABEL= or PARTLABEL= in /etc/fstab
    and all systems are multi-boot via grub using labels.

    I have no clue if /boot initrd.img/vmlinuz may cause problems on different hardware.

    I assume William has factored in possible different ethernet device names
    and drivers.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Jasen Betts@2:250/1 to All on Mon Nov 30 07:01:08 2020
    On 2020-11-29, David W. Hodgins <dwhodgins@nomail.afraid.org> wrote:
    On Sat, 28 Nov 2020 21:00:43 -0500, Jasen Betts <usenet@revmaps.no-ip.org>
    wrote:

    This might be a good time to use labels instead of UUIDs to identify
    partitions.

    Thinking more about it, the uuid really only has to be unique within one
    computer
    so the correct filesystem gets mounted when booting or selected by grub.

    once you start copying them labels are easier than UUIDs, but yeah
    UUIDs could still be used.

    The only thing that would have to be different is the ip address.

    backup server and restored system needn't have the same IP address.
    If the original server uses static allocation in the network settings
    the backup copy will retain this address, the server that maintains
    the backup will necessarily nave a different ip address.

    Not trying to backup files that are being written to is still a concern, but
    that
    applies no matter what configuration is chosen.

    there are strategies to handle this for some domains (eg: postgresql has pg_begin_backup, after which an rsync copy done in the right order
    will be usable)

    Using ZFS' snapshot capability is another approach that could work.

    --
    Jasen.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: JJ's own news server (2:250/1@fidonet)
  • From Jasen Betts@2:250/1 to All on Mon Nov 30 07:15:57 2020
    On 2020-11-29, William Unruh <unruh@invalid.ca> wrote:
    On 2020-11-29, J.O. Aho <user@example.net> wrote:
    On 28/11/2020 22.54, William Unruh wrote:
    I want to have one of my other machines be a backup machine to main
    server. I and making it a mirror of the main server, in that all of the
    files are mirrored daily on it (call the mirror B and the original A)
    including all the system files.
    Now, I need to change /etc/fstab to reflect the different file
    architecture on B from A. But I also have to alter the boot files and
    sequence. I run mkinitrd on the mirror (using chroot) but my worry is
    about setting up grub properly. How do I make grub see the correct
    kernels to boot. (for example right now B is running Mga6 while A is
    Mga7)

    I wouldn't it call mirror as A and B won't be identical. Simplest would
    just use rsync or similar, tell which files should be copied over from A
    to B. You will need to exclude any binary data installed by package
    manager and in some cases including configuration files.


    If you want to have all the packages to be updated in the same manner, I
    do suggest you have B installed with the same version of the OS. The
    tricky part is to get the all the updates and things to B from A without
    breaking it. Had you used btrfs (send/recieve) is had been quite simple
    to do, with a reboot required to switch to the new file system.

    To solve the etc issue, I would recommend you label the partitions, this
    way the fstab can look identical on both machines.

    Solving the grub issue, you can solve that with file system label too.

    At present I am simply altering the UUID of the root partition in
    grub2/grub.conf.
    But it is hard to test since, when booted into the mirror of A on B, it
    has the same IP and hostname (needed so that change is transparent to
    all the other machines) and having two machines with the same IP (as in
    a test) would be a disaster.

    indeed, you probably want to disconnect it from the LAN before doing a test recovery boot.

    --
    Jasen.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: JJ's own news server (2:250/1@fidonet)
  • From J.O. Aho@2:250/1 to All on Mon Nov 30 08:01:01 2020
    On 29/11/2020 22.01, Bit Twister wrote:
    On Sun, 29 Nov 2020 21:27:56 +0100, J.O. Aho wrote:
    On 29/11/2020 20.24, William Unruh wrote:

    At present I am simply altering the UUID of the root partition in grub2/grub.conf.

    Think if you had used the same LABEL instead, then you wouldn't need to
    tweak even if the partition setup is different on the different machines.

    LABEL or PARTLABEL will solve the /etc/fstab problem, assuming there are
    no duplicate *ABELed partitions. :(

    Although not so much for grub.

    For LABEL to work in grub, I suggest Unruh would have a custom script
    in /etc/grub.d to allow grub to boot via LABEL.

    /etc/default/grub
    GRUB_DISABLE_LINUX_UUID=true
    GRUB_ENABLE_LINUX_LABEL=true

    /etc/grub.d/10_linux
    https://techpatterns.com/forums/about1575.html https://ubuntuforums.org/showthread.php?t=1530532


    I have no clue if /boot initrd.img/vmlinuz may cause problems on different hardware.

    The initrdimg is quite machine specific, many times a fallback image is generated which would be better to boot with the first time, then
    generate a system specific for the machine in question and then reboot
    it again.

    The kernel itself is universal in all major distributions.

    --

    //Aho



    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)
  • From Bit Twister@2:250/1 to All on Mon Nov 30 10:44:16 2020
    On Mon, 30 Nov 2020 09:01:01 +0100, J.O. Aho wrote:
    On 29/11/2020 22.01, Bit Twister wrote:
    On Sun, 29 Nov 2020 21:27:56 +0100, J.O. Aho wrote:
    On 29/11/2020 20.24, William Unruh wrote:

    At present I am simply altering the UUID of the root partition in grub2/grub.conf.

    Think if you had used the same LABEL instead, then you wouldn't need to
    tweak even if the partition setup is different on the different machines. >>
    LABEL or PARTLABEL will solve the /etc/fstab problem, assuming there are
    no duplicate *ABELed partitions. :(

    Although not so much for grub.

    For LABEL to work in grub, I suggest Unruh would have a custom script
    in /etc/grub.d to allow grub to boot via LABEL.

    /etc/default/grub
    GRUB_DISABLE_LINUX_UUID=true
    GRUB_ENABLE_LINUX_LABEL=true

    Those changes by their self do nothing to improve booting by LABEL.
    grub.cfg will have hard coded root=/dev/xxxxx :(


    /etc/grub.d/10_linux
    https://techpatterns.com/forums/about1575.html

    Just as I said, custom script required. A bit more code will be needed
    to scan the drive to automagically generate the root=LABEL=some_label_here


    https://ubuntuforums.org/showthread.php?t=1530532

    I suggest to you, modifying /etc/grub.d/10_linux is not very safe let
    alone modifying /usr/lib/grub/grub-mkconfig_lib in your first link.

    You have the possibility of different releases of grub having different
    lines of code, worse, a grub update could install a new 10_linux and/or grub-mkconfig_lib wiping out your changes.


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From J.O. Aho@2:250/1 to All on Mon Nov 30 12:57:34 2020
    On 30/11/2020 11.44, Bit Twister wrote:
    On Mon, 30 Nov 2020 09:01:01 +0100, J.O. Aho wrote:
    On 29/11/2020 22.01, Bit Twister wrote:
    On Sun, 29 Nov 2020 21:27:56 +0100, J.O. Aho wrote:
    On 29/11/2020 20.24, William Unruh wrote:

    At present I am simply altering the UUID of the root partition in grub2/grub.conf.

    Think if you had used the same LABEL instead, then you wouldn't need to >>>> tweak even if the partition setup is different on the different machines. >>>
    LABEL or PARTLABEL will solve the /etc/fstab problem, assuming there are >>> no duplicate *ABELed partitions. :(

    Although not so much for grub.

    For LABEL to work in grub, I suggest Unruh would have a custom script
    in /etc/grub.d to allow grub to boot via LABEL.

    /etc/default/grub
    GRUB_DISABLE_LINUX_UUID=true
    GRUB_ENABLE_LINUX_LABEL=true

    Those changes by their self do nothing to improve booting by LABEL.
    grub.cfg will have hard coded root=/dev/xxxxx :(

    Not by them self, in combination with 10_linux

    /etc/grub.d/10_linux
    https://techpatterns.com/forums/about1575.html

    Just as I said, custom script required. A bit more code will be needed
    to scan the drive to automagically generate the root=LABEL=some_label_here


    https://ubuntuforums.org/showthread.php?t=1530532

    I suggest to you, modifying /etc/grub.d/10_linux is not very safe let
    alone modifying /usr/lib/grub/grub-mkconfig_lib in your first link.

    You have the possibility of different releases of grub having different
    lines of code, worse, a grub update could install a new 10_linux and/or grub-mkconfig_lib wiping out your changes.

    Most modern package managers do allow you to protect files from being
    updated and the new file would generated as for example 10_linux.new or
    in worst case you can disable a package from being updated.

    --

    //Aho


    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Mon Nov 30 17:54:43 2020
    On 2020-11-30, Jasen Betts <usenet@revmaps.no-ip.org> wrote:
    On 2020-11-29, David W. Hodgins <dwhodgins@nomail.afraid.org> wrote:
    On Sat, 28 Nov 2020 21:00:43 -0500, Jasen Betts <usenet@revmaps.no-ip.org> wrote:

    This might be a good time to use labels instead of UUIDs to identify
    partitions.

    Thinking more about it, the uuid really only has to be unique within one computer
    so the correct filesystem gets mounted when booting or selected by grub.

    once you start copying them labels are easier than UUIDs, but yeah
    UUIDs could still be used.

    The only thing that would have to be different is the ip address.

    backup server and restored system needn't have the same IP address.

    Agreed. The question was testing the backup. Discovering something
    stupid I had forgotten in the heat of trying to get things going after a
    crash is not the best of times, so I would like to boot into the new
    system while the server is still up. But that would mean it would need a different IP from the server for the test.

    If the original server uses static allocation in the network settings
    All static allocations, yes.

    the backup copy will retain this address, the server that maintains
    the backup will necessarily nave a different ip address.

    Not trying to backup files that are being written to is still a concern, but that
    applies no matter what configuration is chosen.

    there are strategies to handle this for some domains (eg: postgresql has pg_begin_backup, after which an rsync copy done in the right order
    will be usable)

    Using ZFS' snapshot capability is another approach that could work.

    --
    Jasen.

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From J.O. Aho@2:250/1 to All on Mon Nov 30 18:16:24 2020

    On 30/11/2020 18.54, William Unruh wrote:
    On 2020-11-30, Jasen Betts <usenet@revmaps.no-ip.org> wrote:
    On 2020-11-29, David W. Hodgins <dwhodgins@nomail.afraid.org> wrote:
    On Sat, 28 Nov 2020 21:00:43 -0500, Jasen Betts <usenet@revmaps.no-ip.org> wrote:

    This might be a good time to use labels instead of UUIDs to identify
    partitions.

    Thinking more about it, the uuid really only has to be unique within one computer
    so the correct filesystem gets mounted when booting or selected by grub.

    once you start copying them labels are easier than UUIDs, but yeah
    UUIDs could still be used.

    The only thing that would have to be different is the ip address.

    backup server and restored system needn't have the same IP address.

    Agreed. The question was testing the backup. Discovering something
    stupid I had forgotten in the heat of trying to get things going after a crash is not the best of times, so I would like to boot into the new
    system while the server is still up. But that would mean it would need a different IP from the server for the test.

    You can always boot into single user mode, change the config and switch
    to the default init state.

    --

    //Aho

    --- MBSE BBS v1.0.7.17 (GNU/Linux-x86_64)
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1@fidonet)