Bacula-users

Re: [Bacula-users] Bacula Rescue CD - Boot Problems

2009-04-22 12:57:29
Subject: Re: [Bacula-users] Bacula Rescue CD - Boot Problems
From: Josh Fisher <jfisher AT pvct DOT com>
To: Beorn Harris <beornharris AT gmail DOT com>
Date: Wed, 22 Apr 2009 12:51:38 -0400
I don't use VMWare, but what I do for Centos 5 Xen is keep a minimal 
Centos 5 VM template in a file on the host server's file system. In this 
case, physical servers are a two-node cluster, and a copy of the 
template VM is kept on both nodes. The VMs are in LVM partitions on DRBD 
storage. The template VM has Dir, SD, and FD installed and copies of all 
Bacula config files. A RunAfter script for the catalog backup job copies 
the bootstrap file for the catalog backup to NFS shares on both server 
nodes. When backups are rotated off-site, a USB pen drive with the 
template VM file and corresponding catalog backup bootstrap file go with 
them.

To restore a completely trashed VM:

  - The template VM is dd'd into the production VM's LVM partition
  - The file system on the LVM partition is resized to fill the partition
  - The VM is booted
  - The bacula-fd is started on the VM using the correct fd config
  - A restore job restores the VM's files

I believe this method is easier to maintain. Once setup, it is 
essentially all automated, thanks to Bacula. Booting problems are 
unlikely, and it makes restoring SD and Dir much easier. Also, since 
static versions of the Bacula daemons are not needed, it allows for 
using TLS encryption.

Bare-metal recovery of the two-node cluster is a bit more involved. On a 
single host server, rather than a cluster, it would be easier. I prefer 
to install a minimal OS on the replacement hardware, rather than rely on 
a rescue CD, for two reasons. One, if the install media is bad, a 
standard OS install DVD is readily obtained. Two, if the new hardware is 
different than the old, then the rescue CD may not contain appropriate 
hardware drivers.

  - Fairly minimal Xen-enabled Centos is installed from DVD on both 
replacement server nodes
  - Static networking is configured for both nodes
  - DRBD is installed, configured, and synched on both nodes
  - LVM partitions for the VM's are created
  - On one node, the template VM and catalog backup bootstrap are copied 
from the USB pen drive
  - The template is dd'd into the SD/Dir VM's LVM partition
  - The SD/Dir VM is started and networking and access to the backup 
volumes is configured
  - Bacula catalog is initialized and SD and Dir are started on the VM
  - The bootstrap file is copied to the VM and the Bacula catalog restored
  - The file systems on both host nodes are restored from backups
  - STONITH and Heartbeat are disabled on the newly restored host nodes
  - The host nodes are re-booted and the SD/Dir VM is started.
  - The rest of the VMs are restored one at a time as described above.
  - STONITH and Heartbeat are enabled on both nodes, starting the VM's 
on their preferred nodes


Beorn Harris wrote:
> Hi,
>
> I have been tearing my hair out over this one...I am trying to test a bare 
> metal recovery, but so far have been unable to get the bacula rescue CDROM to 
> boot.  I am able to generate the CDROM, and it gets past the isolinux 
> selection menu, but fails after initial kernel load...
>
> Write protecting the kernel read-only data: 475k
> Failed to execute /init
> Kernel panic - not syncing: no init found.  Try passing init= option to 
> kernel.
>
> I am using Rehat EL5 on a VMWare virtual machine (note that it is a different 
> VM I am trying to restore to).  I am trying to generate the rescue CD from 
> the 
> scripts in /etc/bacula/rescue.  I have also tried commenting out the cpio 
> version that makes the initrd without success either.
>
> I have done as much googling and RTFMming as I think I can...anyone have any 
> other thoughts?
>
> Cheers
>
> Beorn
>
> Other details as follows :
>
> # uname -r
> 2.6.18-92.el5
>
> # rpm -qa | grep bacula
> bacula-client-2.4.4-1.el5.pp
> bacula-2.4.4-1.el5.pp
>
> # cat /etc/bacula/rescue/linux/cdrom/cdtree/boot/isolinux/isolinux.cfg
> default linux
> prompt 1
> display boot.msg
> timeout 300
> F1 boot.msg
> F2 options.msg
> F3 general.msg
> F4 kernel.msg
> label linux
>   kernel vmlinuz
>   append ramdisk_size=126279680 initrd=initrd.img
> label memtest86
>   kernel memtest
>   append -
>
> And finally, output from the build process
>
> # pwd                                                                  
> /etc/bacula/rescue                                                            
>                  
>
> # make                                                                 
> (cd linux/cdrom; make all)                                                    
>                  
> make[1]: Entering directory `/etc/bacula/rescue/linux/cdrom'                  
>                  
> ./makekernel                                                                  
>                  
> Updating modules in root RAM disk                                             
>                  
> Coping /boot/vmlinuz-2.6.18-92.el5 to 
> /etc/bacula/rescue/linux/cdrom/cdtree/boot/isolinux/vmlinuz
> ./makebinaries                                                                
>                    
> Building root /sbin. Some Could not find messages are normal ...              
>                    
> ==== Could not find ash on your system ====                                   
>                    
> ==== Could not find ata-id on your system ====                                
>                    
> ==== Could not find checkproc on your system ====                             
>                    
> ==== Could not find dhcpd on your system ====                                 
>                    
> ==== Could not find fsck.jfs on your system ====                              
>                    
> ==== Could not find hotplug on your system ====                               
>                    
> ==== Could not find hwup on your system ====                                  
>                    
> ==== Could not find lilo on your system ====                                  
>                    
> ==== Could not find ltrace on your system ====                                
>                    
> ==== Could not find mkfs.jfs on your system ====                              
>                    
> ==== Could not find mkreiserfs on your system ====                            
>                    
> ==== Could not find mt on your system ====                                    
>                    
> ==== Could not find path_id on your system ====                               
>                    
> ==== Could not find raidstart on your system ====                             
>                    
> ==== Could not find reiserfsck on your system ====                            
>                    
> ==== Could not find scsi_info on your system ====                             
>                    
> ==== Could not find strace on your system ====                                
>                    
> ==== Could not find udev on your system ====                                  
>                    
> ==== Could not find udevstart on your system ====                             
>                    
> ==== Could not find vol_id on your system ====                                
>                    
> Building root shared libaries ...                                             
>                    
> Building /etc ...                                                             
>                    
> =====================================================                         
>                    
> ====                                             ====                         
>                    
> ==== Warning your /etc/ssh directory was copied. ====                         
>                    
> ==== Keep this directory and the CDROM secure.   ====                         
>                    
> ====                                             ====                         
>                    
> =====================================================                         
>                    
> make[2]: Entering directory `/etc/bacula/rescue/linux/cdrom/bacula'           
>                    
> ./getdiskinfo                                                                 
>                    
> Begin collecting system info ...                                              
>                    
> df: `/etc/bacula/rescue/linux/cdrom/mnt': No such file or directory           
>                    
> Gathering LVM information                                                     
>                    
>   /dev/hda: open failed: No medium found
>   /dev/hda: open failed: No medium found
>   No volume groups found
>   /dev/hda: open failed: No medium found
>   No volume groups found
> Done collecting info.
> Begin creating scripts ...
> Done making partitioning scripts
> Begin making formatting script(s) ...
> Begin making LVM formatting script(s) ...
> Done building scripts.
> ./make_rescue_disk
> ./copy_to_roottree
> make[2]: Leaving directory `/etc/bacula/rescue/linux/cdrom/bacula'
> ./makeinitrd
> Creating the Initial RAM disk image....
> Initial RAM disk contents will be 123320 KB
> 123320+0 records in
> 123320+0 records out
> 126279680 bytes (126 MB) copied, 0.572853 seconds, 220 MB/s
> Building initial RAM disk done
> Compressing the RAM disk image....
> Ramdisk size is 126279680
> Making isolinux.cfg
> Initial RAM disk initrd.img is built.
> rm -f bootcd.iso
> mkisofs -A "Bacula Rescue Disk" -V "Bacula Rescue Disk" \
>           -J -R -T -o bootcd.iso \
>           -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
>           -no-emul-boot -boot-load-size 4 -boot-info-table cdtree
> INFO:   UTF-8 character encoding detected by locale settings.
>         Assuming UTF-8 encoded filenames on source filesystem,
>         use -input-charset to override.
> Size of boot image is 4 sectors -> No emulation
>  27.56% done, estimate finish Wed Apr 22 14:11:21 2009
>  55.04% done, estimate finish Wed Apr 22 14:11:21 2009
>  82.60% done, estimate finish Wed Apr 22 14:11:21 2009
> Total translation table size: 5149
> Total rockridge attributes bytes: 1821
> Total directory bytes: 4096
> Path table size(bytes): 38
> Max brk space used 0
> 18169 extents written (35 MB)
> make[1]: Leaving directory `/etc/bacula/rescue/linux/cdrom'
>
>
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and 
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today. 
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>   

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users