Setting a persistent home for the Live-CD
For normal use we recommend the ext3 file system. It is the default file system for Joatha and well maintained.
While using the Joatha Live-CD you can set up a persistent $HOME directory to be able to save your config, user-data and additional installed programs.
The most common methods to boot-up the Live-CD are (but not limited to):
1) From the CD/DVD-drive, or
2) Boot up the ISO from the harddisk. "fromiso"
This persistent $HOME can be installed to your PC hard drive or to your USB stick.
First we need to activate unionfs, do this by using the unionfs cheatcode in the grubline by typing in:
unionfs
Or, via the terminal/konsole if already booted up with:
$su #fix-unionfs
Now we boot from the Live-CD or the installed fromiso ISO and run the script to create the config-file (config.tbz) to save it on your USB stick or hard drive
Joatha-Menu - Configuration - save configuration
Next we create the image-file for the home directory:
Joatha-Menu - Configuration - install permanent Joatha home directory
Make this big enough to hold software you may want to install in the future. Now we create an empty directory named unionfs in the /home of user sidex (/home/Joatha) with konqueror, konsole or a tool of your choice.
Then we boot the Live-CD or the fromiso-ISO and enter at the Grub-Bootscreen:
myconfig=scan home=scan unionrw=/home/Joatha/unionfs
Now you are ready for installing new software to your new home-dir on your hard drive or stick.
This is done in the usual way:
#sux #apt-get update #apt-get install packagename
Booting up next time by entering myconfig=scan home=scan unionrw=/home/Joatha/unionfs you can use your newly installed software.
Booting with "fromiso"
For normal use we recommend the ext3 file system. It is the default file system for Joatha and well maintained.
With this cheatcode you can start from an iso out of a partition, which is much faster then from a CD (HD installations with "fromiso" only takes a fraction of time,).
'fromiso' is of course much faster then from the CD- /DVD-drive and keeps the drive available. As an alternative you could use QEMU as well.
Requirements:
* a functioning grub (on a floppy, a HD-Installation or the Live-CD)
* a Joatha ISO Image e.g.: Joatha.iso
First we choose a place for the iso and 2 files we need, so we get shorter names. Therefore we create a base-directory: for example /dev/hda5, create the directory "Joatha" and copy the iso into it:
# mkdir /media/hda5/Joatha # mv Joatha.iso /media/hda5/Joatha
now we move to that directory and mount the iso image:
# mkdir -p /mnt/test # mount -t iso9660 -o loop,ro /media/hda5/Joatha/Joatha.iso /mnt/test
now we copy the files miniroot.gz and vmlinuz from the mounted iso image to our directory:
# cp /mnt/test/boot/vmlinuz /media/hda5/Joatha/ # cp /mnt/test/boot/miniroot.gz /media/hda5/Joatha/
Now we have to customize grub a bit, Therefore we edit the file /boot/grub/menu.lst and add the following lines:
### ISO boot title Joatha 32bit from ISO kernel (hd0,4)/Joatha/vmlinuz ramdisk_size=100000 init=/etc/init fromiso=/Joatha/*.iso noprompt noeject lang=en apm=power-off nomce quiet initrd (hd0,4)/Joatha/miniroot.gz
With next boot we have a new menu item in grub to start the iso image.
Installing Joatha on a USB-Stick or to a USB-HD
To do an installation of Joatha on a USB-Stick or a USB-HD is as easy as a normal HD-Install now. Just follow this simple guideline.
The USB-installation (fix-usb-install.sh) has merged with the Joatha-installer, so all can now be handled from within the Joatha-installer.
We start with a normal installation and choose the partition on the USB-device, where Joatha is to be installed - we speak of "sda1" here, but this is valid for any other partition on a USB-disk or device.
Grub must be installed to the Partition you are installing on, not MBR !
The Partition must be formated with a linux-filesystem. Recommended is the ext3 filesystem. An existing partition will be reformatted by the installer!
All data on this partition will be lost during the reformat!
Now you can boot from your USB-HD. 'Boot from USB' must be enabled in your BIOS.
Installing Joatha with QEMU
- 1. create a harddiskimage for qemu
- 2. boot the iso with qemu
- 3. install on the image
Creating the hard disk image
To run qemu you will probably need a hard disk image. This is a file which stores the contents of the emulated hard disk.
Use the command:
qemu-img create -f qcow Joatha.qcow 3G
To create the image file named "Joatha.qcow". The "3G" parameter specifies the size of the disk - in this case 3 GB. You can use suffix M for megabytes (for example "256M"). You shouldn't worry too much about the size of the disk - the qcow format compresses the image so that the empty space doesn't add up to the size of the file.
Installing the operating system
This is the first time you will need to start the emulator. One thing to keep in mind: when you click inside qemu window, the mouse pointer is grabbed. To release it press Ctrl+Alt.
If you need to use a bootable floppy, run Qemu with:
qemu -floppy Joatha.iso -net nic -net user -m 512 -boot d Joatha.qcow
If your CD-ROM is bootable, run Qemu with:
qemu -cdrom Joatha.iso -net nic -net user -m 512 -boot d Joatha.qcow
Now install Joatha as if you were going to install it on a real HD
Running the system
To run the system simply type:
qemu [hd_image]
A good idea is to use overlay images. This way you can create hard disk image once and tell Qemu to store changes in external file. You get rid of all the instability, because it is so easy to revert to previous system state.
To create an overlay image, type:
qemu-img create -b [[base''image]] -f qcow [[overlay''image]]
Substitute the hard disk image for base_image (in our case win.qcow). After that you can run qemu with:
qemu [overlay_image]
The original image will be left untouched. One hitch, the base image cannot be renamed or moved, the overlay remembers the base's full path.
Using any real partition as the single primary partition of a hard disk image
Sometimes, you may wish to use one of your system partition from within qemu (for instance, if you wish booting both your real machine or qemu using a given partition as root). You can do this using software RAID in linear mode (you need the linear.ko kernel driver) and a loopback device: the trick is to dynamically prepend a master boot record (MBR) to the real partition you wish to embed in a qemu raw disk image.
Suppose you have a plain, unmounted /dev/hdaN partition with some filesystem on it you wish to make part of a qemu disk image. First, you create some small file to hold the MBR:
dd if=/dev/zero of=/path/to/mbr count=32
Here, a 16 KB (32 * 512 bytes) file is created. It is important not to make it too small (even if the MBR only needs a single 512 bytes block), since the smaller it will be, the smaller the chunk size of the software RAID device will have to be, which could have an impact on performance. Then, you setup a loopback device to the MBR file:
losetup -f /path/to/mbr
Let's assume the resulting device is /dev/loop0, because we wouldn't already have been using other loopbacks. Next step is to create the "merged" MBR + /dev/hdaN disk image using software RAID:
modprobe linear mdadm --build --verbose /dev/md0 --chunk=16 --level=linear --raid-devices=2 /dev/loop0 /dev/hdaN
The resulting /dev/md0 is what you will use as a qemu raw disk image (don't forget to set the permissions so that the emulator can access it). The last (and somewhat tricky) step is to set the disk configuration (disk geometry and partitions table) so that the primary partition start point in the MBR matches the one of /dev/hdaN inside /dev/md0 (an offset of exactly 16 * 512 = 16384 bytes in this example). Do this using fdisk on the host machine, not in the emulator: the default raw disc detection routine from qemu often results in non kilobyte-roundable offsets (such as 31.5 KB, as in the previous section) that cannot be managed by the software RAID code. Hence, from the the host:
fdisk /dev/md0
There, create a single primary partition corresponding to /dev/hdaN, and play with the 's'ector command from the 'x'pert menu until the first cylinder (where the first partition starts), matches to the size of the MBR. Finally, 'w'rite the result to the file: you are done. You know have a partition you can mount directly from your host, as well as part of a qemu disk image:
qemu -hdc /dev/md0 [...]
You can of course safely set any bootloader on this disk image using qemu, provided the original /boot/hdaN partition contains the necessary tools.
Using the QEMU Accelerator Module
The developers of qemu have created an optional kernel module to accelerate qemu to sometimes near native levels. This should be loaded with the option
major=0
to automate the creation of the required /dev/kqemu device. The following command
echo "options kqemu major=0" >> /etc/modprobe.conf
This will amend modprobe.conf to ensure that the module option is added every time the module is loaded.
qemu [...] -kernel-kqemu
This enables full virtualization and thus improves speed considerably.
To activate qemu:
qemu -cdrom /tmp/pkg/Joatha-debug.iso -net nic -net user -m 512

