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:
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
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
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
IMPORTANT: Use LILO as a boot loader! Pick all
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
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.
append="ramdisk=32768 initrd=initrd root=/dev/ram0 max_loop=32 vga=788"
Save that and then update your LILO boot.
(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.
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
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)
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
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/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.