Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Linux bare metal backup/restore

  • 19-10-2005 10:26am
    #1
    Registered Users, Registered Users 2 Posts: 944 ✭✭✭


    Where do I start...

    Basically, I've a machine built with 4 physical disks configured as two RAID 1 volumes. I want to replace the 4 drives with bigger, faster disks; rejig the size of the linux filesystems and restore the system to a working condition.

    It could be considered a bare metal restore, as that's basically what I'll be doing.

    Btw, it's a Redhat ES 3 system

    So, my thoughts. A single tar backup of the entire system, excluding /proc and /mnt. Use parted to note the parameters of each filesystem on each disk. Remove and replace the disks - rebuild the RAID sets. Using a linux SystemRescueCD, boot the machine and use parted to reconfigure the filesystems. Untar the tape to the new filesystems.

    Here's where it will probably all go wrong - reboot the machine.

    Anyone have any wisdom to impart on me?

    Thanks...


Comments

  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    Make a bootable device first - CD, floppy, pxe network image or whatever's convenient - using your current kernel. Include any modules you might need to access the raid controller.

    You'll need this if you have any issues with
    your boot loader install.

    Know in advance whether you were using grub, lilo, or/and something else and make sure you know how to reinstall it.

    Make a printed record of your /etc/lilo.conf
    or /boot/grub/menu.lst to make sure you
    have all your boot time options available
    if things go awry.

    Printouts of /etc/fstab and the output of fdisk -l would be very useful too,
    as well as any md config files related to your RAID array.

    A printout of lsmod can be useful to have if your hardware is unusual.

    If you're still using your OS's default kernel,
    you should be able to boot your system
    from its install CD by passing a root= parameter.

    Don't wipe the four old disks for at least a week if you can get away with it. They're
    as good a fast restore backup as you'll get!

    Hope it goes well,
    NiallB


  • Registered Users, Registered Users 2 Posts: 944 ✭✭✭SwampThing


    Right, I had a wee go at this, in a round-about sort of way.

    I decided to test my theory, on the non-bootable RAID-1 volume.

    It contained the /var, /usr, a swap partition and a data filesystem called /u. So, I tar'd them up onto tape.

    I then removed the two disks, inserted two new ones and created the RAID 1 volume again.

    I then booted from a SystemRescueCD image, downloaded from http://www.sysresccd.org/ , which I used to re-create the filesystems and untar the tape. Know how to use parted and fdisk beforehand - it's a pain!

    I then rebooted the machine and, in fairness, with only a few minor glitches, it worked.

    The glitches - SystemRescueCD only creates ext2 filesystems. The fstab file had the the filesystems down as ext3. This was easily fixed in the fstab, but when I went to update the filesystems to ext3 afterwards, /var played up a bit. It didn't like being unmounted with the machine booted and therefore couldn't be updated. I booted from disk 1 of the install media, did a 'linux rescue' from the boot: prompt and updated it that way.

    When the machine was booting, there were a few directories missing from /var - obviously didn't or couldn't be backed up.
    /var/log/wtmp, /var/log/utmp, /var/run/wtmp, /var/log/utmp, /var/lock/subsys
    I just re-created these manually and it booted fine.

    Last was an X windows thing. /var/gdm needed to be owned and group'd by a user called gdm or X wouldn't start. So, I chown'd and chgrp'd the directory and away it went.

    Next thing is the boot device - I'm not looking forward to that.


Advertisement