Restore from Backup

General support questions
Skadaddle
Posts: 8
Joined: 2018/04/11 16:29:35

Restore from Backup

Post by Skadaddle » 2018/04/11 17:15:12

Hello, I am new to CentOS and I hope you can help... We had an old Zimbra server running on CentOS 6.6.
The server died. I had a FULL file level backup of the server.

so, I built a Centos 6.6 Virtual machine on a Windows Hyper-v server. I had allocated 1.2TB to this virtual machine. But, when I installed the CentOS 6.6 , it created two partitions. on for the root (50GB) and a second partition called Home (1.1TB)
see attached screenshot 1-1.
1-1
1-1
Capture.JPG (26.04 KiB) Viewed 2318 times
it shows the partitions. and 2-2 shows the directory structure.

I then restored all the files/folders to a large partition on the virtual machine. Rebooted the VM.

I can see all the file/folder structure on the large partition. I tried editing the Grub.conf file of the Virtual machine using the Grub.conf files from the restored files. but, when I try to boot to the large partition. I get these errors
3-3
3-3
Grub_boot_Error.jpg (113.98 KiB) Viewed 2318 times
3-3

The goal is to get the Virtual machine to boot to the old zimbra server so I can access the admin console.
what am I missing in the grub.conf file? or did I miss something else?

Thanks for your guidance and Patience while I work through this...
Attachments
2-2
2-2
Screenshot.jpg (121.71 KiB) Viewed 2318 times

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Restore from Backup

Post by TrevorH » 2018/04/11 17:42:21

You appear to have restored your data to a different location - the files are now under /home/opt/zimbra and I am guessing that they used to be in just /opt/zimbra? If you don't want to be chasing around looking inside files and changing paths then you'll probably want to get the data back to the right location so everything is where it's expected to be.

Actually maybe I'm misunderstanding and you're actually trying to boot from there? That won't work.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Skadaddle
Posts: 8
Joined: 2018/04/11 16:29:35

Re: Restore from Backup

Post by Skadaddle » 2018/04/11 21:56:50

Tevor, Thanks for the quick response... So, how do I create a CentOS virtual machine and set it to use one large partition?
The iSCSI drive that the Virtual machine is on is 1.2TB.

If I can figure out how to do that. Then I can build the Centos VM, and then restore all the backed up files/folders to the root partition. I think that will allow me to boot from the old server... correct?

Thanks again for your guidance.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Restore from Backup

Post by TrevorH » 2018/04/11 22:56:09

I do not think you should restore system files onto a newly installed machine. You're most likely going to screw up rpm/yum databases as everything will be a different patch level unless you;re 100% sure that you were completely up to date at the time of the backup. I think you should concentrate on reinstalling your apps and the packages you need on the new system, then put the user nad app data back where it should be.

If your aim is to reinstall from the backed up copy then I think you'd do better to boot the install DVD in rescue mode, partition and format your new VM's disks as you want them, then untar your backup onto that. Once that's done, you'll most likely need to bind mount things like /proc, /dev, /sys and chroot into the newly installed system and install grub and then try to boot it.

Personally I'd build a new system and install the apps onto it and restore just the data.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Skadaddle
Posts: 8
Joined: 2018/04/11 16:29:35

Re: Restore from Backup

Post by Skadaddle » 2018/04/13 21:43:23

Thanks Trevor, This is all way over my head. I was searching and found a post with someone that had a similar situation. and one of the suggestions was to edit the /etc/fstab file.. and then modify the Grub file to force the system to boot from the directory that I restored all the files/folders to.. Here is my fstab file. This directory has all the files/folders from the restored backup.

/dev/mapper/vg_zimbra-lv_home /home

fstab.JPG
fstab.JPG (36.87 KiB) Viewed 2215 times
Here is results of df -h is shows that the /home directory location has 1.2 TB of space and the entire restored backups are taking up 1.1 TB
Capture.JPG
Capture.JPG (26.04 KiB) Viewed 2215 times
couldn't I just modify the grub.conf file and point to the /home directory

Here is the grub.conf file with in the /home directory where the restored backups are...

I would think I could just change the paths of the kernel and root... There are lots of entries. I am guessing the person that set this up loaded several kernels. I am thinking the 2nd entry ( highlighted in RED) was the last one it successfully booted from.


# 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 (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_mail-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/vda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title CentOS (2.6.32-504.12.2.el6.centos.plus.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-504.12.2.el6.centos.plus.x86_64 ro root=/dev/mapper/vg_mail2-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_mail2/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /initramfs-2.6.32-504.12.2.el6.centos.plus.x86_64.img
title CentOS (3.19.0-1.el6.elrepo.x86_64)
root (hd0,0)
kernel /vmlinuz-3.19.0-1.el6.elrepo.x86_64 ro root=/dev/mapper/vg_mail2-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_mail2/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /initramfs-3.19.0-1.el6.elrepo.x86_64.img

title CentOS (2.6.32-504.8.1.el6.centos.plus.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-504.8.1.el6.centos.plus.x86_64 ro root=/dev/mapper/vg_mail2-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_mail2/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /initramfs-2.6.32-504.8.1.el6.centos.plus.x86_64.img
title CentOS (2.6.32-431.29.2.el6.centos.plus.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.29.2.el6.centos.plus.x86_64 ro root=/dev/mapper/vg_mail2-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_mail2/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /initramfs-2.6.32-431.29.2.el6.centos.plus.x86_64.img
title CentOS (2.6.32-431.23.3.el6.centos.plus.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.23.3.el6.centos.plus.x86_64 ro root=/dev/mapper/vg_mail2-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_mail2/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /initramfs-2.6.32-431.23.3.el6.centos.plus.x86_64.img
title CentOS (2.6.32-431.5.1.el6.centos.plus.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.5.1.el6.centos.plus.x86_64 ro root=/dev/mapper/vg_mail2-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_mail2/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /initramfs-2.6.32-431.5.1.el6.centos.plus.x86_64.img
title CentOS (3.13.1-1.el6.elrepo.x86_64)
root (hd0,0)
kernel /vmlinuz-3.13.1-1.el6.elrepo.x86_64 ro root=/dev/mapper/vg_mail2-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_mail2/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /initramfs-3.13.1-1.el6.elrepo.x86_64.img
title CentOS (3.12.5-1.el6.elrepo.x86_64)
root (hd0,0)
kernel /vmlinuz-3.12.5-1.el6.elrepo.x86_64 ro root=/dev/mapper/vg_mail2-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_mail2/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /initramfs-3.12.5-1.el6.elrepo.x86_64.img
title CentOS (3.10.10-1.el6.elrepo.x86_64)
root (hd0,0)
kernel /vmlinuz-3.10.10-1.el6.elrepo.x86_64 ro root=/dev/mapper/vg_mail2-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_mail2/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
initrd /initramfs-3.10.10-1.el6.elrepo.x86_64.img

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Restore from Backup

Post by TrevorH » 2018/04/14 12:25:25

You cannot boot from /home. You need to either set up a new system and restore ONLY your data and not touch the operating system at all or you need to restore your current (hopefully full system) backup to an empty filesystem that you can use as your new root. If you choose the latter option then you also need to do some other things, among which will be to install grub to the disk so that it can boot. It may also be necessary to create a .autorelabel file in the to-be root directory so that the system does a full selinux relabel on the first boot and sets all the contexts right (I am unsure if your backup will include the selinux labels nor if your restore will put them back as they should be).
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Skadaddle
Posts: 8
Joined: 2018/04/11 16:29:35

Re: Restore from Backup

Post by Skadaddle » 2018/04/18 13:18:15

Trevor, Thank you for all your help. OK, if I rebuild a new virtual machine with CentOS 6.6 how do I go about creating one large partition for the /root ?

when I created the first one, it created a 50GB /root partition and then a 2nd partition of 1.2TB. This is where I was forced to restore the backed up files/folders....

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Restore from Backup

Post by TrevorH » 2018/04/18 14:18:25

There is a partitioning section in the CentOS installer GUI as you run through it. The default on an unpartitioned disk will be to divide it up as it sees fit - usually 50GB to / and everything else in /home. There's an option to do the partitioning yourself and set it up as you see fit.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Skadaddle
Posts: 8
Joined: 2018/04/11 16:29:35

Re: Restore from Backup

Post by Skadaddle » 2018/04/19 13:47:24

Thanks Trevor... so, since I am not a guru like you. is there a tutorial somewhere that can walk me through the install GUI and setup the single partition and have /root take up 1.2 TB's ??

Skadaddle
Posts: 8
Joined: 2018/04/11 16:29:35

Re: Restore from Backup

Post by Skadaddle » 2018/04/24 13:37:08

Hello, Just following up... anyone know of a CentOS installation Tutorial that will allow me to set the /root partition to use the maximum amount of a drive? This is a virtual machine running on Microsoft Hyper-V 2012R2. the space available to this VM is 1.2TB.
when I run through the installation GUI it sees the drive. but, it only allocates 50GB to the /root partition. I need it to take the entire drive. But, I don't see an option in the installation GUI to adjust the size....

Post Reply