Recovering OES File System Data with LVM

You can recover the OES file system data with Logical Volume Manager (LVM)

Before you begin

Make sure to backup the required LVM data and obtain the configuration information of the original system. For instructions, see Backing Up LVM Data for OES File System Recovery


  1. Boot the new hardware with RH 5.4 DVD
    • Insert the DVD and boot.
    • Select /dev/sdb as the install drive.

      Do not install the minimal system on the disk where the original root is to be restored.

    • Select customize now during package installation.
    • Unselect everything for a minimal install.

      Change the root (default) VG name before install to “VGrestore” (or something other than the default) to avoid LVM names that conflict with the original VG/LV names.

  2. Post install of minimal system
    • /dev/sdb1 - has /boot
    • /dev/sdb2 – has “VGrestore” VG with default install LV’s.
    • Use fdisk to recreate /dev/sda1 and /dev/sda2 partitions as they were on the original system.
    • In this example we also need to set /dev/sda2 to partition type “8e” (LVM) with fdisk.
  3. Since this is a restore and not a re-install, we need the UUID of original /dev/sda2 to be used with the pvcreate command. The UUID information can be found in the files created by the vgcfgbackup command run previously.

    Now Initialize the disk to be used with LVM, and then restore the original VG information.

    •  pvcreate –f –u <saved_uuid for sda2> /dev/sda2
    • pvcreate –f –u <saved_uuid for sdc1> /dev/sdc1
    • vgcfgrestore –f VgGroup01.VG_backup VgGroup01
    • vgcfgrestore –f xyzzy.VG_backup xyzzy
    • vgchange –a y VolGroup01
    • vgchange –a y xyzzy
    • mkfs.ext3 /dev/mapper/VgGroup01-LogVol00
    • mkfs.ext3 /dev/sda1
  4. Setup to restore data from backup 
    • mkdir /mnt/boot
    • mkdir /mnt/proc
    • mount /dev/mapper/VolGroup01-LogVol00 /mnt
    • mount /dev/sda1 /mnt/boot
    • Install File System iDataAgent software on /dev/sdb2 (LogVol00)
  5. Restore LogVOl00 and /boot (old root)

        Original system information

        [root ~]# df -k

        Filesystem                         1K-blocks      Used  Available Use% Mounted on

        /dev/mapper/VolGroup01-LogVol00     7095808     3089588   3645772  46%     /

        /dev/sda1                           101086     12513     83354     14%    /boot

        tmpfs                               255296         0     255296    0%   /dev/shm

        /dev/mapper/xyzzy-space             3830056   1469924   2165572   41%   /space

        /dev/mapper/xyzzy-extra             4422688    140000   4058024   4%    /extra

        /dev/sdb1                           8254240   1188228   6646720   16%   /ext3

        [root ~]#

  6. Browse the full restore backup data (Default)
  7. Select everything associated with LogVol00 and /boot. Deselect /ext3,/extra and /space, as these three mount points are not part of LogVol00 or /boot.
  8. Perform a full restore, out of place to /mnt
  9. Once the restore completes, use fdisk and set the /dev/sda1 partition to bootable.
  10. Modify grub – current grub file

        cd /boot/grub.conf

        [root grub]# cat grub.conf

        # grub.conf generated by anaconda


        # Note that you do not have to rerun grub after making changes to this file

        # NOTICE:  You have a /boot partition.  This means that

        #          all kernel and initrd paths are relative to /boot/, eg.

        #          root (hd1,0)

        #          kernel /vmlinuz-version ro root=/dev/VolGroupRecover/LogVol00

        #          initrd /initrd-version.img







        ORIGINAL ENTRY – for /dev/sdb

        title Red Hat Enterprise Linux Server (2.6.18-164.el5)

            root (hd1,0)

            kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroupRecover/LogVol00

            initrd /initrd-2.6.18-164.el5.img

        ADD NEW ENTRY – for /dev/sda – the lines in red differ from the original entry

        title Red Hat Enterprise Linux Server (2.6.18-164.el5) RECOVER

            root (hd0,0)0)

            kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup01/LogVol00

            initrd /initrd-2.6.18-164.el5.img

  11. Reboot, interrupt grub,and then select “Red Hat Enterprise Linux Server (2.6.18-164.el5) RECOVER” entry from the list (the new grub entry).
  12. The system should now boot using the kernel restored from the /dev/sda1 drive and the root file system should be on /dev/sda2 (restored VolGroup01-LogVol00).
    • Execute “grub-install /dev/sda”. This should set grub to automatically boot using the /dev/sda1 (restored data) on the next boot.
    • Depending on the restored data, it may or may not be necessary to install the File System iDataAgent software again.
    • The /dev/sdb1 disk can be initialized/reformatted (old minimal system).
    • vgchange –a y xyzzy (this may have automatically occurred during boot).
    • The software can now be used to restore the data to /dev/sdb1 (/ext3) and the “xyzzy” volume group on /dev/sdc1 (/space and /extra).
    • If new hardware, the network information may need to be re-configured to enable the IP address.
  13. In our system, the /etc/fstab finds the /boot directory via LABEL, not by device. Modify the LABEL to add it to device /dev/sda1 (resorted boot directory) and remove it from /dev/sdb1.

        tune2fs –L /boot /dev/sda1

        tune2fs –L “” /dev/sdb1

  14. Reboot the System.

    System boots into the original root file system.

Full System Recovery - OES File System Agent

Related Tasks

Recovering OES File System Data