]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/usb/README.usb
31bbf902257143b32425458c7e3868d55688f605
[bacula/rescue] / rescue / linux / usb / README.usb
1
2 This directory is used to build a USB key containing a Kubuntu 8.04 LiveCD
3 with persistent OS files and persistent /home files.
4
5 You will need to run as root for most things ...
6
7 Start by editing the "config" file. Be sure to get your USB_DEV
8 definition correct.  The scripts you need to partition the key and 
9 to write the boot image to it are all in this (usb) directory. 
10
11 After editing the config file, run:
12
13   ./partition_usb_key
14
15 Note, this script will destroy *all* data on the key, and assumes
16 that you have a 3GB or bigger key.  It may work for a 2GB key,
17 but you might want to reduce the size of the second partition.
18
19 ====
20 If you ever want to put the key back to its prior state, *before*
21 running the partition_usb_key, you might consider doing a:
22
23   sfdisk -d /dev/key-device >save_me  
24
25 where key-device is the key device name (e.g. sda).  The
26 output file can be fed back into sfdisk to recreate the original
27 with:
28
29  sfdisk /dev/key-device <save_me
30 ====
31
32 The partition_usb_key script creates three partitions:
33
34  1. kubuntu8  -- USB boot partition containing the OS
35  2. casper-rw -- A writable ext3 partition for saving OS changes
36  3. home-rw   -- A writable ext3 partition for saving /home
37
38 When the key is booted, assuming you choose the first option 
39 (LiveCD), you will be running as user "ubuntu" the password is
40 "bacula", and you will be in /home/ubuntu.  
41
42 The next step is to get a copy of kubuntu8.tar.gz, which is the
43 USB boot image. Currently, it can be downloaded from:
44
45   www.bacula.org/downloads/kubuntu8.tar.gz
46
47 or from:
48
49   www.sibbald.com/download/kubuntu8.tar.gz
50
51 I recommend that you download it into the rescue/linux/usb directory.
52
53 Finally, mount your USB key and detar the kubuntu8.tar.gz image 
54 into the first partition.  Do this with:
55
56    ./write_usb_boot_partition
57
58 You should now have a USB stick that can be booted providing the
59 machine permits booting from the USB port -- this can be adjusted
60 by modifying the BIOS boot sequence.  On Dell machines, you can 
61 enter the BIOS setup by pressing F2 just after power on.  
62
63 Alternatively, most machines let you boot from an alternate device.
64 For example if you press F11 while a Sony Viao is powering up, it 
65 will boot from the USB port. 
66
67 On Dell machines during power on, if you press F12, you will be
68 able to select any boot device (one time only) other than the one
69 that is the default (normally the CDROM or HDD).
70
71
72 ====
73
74 The directory "remaster" contains the scripts that allow picking
75 apart a Kubuntu Hardy ISO and then updating and recombining the
76 parts into a USB boot image.  The information below is somewhat
77 low level and should not be needed unless you want to do your
78 own remastering either starting from the Kubuntu release or from
79 the Bacula remastered release.
80
81 Note, the sqfs.tar.gz is the whole squashfs unsquashed.  
82
83 The kernel image (vmlinuz) is a copy of the most recent kernel i.e.
84
85   sqfs/boot/vmlinuz-2.6.24-22-generic
86
87 and initrd.gz is a copy of the most recent initrd.img i.e
88
89   sqfs/boot/initrd.img-2.6.24-22-generic
90
91 they are renamed and put in the kubuntu8 partition in:
92
93   casper/vmlinuz
94 and
95   casper/initrd.gz
96
97 respectively.
98
99 Note, initrd.gz is made after fixing the bug in
100 /usr/share/initramfs-tools/scripts/casper 
101 see note 2. in bugs with Kubuntu boot process below.
102
103 When updating the USB root partition (changing something), I 
104 strongly recommend that you work with the disk image then
105 repack it (pack_disk_image) and then run load_disk_image.
106
107
108 Packages needed:
109 apt-get install syslinux mbr
110
111
112 Kubuntu boot tricks:
113 1. Booting with persistence added to the kernel options will permit
114    mounting of a USB casper-rw and home-rw partitions on the USB key.
115    casper-rw is used to store changed OS files, and home-rw is the
116    home directory.
117
118 Bugs with Kubuntu boot process:
119 1. The initrd.gz image must be opened, fixed and the repacked.
120 2. The fix involves removing the ,mode=755 from the mount line for
121    the persistent OS partition (casper-rw) or /cow
122 3. I have removed /etc/rc0.d/S89casper and /etc/rc6.d/S89casper
123    because they are related to a CDROM boot and create false 
124    errors when booting from a USB key.