]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/cdrom/README
dbb9f2d2e506f35f133f0781486a87b76dbc9775
[bacula/rescue] / rescue / linux / cdrom / README
1
2 This is the Bacula Rescue CD source directory.  The some of the
3 scripts in this directory were dervied from Martin L. Purschke's
4 "Roll your own Linux Rescue or Setup CD".  See:
5 http://www.phenix.bnl.gov/~purschke/RescueCD/ for more details.
6 This information was invaluable in creating this rescue disk.
7 However, not much of the original code (if any) remains.
8
9 The idea is to build a boot CD that contains a copy of your
10 current system that can be booted in an emergency to either
11 repair your filesystem, or to load Bacula to restore your
12 filesystem.  Even though this boot CD is built from your system,
13 it can be booted on almost any system.
14
15 Requirements:
16 - A Linux system (known to work with RedHat Enterprise 3.0)
17 - It will boot and run on any hardware that isolinux can boot
18   from.
19
20 To build an ISO image for burning a CD, you do the following:
21
22   cd <bacula-source>
23   ./configure (your-options)
24   make
25   cd <bacula-source>/rescue/linux/cdrom
26   su
27   make all
28
29 to burn it, do:
30
31   make burn
32
33 to cleanup, do:
34
35   make clean
36
37 When running these scripts, you should have few or no warnings.
38
39 You will probably also have a number of "Could not finds" under
40 updating binaries.                                           
41
42 As long as the script runs to completion, you can probably ignore
43 any such warnings.   
44
45 The Makefile will copy your kernel and some files it needs, then copy
46 your binary files as well as the shared libraries they need to run, and
47 finally, it will copy certain configuration components from your /etc
48 directory including your passwd file. And finally, it will collect the
49 information necessary to restore all your harddisks. You can find that
50 information in /bacula after the disk has booted.  /bacula/bin will
51 contain a statically linked version of the current beta Bacula fd and
52 a default bacula-fd.conf file.
53
54 The ISO image will be left in:
55
56   <rescue>/bootcd.iso
57
58 When you boot the CD, always choose the default by hitting return.
59 When the system finishes booting you will be presented with a login 
60 prompt at which point, you should login as root using the root password
61 from your system. Boot options other than the default have not be tested  
62 (actually, I am going to remove them), and logging into any user other
63 than root is not likely to work.    
64
65 What do you have when you boot?
66 - Your kernel will be booted in a simplifed environment.
67 - Everything is running in a RAM disk file.
68 - Access to the CDROM in /cdrom and anything you put in cdtree will
69   be in the /cdrom directory.
70 - You will start in /root, with nothing unless you put it in
71   roottree/root before making the ISO.
72 - You will have a good number of standard Unix programs available.
73   Do an "ls -l /sbin" to see the list. To add more add them to
74   rootsbin.list
75 - A /lib containing all the shared libraries used by the programs in
76   /sbin. If you add more programs other than to rootsbin.list, you
77   will need to manually add any required shared libraries.
78 - A /lib/modules/kernel-name/ with all your kernel modules.
79 - An /etc directory containing a stripped down and modified version
80   of your system files. Everything is *vastly* simplified, and probably
81   not in the usual places, but many things such as your passwd file
82   will be there.
83 - A /bacula-hostname directory containing the basic rescue disk contents
84   mentioned in the manual concerning the floppy rescue.  Note,
85   hostname is the name of the host on which you built the CDROM
86   (this allows having multiple rescues on a single CDROM).
87 - A /bacula-hostname/bin directory containing a statically linked Bacula
88   from the current development stream, and a bacula-fd.conf file.
89   With this and the contents of the /bacula-hostname directory, you have
90   all the scripts necessary to reconstruct your hard disks, and to
91   launch a Bacula File daemon for restoring the system.
92
93 Adding your own files:
94 - Anything you put in the directory roottree will be 
95   put into the initial ram disk, and loaded into memory.
96   This is the normal way to add files. However, the size of
97   the ramdisk file is limited to your machine's total 
98   memory size. Currently, with the contents of a single
99   machine (you can actually put multiple machines on a 
100   single CD), the size is about 50MB. Most machines today
101   should handle this.
102 - Anything you put in the directory cdtree will go on the
103   CDROM, but will not be loaded in memory. This means that
104   you must be able to mount the CDROM to read it -- normally
105   the CDROM should be automatically mounted when the system
106   boots, but the detection is not yet too good, so you may
107   need to manually mount it. On the other hand, anything you
108   add to cdtree can be read without booting it by simply
109   mounting the CDROM -- it also does not use precious 
110   RAM.
111
112
113 Other make targets:
114 - make kernel    --- rebuild the kernel files
115 - make binaries  --- rebuild the binary files
116 - make bacula    --- rebuild a static Bacula File daemon
117                      and make a snapshot of your hard disk
118                      layout. 
119 - make initrd    --- make a new ram disk image.
120 - make iso       --- make a new ISO image.
121 - make scan      --- use cdrecord to scan your scsi drivers for
122                      a cd burner.
123 - make blank     --- blank a CD-RW disk (you may need to adjust
124                      the dev= specification using the "make scan"
125                      output.
126 - make burn      --- burn the ISO (you may need to adjust the 
127                      dev= specification using the "make scan" output).
128
129
130 Work to be done:
131 - Test with SCSI boot.
132 - Look at doing some hardware detection in the second half of
133   the boot process.
134
135 The boot process works as follows:
136 - isolinux puts up the boot screen. According to what options you
137   select, it will boot.
138 - The whole roottree is in the initrd.img and will be loaded in
139   memory. It may take more time than you are used to to load.
140 - isolinux also loads the kernel and starts it. The kernel finds
141   the initial ramdisk.
142 - The script "linuxrc" in /roottree is run. This script is *very*
143   simple and doesn't do much other than mounting /proc and
144   remounting the root (/) read/write.
145
146 - When booting is complete, the init process is started and it calls
147   the script /etc/sysinit (in roottree) as determined by the setting
148   in /etc/inittab (i.e. the si entry).
149
150 - sysinit mounts the root filesystem as read write, sets up a few system
151   files, turns on logging, attempts to the cdrom on /cdrom. This is very
152   likely to fail. It is nothing to worry about, but means that unless
153   you manually mount the cdrom, you will not be able to access it.
154   To run the standard Bacula restore, there is no need to access the
155   cdrom after the boot. Then sysinit calls the
156   /etc/load_eth0 script, and finally, sysinit sets up the loop back interface.
157
158 - load_eth0 attempts to find and load the ethernet kernel module.
159   It does not, however, start the network.
160
161 - Then init follows the instructions in inittab for the run level
162   chosen (default 2), which is to call /etc/rc.d/rc 2
163
164 - rc tells init to switch to single user mode 
165
166 - If the run level is greater than 2, rc calls /etc/start_network.sh,
167   which attempts to setup the network with dhcp. (some work needed here) 
168
169 On a standard Linux system, the boot is almost the same. The root filesystem 
170 and all the other files, including /linuxrc, that go in the initial ram image
171 (initrd) are made by the script /sbin/mkinitrd. Note, this is not used here,
172 we do the work ourselves in makeinitrd.
173
174 Reading an ISO image:
175
176  mkdir mnt
177  su
178  mount -o loop xxx.iso mnt
179  ls -l mnt
180  ...
181  umount mnt
182  rm -rf mnt
183
184 Unpacking an initrd.img:
185  mkdir mnt
186  su
187  mount -o loop xxx.iso mnt
188  cp mnt/isolinux/initrd.img initrd.gz
189  unmount mnt
190  gunzip initrd.gz
191  mount -o loop initrd mnt
192
193 mkbootdisk --device bootcd.iso --iso 2.6.10-1.770_FC3
194
195 http://www.xs4all.nl/~ekonijn/yaird/