• Bare Metal Linux Restore

    Several weeks ago we started seeing some pretty scary errors showing up on the main system disk for our Blackboard server. We had an extra server hanging around, so we decided to move all the data off the failing disk and onto our spare server. The only question was how to make the new server as close to a perfect copy of the old one as possible. Simply restoring all the filesystems failed for a variety of reasons, mostly related to GRUB and the kernel, so I had to find a way of excluding only the files and directories that were tied to the specific model of server.

    To do this, I started by installing a minimal copy of RHEL 4, making sure to lay the filesystems out in exactly the same way as they were on the old server. I then went through several experiments, leaving just the bare minimum files and directories required for the hardware and booting, but formatting all other filesystems and restoring the data from our old server. In the end, the below process resulted in system that worked perfectly, and very closely mirrored the original server.

    • I conducted a minimal OS install on the new server, replicating the filesystem layout on the old server.
    • I booted the new server from DVD in rescue mode, allowing it to mount the filesystems in /mnt/sysimage
    • I removed EVERYTHING in every filesystem and directory EXCEPT the following:
    • Everything in /sys
    • Everything in /dev
    • Everything in /proc
    • Everything in /boot
    • /lib/modules
    • /etc/grub.conf
    • /etc/sysconficg/grub
    • /etc/modules.conf
    • /etc/fstab

    Next, I went to my backups and restored the entire system to /mnt/sysimage, making sure not to overwrite existing files. We use NetBackup, which defaults to not overwrite, but other systems are not so careful. If you accidentally overwrite the files we excluded from deletion above, your restored system will not boot.

    Once the restore was complete, I rebooted the system and it came up pretty much as a carbon copy of the old server. Once it was up and on the network, I ran “up2date -uf” to install the latest version of the kernel and I was done.

    This entry was posted on Tuesday, August 5th, 2008 at 12:14 pm and is filed under Data and Technology, Highlights. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
  • 8 Comments

    Take a look at some of the responses we've had to this article.

    1. Hi!
      I am going to wordcamp on Saturday, and during Wordcamp, I am going to be leading online wordgames on different people’s blogs.
      They will be silly, fun, low tech games using wordpress blogs.
      Would you like to host a game on your blog?
      Each game takes 15 minutes, and you would need to be able to post the game, and keep track of comments that 15 minutes while you are at wordcamp.
      Go to http://www.bodyabcs.com/bwp/word-games/ to read more about it.

      Much Love,
      dk

    2. André Blanchard
      Nov 20th
      Reply

      Hi,
      You say : I removed EVERYTHING in every filesystem and directory EXCEPT the following : everything in /sys …

      Do you mean you erase from /mnt/sysimage the content of /sys and if so did you got rid of the directory also or do you mean you maked it to not be restore from the backup?

      Thank you for your help

      André

    3. Nov 21st
      Reply

      Hi Andre,

      No, /sys, and everything in it needs to remain, or in your case, /mnt/sysimage/sys. The reason for this is that we do not install a new kernel when doing a bare metal restore. We allow the kernel from the bare-bones install to remain, and upgrade it later using up2date or yum. When you do your restore, make sure that you do not overwrite existing files because you will run into problems with grub if you install your old kernel from backup.

    4. Aug 13th
      Reply

      I am using Amanda open source. And I have restored the data to a NFS mount on Amanda Server, bu I am not able to mount it to the machine I am trying to restore. do you have any other suggestions?

    5. Oct 5th
      Reply

      I am using Amanda open source. And I have restored the data to a NFS mount on Amanda Server, bu I am not able to mount it to the machine I am trying to restore. do you have any other suggestions?

    6. Really interesting post. I am in a similar situation with testing recovery for RHEL 5.

      What did you need to do to get Netbackup to be able to restore to the /mnt/sysimage? DId you have to re-install the client etc? Did you have to chroot?

      Thanks very much.

      Regards,
      Simon Stanford

    7. Zman
      Feb 22nd
      Reply

      I am using amanda open source as well. is there anyone who tried this with Amanda open source?

      Thanks

      Regards
      Aziz

      • Feb 22nd
        Reply

        Any backup / recovery software should work exactly the same way provided you can restore to an alternate /.

  • Leave a Reply

    Let us know what you thought.

  • Name (required):

    Email (required):

    Website:

    Message:

Visitors have tagged this post: linux restore (30) - bare metal linux (28) - server (18) - Linux bare metal (14) - linux bare metal restore (13) - netbackup linux restore (12) - restore linux (11) - mounting local filesystems failed vmware (10) - restoring linux (9) - linux restore to different hardware (9) - system restore linux (8) - linux system restore (8) - metal linux (6) - bare linux (6) - restore linux to different hardware (6) - linux bare metal recovery (5) - linux dump restore (5) - restore linux NetBAckup (5) - baremetal linux (4) - bare metal linux restore (4) - rhel bare metal restore (4) - linux baremetal restore (4) - vmware mounting local filesystem failed (4) - system restore for linux (4) - bare metal restore linux (4) - dump restore linux (4) - linux restore /boot (4) - linux restore /dev (4) - solaris Bare Metal Recovery (4) - restore linux on different hardware (4) - redhat bare metal restore (4) - restore rhel4 to different hardware (4) - restore linux different hardware (4) - red hat bare metal restore (4) - rhel5 backup restore root (4) - metal spiral bound (3) - bare minimum linux (3) - netbackup restore linux (3) - linux restore on different hardware (3) - system restore in linux (3) - dump restore grub (3) - linux bare metal backup (3) - vmware mounting local filesystems failed (3) - bare metal restore on linux using netbackup (3) - restore linux in new server (3) - linux system recover /mnt/sys (3) - red hat bare metal backup (3) - restore linux root filesystem (3) - linux restore boot drive (3) - netbackup bare metal restore linux (3) - backup linux etc restore different machine (3) - restoring Linux backup to different hardware (3) - rhel4 restoring the root / filesystem (2) - bare metal rescue (2) - restoring rhel (2) - Bare Metal Restore for MAC (2) - restoring linux RHEL4 boot sector from netbackup (2) - bare metal restore RHEL (2) - linux restoring (2) - bare metal restore client linux (2) - rhel4 bare metal backup (2) - linux rescue mode netbackup (2) - how to restore linux server (2) - bare metal recovery (2) - linux restoring kernel (2) - bare metal recovery linux netbackup (2) - vmware linux rescue (2) - bare metal recovery linux (2) - linux dump restore howto (2) - vmware no grub configuration rhel (2) - install bare minimum rhel (2) - bare metal restore grub (2) - dump/restore LInux root filesystem (2) - how to restore linux (2) - rhel bare metal backup and restore (2) - mounting local filesystems failed vmware ("red hat enterprise linux 5 OR rhel5) (2) - system directories not to restore RHEL (2) - netbackup install linux rescue cd (2) - vmware redhat mounting local filesystem failed (2) - redhat linux bare metal restore (2) - rescue netbackup cd (2) - rhel bare metal backup restore (2) - bare metal recovery solaris (2) - How to do a system restore in Linux (2) - mac bare metal restore (2) - dump restore linux rescuecd (2) - dump restore overwrite (2) - linux dump bootable (2) - redhat restore different hardware (2) - bare metal recovery centos (2) - solaris 10 bare metal recovery (2) - restore to a partition from linux dump (2) - linux restore one file (2) - vmware restore linux from dump file (2) - Red Hat Enterprise Linux complete system restore from backups (2) - bare metal backup linux (2) - mounting local filesystem failed vmware (2) - red hat enterprise linux 5 dump restore (2) - recovering from netbackup redhat system (2) - netbackup linux rescue cd (2) - linux restore root (2) - linux restore -c (2) - restore grub directory in centos 5 (2) - restore linux to new hardware (2) - rescue linux netbackup client (2) - restore a Linux system with a different device tree (2) - system rescue cd bare metal recovery (2) - netbackup install boot server linux (2) - how to restore solaris 9 to different hardware (2) - Linux restore root filesystem (2) - centos bare metal restore (2) - backup and restore redhat linux (2) - backup and restore bare metal linux (2) - linux rescue cd install netbackup (2) - centos restore boot (2) - centos bare metal recovery (2) - bare metal centos dvd recovery (2) - dump restore grub redhat (2) - solaris bare metal restore (2) - dump / restore centos (2) - rhel5 recovery netbackup (2) - Bare Metal Restore: Boot Server linux (2) - redhat5 linux rescue (2) - Restoring full root file system on RHEL 4.x system with Symantec Netbackup client (2) - linux rhel4 bare metal restore to different hardware (1) - howto bare metal restore linux with symantec (1) - copying a server linux restore (1) - restore linux to differnt hardware (1) - restoring data from rescue mode rhel (1) - rhel restore grub (1) - rhel rescue mode mount -t smbfs (1) - symantec linux bare metal restore (1) - restoring / file system on RHEL4 (1) - rhel restoring directories (1) - rhel restore /boot (1) - linux rescue disk with netbackup client (1) - restoring Linux file systems (1) - linux bare copy (1) - restore (1) - bootable disk with netbackup client linux (1) - spiralbound bare metal (1) - restore rhel 5 linux disk (1) - minimal rhel4 (1) - restoring Linux on new system (1) - netbackup rhel bare metal restore (1) - restoring linux to new server (1) - rhel restore rescue (1) - linux restore / (1) - linux restore -x -M (1) - Symantc Bare metal for Linux (1) -