Saturday, July 16, 2016

Linux OS Backup restore using Dump and Restore

1 Insert the OS media and reboot.
2 Go to Linux rescue mode. Dont mount your root directory in /mnt/sysimage. Skip this step
3 Make interface up for eth0 or eth1.
   Give your IP and subnet mask
4 If you are not able to ping to other server check the routing table
   #netstat –rn
   if no gateway is mentioned give your default gateway.
   #route add default gw gateway IP
   Ping your nfs server.
5 Mount the nfs file to local server.
6 Create an example directory like /example-mount_point.
   mount server:/nfs path /example-mount_point.
7 Delete the existing filesystem using fdisk command
   # fdisk /dev/lmo/c0d0
8 Now create the File systems as per the Prod server and label it accordingly.
   # fdisk /dev/lmo/c0d0
   Eg: mkfs.ext3  /dev/lmo/c0d0p1
9 Then create directories as following:
   mkdir /newroot
   mkdir /newvar
   mkdir /newopt
   mkdir /newboot
10 Identify and label your root, boot, var,opt FS
11 Now mount the your FSs on newly created mount point
     Ex: mount /dev/mapper/VolGroup00-lvol00 /newboot
12 Now cd to /newboot and give the following command
   #restore -r -f  /restore/servername/boot-backup
13 Now wait till the time it restore full backup
14 Follow the same step from 6-9 for the rest FSs.
15 Now rename all the mount point as per DC standard. If is not the fresh server then no need to rename the mount points because it will take the updated details from your fstab file.
   Eg: #e2label  /dev/lmo/c0d0p1  /
   e2label  /dev/lmo/c0d0p2  /boot
   e2label  /dev/lmo/c0d0p3  /var
   Make changes in /etc/fstab file
16 Do the necessary changes in grub.conf file according to your boot partition
     Eg: root (hd0,0) for  /dev/lmo/c0d0p1 Partition 1st
17 Now reboot the server.
18 Now create the swap partition or swap FS if it is not there. Use fdisk utility to create it.
    #mkswap dev/lmo/c0d0p5
    #swapon dev/lmo/c0d0p3
    #swapon –s
 
If you have face any grub related problem during booting
Insert the OS media and reboot.
Go to Linux rescue mode. mount your root directory in /mnt/sysimage
     #chroot /mnt/sysimage
     #/sbin/grub-install /dev/lmo/c0d0

No comments:

Post a Comment