How to dual boot a HD and mesh CD image
This process will make a dual boot HD setup for
developers. One boot for a standard Linux distro,
the other is like the MeshBox CD.
Why? So it's easy to make changes to the scripts
for testing via ssh and be able to save those
changes to HD. You can also set up file sharing
or other large programs and test them. Logging
for system crashes or ethernet packet sniffing
debug is also possible this way.
The MeshBox start for terminal and AODV works.
X based GUI functions don't. If you know why
please let me know.
References used for this were:
http://www.keeper.org.uk/cdrom_distro_howto.htm
http://syslinux.zytor.com/iso.php
http://www.tcu-inc.com/mark/articles/Ramdisk.html
WARNING: This process is for brave developer
type people. You can screw up your
hard drive, and delete important
files. You have been warned.
Start with a old 2 Gig or more HD. You will be
rebooting a lot with this method, so use a old
clunker.
I used Mandrake 8.2 for this example, it just
happened to pop out of my CD case. You can use
RedHat if you have that laying around, it's
about the same. You only need the first CD.
HD is "master" (hda) on primary IDE, and CDROM
is "slave" on secondary IDE. Using a normal
386 compatible generic computer.
The following is a simple minimal install, you
can skip this if you know how to do it already.
Boot the Mandrake CD, select "expert" install.
Select Security "standard".
When you get to the allocation part clear any
existing partitions and hit "auto allocate" then
partition "simple". You can mess with the
partitions if you know how, we only really need
about 100MB for / it's up to you.
Let it format the partitions.
Next tell it you don't have the other CDs.
In Choose Packages, click off everything. Leave
"select individual packages" checked. Hit OK.
Now pick "truly minimal install".
You don't have to do a minimal install, it's
just quicker.
Next screen, under "Network Computer Server"
click on "OpenSSH Server", we want that included.
Next make a root password (a simple one), and
make one user.
Let it set up the network, select "use DHCP".
Give your box a name like "mymesh".
Set the time zone and have every service start
at boot.
IMPORTANT: Use LILO as a boot loader! Pick all
the defaults.
Install is done, reboot your system.
Log in as root, insert the latest MeshBox CD
and copy the ramdisk image and linux kernel
to the /boot directory
cp /mnt/cdrom/isolinux/initrd /boot/
cp /mnt/cdrom/isolinux/linux /boot/
Now edit lilo.conf to change the boot menu
vi /etc/lilo.conf
We add the new label for "meshbox" as you
see below, the "append=" line will probably
be wrapped in e-mail, it should be one big
long line. Below is a example of what part
of the lilo.conf file would look like.
image=/boot/vmlinuz
label=linux
root=/dev/hda1
initrd=/boot/initrd.img
read-only
image=/boot/linux
label=meshbox
root=/dev/ram0
initrd=/boot/initrd
append="ramdisk=32768 initrd=initrd root=/dev/ram0 max_loop=32 vga=788"
ramdisk=32768
read-only
other=/dev/fd0
label=floppy
unsafe
Save that and then update your LILO boot.
lilo
(type that on the command line as root and
your HD lights will light up)
If you don't run lilo, it won't update from
the lilo.conf file.
reboot
This time when it boots, select "meshbox"
and it should load and run, except for the GUI.
To mount the home partition of the hard drive
mount /dev/hda6 /mnt/hd
cd /mnt/hd
ls
You could have the boot script "rc.local" mount
the hard drive for you, just put that line at the
end of the script and anything else you want to
start after boot.
If you want to modify the scripts in initrd,
boot in Mandrake and create a new mount point
for the next step. (make a back up of initrd
if you want)
mkdir /mnt/boxtemp
Now comes the fun part, we are going to mount
the initrd file to /mnt/boxtemp just like
any other file system, like a hard drive.
Warning: A corrupt file may crash your system.
mount -o loop /boot/initrd /mnt/boxtemp
cd /mnt/boxtemp
ls
Now have at it, be careful to only change a
little at a time, so you know where you went
wrong. Small steps that work are better than a
big change that doesn't work at all.
You want to make modifications as root to the
files in /mnt/boxtemp this is actually the
file "initrd" on your hard drive mounted
as if it was it's own little file system.
Don't worry, you get used to it. Just make
sure you aren't changing things on your own
root file system.
To add commands after boot, see
/mnt/boxtemp/etc/rc.d/rc.local and modules
are loaded at
/mnt/boxtemp/etc/rc.d/rc.modules and
/mnt/boxtemp/hj has a lot of scripts in it.
/mnt/boxtemp/etc/rc.d/rc.M is where it starts.
Compiling modules to add to this may be a
lot of work, you will need to find the source
for the kernel for this specific build. Build
them for i386 for best results on many systems.
You can use another workstation to access this
one with ssh over ethernet, and scp to copy
files both ways.