Restore from Backup

Running our Appliance (ZCA), ZCS on VMware, or any other virtual machine software? Post your thoughts here.
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 318
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: Release 8.7.11_GA_1854.RHEL6_64.P7
Contact:

Re: Restore from Backup

Postby JDunphy » Fri Apr 06, 2018 2:46 pm

So it looks /dev/sda2 is your disk that you want to boot from. If all of this seems a little too much for you, the second option might work better. That scenario goes like this.

1) you use /dev/sda1 (50GB root disk) as your boot disk and centos operating system
2) you install zimbra software only to this 50GB envrionment
3) you blow away the /opt/zimbra that you just installed on/dev/sda1 since we are after the other stuff zimbra installs in /etc and libs, etc
4) you mount /dev/sda2 as you are doing now but symlink /home/opt/zimbra to /opt/zimbra on 50GB root disk.
4b) you try and start zimbra (might work)
4c) you rerun zimbra install in update mode and let it fix everything should permissions be out, etc.
5) Over time begin removing all that extra stuff that you don't use on /dev/sda2 and free up more disk space for zimbra to grow into. That you chose LVM will help you grow this for the future anyway by adding more disk and resizing the filesystem.

This is the second strategy should you fail to get /dev/sda2 bootable but given you want to boot /dev/sda2,
add this to the list of things to do... modify /etc/fstab on /dev/sad2 so that the entries match... ie. run blkid /dev/sda2 and replace UUID's with those values if that is being used. You also need to navigate having LVM as your boot disk so I am unsure if you need a parameter with install-grub /dev/sda2 or if that is enough. It been a long time since I have done this (over 15 years). Running through a gentoo installation by hand on a VM will teach you a lot about the bootstrapping of linux as everything is done by hand. You might try that to get a feel for grub, LVM, chroot, etc.

As these are zimbra boards, you probably would get better advice on a centos board but I'll try because who doesn't like a good challenge and learn something. :-)


User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 318
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: Release 8.7.11_GA_1854.RHEL6_64.P7
Contact:

Re: Restore from Backup

Postby JDunphy » Fri Apr 06, 2018 2:49 pm

skadaddle wrote:Jim, here is the grub.conf file... can we modify this to allow me to choose which partition to boot 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_zimbra-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS 6 (2.6.32-504.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-504.el6.x86_64 ro root=/dev/mapper/vg_zimbra-lv_root rd_NO_LUKS rd_LVM_LV=vg_zimbra/lv_root LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=vg_zimbra/lv_swap KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-504.el6.x86_64.img


My guess is modify hd0 to hd2 and double check you have the same kernels that you are attempting here... ie. ls -l /boot on /dev/sda2 and compare that it all matches up... also verify /etc/fstab on your zimbra disk so filesystem match up... ie. root, swap, etc. hmmm... I think you need to chroot to that zimbra root disk before you do your upgrade now that I think of it.
skadaddle
Posts: 17
Joined: Wed Apr 04, 2018 3:11 pm

Re: Restore from Backup

Postby skadaddle » Fri Apr 06, 2018 3:06 pm

WOW, Thanks for the quick response JIm. I am afraid I will need more help... I really don't know much about Centos...

I typed in the command you requested. ls -l /boot on /dev/sda2
it said...

No such file or directory found

I tried to change directory to the partition that has the old zimbra server on it but it said, Not a directory. see screenshot below..

step by step instructions would be very much appreciated... :-)
Attachments
Capture2.JPG
Capture2.JPG (25.69 KiB) Viewed 911 times
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 318
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: Release 8.7.11_GA_1854.RHEL6_64.P7
Contact:

Re: Restore from Backup

Postby JDunphy » Fri Apr 06, 2018 3:08 pm

skadaddle wrote:WOW, Thanks for the quick response JIm. I am afraid I will need more help... I really don't know much about Centos...

I typed in the command you requested. ls -l /boot on /dev/sda2
it said...

No such file or directory found

I tried to change directory to the partition that has the old zimbra server on it but it said, Not a directory. see screenshot below..

step by step instructions would be very much appreciated... :-)

/dev/sda2 means /home in your environment... I am mixing and matching terms... sda2, your zimbra disk and /home - all the same.
skadaddle
Posts: 17
Joined: Wed Apr 04, 2018 3:11 pm

Re: Restore from Backup

Postby skadaddle » Fri Apr 06, 2018 3:34 pm

OK, first step... I SSH into the virtual machine.

Here is the output of the first command you recommended...
login as: root
root@192.168.200.xx's password:
Last login: Fri Apr 6 08:26:11 2018
[root@Zimbra ~]# ls -l /dev/sda2
brw-rw----. 1 root disk 8, 2 Apr 6 08:25 /dev/sda2
[root@Zimbra ~]#

you suggested to compare this... compare to what?

also, you suggested to verify /etc/fstab on my zimbra disk so filesystem match up... ie. root, swap, etc. how do I do this? ie. cd /dev/sda2 /etc/fstab ??
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 318
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: Release 8.7.11_GA_1854.RHEL6_64.P7
Contact:

Re: Restore from Backup

Postby JDunphy » Fri Apr 06, 2018 4:07 pm

You were showing the grub.conf file but didn't tell me where it came from... I said verify that you have the kernels (vmlinuz-), initrd, etc that you were showing so they matched up. That was ment to catch mistakes if you were showing /boot vs /home/boot grub.conf ... you need to focus on /home/boot /home/etc and make sure those entries match up. If you don't understand what those grub.conf fields are, it is probably time to slow down a bit and look them up. It is easy to get confused when you are attempting to switch and have 2 of everything. There is probably going to be 3-4 commands to issue to make this partition bootable and I am reacting to what you are showing me within the context and then I just make mistakes. :-)

Probably time to recap.

You have shown me 1 disk that has 2 partitions. You have a bootloader already installed on that disk (grub) so perhaps make a new entry /boot/grub.conf (sda1) and make sure it maps to those kernel and inintrd from sda2. Hard to be clear... perhaps showing me the contents of /home/boot /home/boot/grub.conf and /home/etc/fstab would help. What I would do is copy the entry from /home/boot/grub.conf and paste the entry into /boot/grub.conf ... So now you have 2 kernels to boot. The first would be sda1 and the second would be sda2 which is your zimbra disk. Make the grub boot label is clear so you know what each kernel is.

I am thinking you would try this first.

Code: Select all

fix anything with /home/etc/fstab that could be different with the new root disk (sda2) hd(0,1) vs hd(0,0)
add entry to /boot/grub.conf for this new root disk
reboot

If you like this.. then make this second kernel the default by changing /boot/grub.conf

Note: I made a mistake earlier thinking you would use hd(2,0) in grub.conf... I forgot you had 1 disk with 2 partitions. So your grub.conf entry needs to change to hd(0,1) from the grub.conf entry you copy from /home/boot/grub.conf to /boot/grub.conf

Does this make sense?
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 318
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: Release 8.7.11_GA_1854.RHEL6_64.P7
Contact:

Re: Restore from Backup

Postby JDunphy » Fri Apr 06, 2018 4:13 pm

Going slower and step by step

Code: Select all

cat /home/boot/grub.conf
cat /home/etc/fstab
ls /home/boot
cat /boot/grub.conf

I think that is what I need. I can then give you an entry to put inside /boot/grub.conf so you can reboot.
skadaddle
Posts: 17
Joined: Wed Apr 04, 2018 3:11 pm

Re: Restore from Backup

Postby skadaddle » Fri Apr 06, 2018 4:18 pm

yes, we need to take this slow... one step at a time. OK. you want me to compare the two Grub files. correct?

One is located on Root/boot/grub/grub.confi
The other is located on Root/home/grup/grub.conf

if this is correct. I will get the grub.conf file from each directory and show you. then you can tell me what to look for or change... OK?
Attachments
GRUB.jpg
GRUB.jpg (85.22 KiB) Viewed 901 times
skadaddle
Posts: 17
Joined: Wed Apr 04, 2018 3:11 pm

Re: Restore from Backup

Postby skadaddle » Fri Apr 06, 2018 4:23 pm

This is alot. hope you can understand it. the first and last commands said no such file or directory. Here is the output of those commands...

login as: root
root@192.168.200.xx's password:
Last login: Fri Apr 6 08:28:58 2018
[root@Zimbra ~]# cat /home/boot/grub.conf
cat: /home/boot/grub.conf: No such file or directory
[root@Zimbra ~]# cat /home/etc/fstab

#
# /etc/fstab
# Created by anaconda on Wed Jan 4 00:23:15 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_mail2-lv_root / ext4 defaults,noatime 11
/dev/vda1 /boot ext4 defaults 12
#/dev/vdb /opt ext4 defaults,noatime 12
UUID=6d930f71-6993-4442-926a-be1a23b20f4f /opt ext4 defaults,noatime 1 2
UUID=9b046257-af4e-45c5-b1db-8461f8bc6980 /opt/ZBack/backup ext4 defaults,noatime 1 2
/dev/mapper/vg_mail2-lv_swap swap swap defaults 00
#
#####
# This Zimbra backup drive is mounted at the end of the
# init startup process. Ref. /etc/rc.d/rc.local
#
# /dev/sda /opt/ZBack/backup ext4 _netdev 00
####
#
tmpfs /dev/shm tmpfs defaults 00
devpts /dev/pts devpts gid=5,mode=620 00
sysfs /sys sysfs defaults 00
proc /proc proc defaults 00
tmpfs /opt/zimbra/data/amavisd/tmp tmpfs defaults,noexec,nodev,nosuid,size=1024m,mode=750,uid=zimbra,gid=zimbra 0 0

#####
## FTP Server Data Mappings
/opt/ftp/virtual_users/ACO\040Course /opt/ftp/virtual_users/csmith/ACO\040Course none rw,bind 0 0
/opt/ftp/virtual_users/ACO\040Course /opt/ftp/virtual_users/cseaton/ACO\040Course none rw,bind 0 0
/opt/ftp/virtual_users/ACO\040Course /opt/ftp/virtual_users/srichter/ACO\040Course none rw,bind 0 0
/opt/ftp/virtual_users/ACO\040Course /opt/ftp/virtual_users/anon_home/ACO\040Course none r,bind 0 0
/opt/ftp/virtual_users/ACO\040Course /opt/ftp/virtual_users/kbanasky/ACO\040Course none r,bind 0 0
[root@Zimbra ~]# ls /home/boot
config-2.6.32-220.el6.x86_64
config-2.6.32-431.23.3.el6.centos.plus.x86_64
config-2.6.32-431.29.2.el6.centos.plus.x86_64
config-2.6.32-431.5.1.el6.centos.plus.x86_64
config-2.6.32-504.12.2.el6.centos.plus.x86_64
config-2.6.32-504.8.1.el6.centos.plus.x86_64
config-3.10.10-1.el6.elrepo.x86_64
config-3.12.5-1.el6.elrepo.x86_64
config-3.13.1-1.el6.elrepo.x86_64
config-3.19.0-1.el6.elrepo.x86_64
efi
grub
initramfs-2.6.32-220.4.2.el6.centos.plus.x86_64_kvb.img
initramfs-2.6.32-220.el6.x86_64.img
initramfs-2.6.32-431.23.3.el6.centos.plus.x86_64.img
initramfs-2.6.32-431.29.2.el6.centos.plus.x86_64.img
initramfs-2.6.32-431.5.1.el6.centos.plus.x86_64.img
initramfs-2.6.32-504.12.2.el6.centos.plus.x86_64.img
initramfs-2.6.32-504.8.1.el6.centos.plus.x86_64.img
initramfs-3.10.10-1.el6.elrepo.x86_64.img
initramfs-3.12.5-1.el6.elrepo.x86_64.img
initramfs-3.13.1-1.el6.elrepo.x86_64.img
initramfs-3.19.0-1.el6.elrepo.x86_64.img
initrd-2.6.32-220.el6.x86_64kdump.img
lost+found
symvers-2.6.32-220.el6.x86_64.gz
symvers-2.6.32-431.23.3.el6.centos.plus.x86_64.gz
symvers-2.6.32-431.29.2.el6.centos.plus.x86_64.gz
symvers-2.6.32-431.5.1.el6.centos.plus.x86_64.gz
symvers-2.6.32-504.12.2.el6.centos.plus.x86_64.gz
symvers-2.6.32-504.8.1.el6.centos.plus.x86_64.gz
symvers-3.10.10-1.el6.elrepo.x86_64.gz
symvers-3.12.5-1.el6.elrepo.x86_64.gz
symvers-3.13.1-1.el6.elrepo.x86_64.gz
symvers-3.19.0-1.el6.elrepo.x86_64.gz
System.map-2.6.32-220.el6.x86_64
System.map-2.6.32-431.23.3.el6.centos.plus.x86_64
System.map-2.6.32-431.29.2.el6.centos.plus.x86_64
System.map-2.6.32-431.5.1.el6.centos.plus.x86_64
System.map-2.6.32-504.12.2.el6.centos.plus.x86_64
System.map-2.6.32-504.8.1.el6.centos.plus.x86_64
System.map-3.10.10-1.el6.elrepo.x86_64
System.map-3.12.5-1.el6.elrepo.x86_64
System.map-3.13.1-1.el6.elrepo.x86_64
System.map-3.19.0-1.el6.elrepo.x86_64
vmlinuz-2.6.32-220.el6.x86_64
vmlinuz-2.6.32-431.23.3.el6.centos.plus.x86_64
vmlinuz-2.6.32-431.29.2.el6.centos.plus.x86_64
vmlinuz-2.6.32-431.5.1.el6.centos.plus.x86_64
vmlinuz-2.6.32-504.12.2.el6.centos.plus.x86_64
vmlinuz-2.6.32-504.8.1.el6.centos.plus.x86_64
vmlinuz-3.10.10-1.el6.elrepo.x86_64
vmlinuz-3.12.5-1.el6.elrepo.x86_64
vmlinuz-3.13.1-1.el6.elrepo.x86_64
vmlinuz-3.19.0-1.el6.elrepo.x86_64
[root@Zimbra ~]# cat /boot/grub.conf
cat: /boot/grub.conf: No such file or directory
[root@Zimbra ~]#
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 318
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: Release 8.7.11_GA_1854.RHEL6_64.P7
Contact:

Re: Restore from Backup

Postby JDunphy » Fri Apr 06, 2018 4:40 pm

Sorry about that... grub is here:

Code: Select all

cat /boot/grub/grub.conf
cat /home/boot/grub/grub.conf

Return to “Virtualization”

Who is online

Users browsing this forum: No registered users and 0 guests