2 Quick guide on how to make a custom Solaris boot CD to use as a Bacula
3 client rescue CD for Solaris 10_03/05 x86 (FCS).
5 copyright Robert W Hartzell 2006-04-21 <rwhartz at cox.net>
8 1) Static compiled file daemon and config files for your setup.
9 2) Solaris 10_03/05 CD 1 of 4
11 4) super-user access to build the miniroot & iso image.
16 2) Create an empty file to hold the miniroot plus a little extra room
17 and leaves about 290mb free on the CD
19 # mkfile 360m /var/tmp/miniroot
21 3) Map the file to a block device
23 # lofiadm -a /var/tmp/miniroot
26 4) Create a new file system on the miniroot
28 # newfs -i 8192 -m 1 /dev/rlofi/1
30 newfs: construct a new file system /dev/rlofi/1: (y/n)? y
31 /dev/rlofi/1: 736800 sectors in 1228 cylinders of 1 tracks, 600 sectors
32 359.8MB in 77 cyl groups (16 c/g, 4.69MB/g, 576 i/g)
33 super-block backups (for fsck -F ufs -o b=#) at:
34 32, 9632, 19232, 28832, 38432, 48032, 57632, 67232, 76832, 86432,
35 643232, 652832, 662432, 672032, 681632, 691232, 700832, 710432,
38 5) Mount the block device
40 # mount /dev/lofi/1 /mnt
42 6) Copy the root image to the miniroot file system
45 # find . -depth -print | cpio -pdm /mnt
48 7) Add your static built fd and config files to /mnt
49 I just reproduced my production directory structure so it looks
50 like this but you can place the files however you want. Just make
51 sure they match the config files.
60 bacula bconsole btraceback.dbx btraceback.gdb gconsole
66 bacula-ctl-fd bacula-fd.conf bconsole.conf
69 bacula-fd bconsole btraceback
71 Edit your config files so that the working directory
72 is /tmp so bacula has writable place to put the pid and state file.
74 I also needed to copy some gcc libs from /usr/sfw/lib to the miniroot
75 and setup a couple of softlinks. Put them in the /mnt/usr/sfw/lib
78 # cp /usr/sfw/lib/libgcc_s.so.1 .
79 # ln -s libgcc_s.so.1 libgcc_s.so
80 # cp /usr/sfw/lib/libstdc++.so.6.0.3 .
81 # ln -s libstdc++.so.6.0.3 libstdc++.so.6
83 8) Unmount the file system and delete the lofi device
86 # lofiadm -d /dev/lofi/1
88 9) Extract the boot files from the CD
90 a) Turn off the volume manager
91 # /etc/init.d/volmgt stop
92 b) The CD should stll be in the drive. Make sure you use the correct
93 device for your CDROM drive
95 # dd if=/dev/dsk/c1t0d0p0 of=/tmp/mboot+pboot.cd bs=512 count=2
99 c) Save the bootblk into a file named bootblk.cd
101 # dd if=/dev/dsk/c1t0d0p0 of=/tmp/bootblk.cd bs=512 iseek=4 count=60
105 10) Create the boot files
107 a) Create the bootimage
109 # cp /tmp/mboot+pboot.cd /tmp/isodir/.bootimage
111 b) Create the boot file with a 1k gap in the file
113 # cp /tmp/mboot+pboot.cd /tmp/genboot
114 # dd if=/dev/zero bs=1024 count=1 >> /tmp/genboot
117 # cat /tmp/bootblk.cd >> /tmp/genboot
119 11) Add your custom content to the CD image (max size is about 290mb)
121 I haven't messed with this yet but you should be able to place
122 just about anything you want in the /tmp/isodir before you create
123 iso image. It would be a good place to put config files for other
124 systems. Whatever program you run has to fit in available memory.
126 12) Create the CD image using mkisofs
128 # mkisofs -r -no-emul-boot \
132 -o bacula-rescue.iso \
133 -sunx86-boot /var/tmp/miniroot \
136 Size of boot image is 4 sectors -> No emulation
137 Total translation table size: 2048
138 Total rockridge attributes bytes: 331
139 Total directory bytes: 0
140 Path table size(bytes): 10
141 Total extents including Solaris x86 boot = 184480
142 Max brk space used 8000
143 184630 extents written (360 MB)
145 13) Create the custom boot CD
149 # /etc/init.d/volmgt start
150 volume management starting.
152 b) Burn the image (use the correct device for your burner).
153 You can get the correct device with:
155 # /opt/sfw/bin/cdrecord -scanbus
159 # /opt/sfw/bin/cdrecord dev=1,0,0 -v -eject /tmp/bacula-rescue.iso
161 14) Now your ready to boot the the system with the rescue CD
163 a) Insert the rescue CD and boot the system.
164 b) Choose option 4 Solaris Interactive Text (Console session)
165 c) Allow the install routine continue and setup the networking
166 information according to your site.
167 d) When you see the "Solaris Interactive Installation" screen exit
168 the install routine with F5 then confirm with F2
169 e) Format and partition the new hard drive (duplicate the partitioning
170 scheme that was used on the old HD).
171 f) Create the file systems with newfs, check them with fsck.
172 g) Mount the HD to /mnt
173 h) Start the bacula file daemon with:
174 /opt/local/bin/bacula start
175 and then bconsole with:
176 /opt/local/bin/bconsole
178 You should now be connected to you backup server and ready to
179 restore your system to /mnt
180 i) After the restore is complete you need to make the new HD bootable
181 with installboot (details on how to do this in the next rev of the doc)
182 For reference (man installboot)