Booting with "fromiso"

For normal use we recommend the ext3 file system. It is the default file system for sidux and well maintained.

With this cheatcode you can start from an iso out of a partition ,(ext2/3), 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 virtualbox-ose or QEMU.

Requirements:

* a functioning grub (on a floppy, a HD-Installation or the Live-CD)
* a sidux ISO Image e.g.: sidux.iso and a Linux file system like ext2/3. (If you rename your image to sidux.ISO instead of sidux.iso you will need to alter the commands accordingly as a unix file naming system is case sensitive.)

Process:

Choose a place for the iso and 2 files we need, so we get shorter names. Therefore create a base-directory: for example "/media/sdaX", (sda1 or, 2, or 5, or 6, or whatever, for example) create the directory "sidux" and copy the iso into it:

$ sux
mkdir -p /media/sdaX/sidux
mv sidux.iso /media/sdaX/sidux

Now mount the ISO image (Alternatively mc [midnight commander] can be used, as it transparently auto-mounts .iso files and lets you copy out the files needed.):

mount -t iso9660 -o loop,ro /media/sdaX/sidux/sidux.iso /mnt

Now copy the vmlinuz and initrd.img files from the mounted iso image to the directory and the HD is YOUR known variable::This is an example only :

cp /mnt/boot/vmlinuz* /media/sda5/sidux/vmlinuz
cp /mnt/boot/initrd.img* /media/sda5/sidux/initrd.img
umount /mnt

Next you have to customise grub. Therefore edit the file /boot/grub/menu.lst and add the following lines AFTER the ### END DEBIAN AUTOMAGIC KERNELS LIST: NOTE no wildcards on grub line for filenames allowed! The HD is YOUR known variable::This is an example only:

### ISO boot
title sidux 32bit from ISO
kernel (hd0,4)/sidux/vmlinuz boot=fll quiet vga=791 fromiso=/sidux/sidux.iso
initrd (hd0,4)/sidux/initrd.img

With next boot you have a new menu item in grub to start the iso image. Should you upgrade your sidux.iso, vmlinuz and intird.img files with later releases, grub's menu.lst does not need to be altered.

General information on fromiso with persist

fromiso and persist on a HD

You can have a persistent live system on a writable disc by combining a fromiso setup with the persist cheatcode. The default is simply:

persist

sidux uses aufs to enable what is known as "copy on write" over your ISO to allow you to write new files and folders and update existing ones by keeping the new files in memory. The persist cheatcode, will store your new files on the same hard drive partition as you use to store your fromiso ISO image.

fromiso gives you a live system which performs all the automatic features of the sidux live ISO. This has the benefit of doing things like automatically configuring the hardware but it also means that it will recreate the same files each time you boot up unless you use additional codes.

Using persist along with other sidux specific cheatcodes such as noxorgconf, nonetwork, means that it will not recreate the same files each time you boot up.

Using persist also means that you can install packages from apt and have the application and any data you have saved available for you to access at next boot up.

fromiso and persist on a bootable USB Key

Perhaps the ideal use of persistence is in conjunction with the install-usb-gui tool to create your own bootable flash drive with your files and the software you need.

Your files will be stored in a subfolder on your drive. This subfolder is created if it does not exist when the fromiso and persist cheatcodes are used together.

persist on a FAT filesystem, as commonly used for dos/Windows 9x installations and usually found by default on flash devices, requires you to create a single large file to use as a loop device, you then format this file.

On USB sticks, ext2 and vfat are the recommended file systems and most likely to give better cross platform ability for data rescue when needed most, as an MS Windows™ driver is available for data-swapping. Rewrites to flash type drives are contingent on the specifications of your USB stick.

ext2/3 file systems

With ext2/3 the full partition will be used, the current root is taken and a directory /fll is created which is used for the persist allowing the usage of all free place in the device for the persist system.

vfat file system

When vfat is used, persistance is made through a file that can be maximum 2GB but not less than 100MB (as it would be of no use). This file should be named sidux-rw. Assuming the disc you want to use is mounted and writable on /media/sdb1 and you want to create a 1GB file to use as your persistent drive you could use the following commands (no need for root if you can write to the file).

disc="/media/sdb1" 
size=1024 
mkdir /media/sdb1/sidux 
dd if=/dev/zero of=${disc}/sidux/sidux-rw bs=1M count=${size} && echo 'y' | LANG=C /sbin/mkfs.vfat ${disc}/sidux/sidux-rw

NTFS partitions, commonly used for Windows NT/2000/XP (TM) installations, CANNOT be used at all for persistence.

Installation of sidux on a USB-device

To do an installation of sidux on a USB-Stick or a USB-HD is as easy as a normal HD-Install. Just follow this simple guideline.

Two kinds of installation to USB

1) - fromiso (to create a bootable USB from an installed system you need to have a sidux.iso)
2) - full (the full installation to a USB HD/stick behaves as normal HD installation and is done through the normal installer).

USB fromiso Installation

Pre format your device with ext2 or fat32 before proceeding.

If 'install-sidux-usb-gui' is not present on your installation 'apt-get install fll-iso2usb'.

The fromiso installation is done through Kmenu>System>install-sidux-usb-gui on a HD installed system, or clicking on sidux Installer Icon on the ISO, and choosing Install to USB. It is mostly directed to install 'fromiso' on the first partition the USB stick.

You are given the opportunity to make language, timezone and other bootcodes choices and whether or not to activate persist via a checkbox.

You now have a bootable USB stick. If you did not activate persist you are able to turn it on by adding persist on the grubline of the grub screen, or hardcoding it into #kopt= line in the menu.lst.

Terminal example:
fll-iso2usb -D /dev/sdb --iso /home/sidux/sidux.iso -p  -- toram lang=no tz=Pacific/Auckland

This installs the iso image to the USB device sdb with persist, toram, Norwegian language localisation and Pacific/Auckland (NZL) time on the grub default line.

Your X (video card, keyboard, mouse) configuration or your network interfaces file have not been stored, which makes it ideal to use on other computers.

For more documentation including customisation options see:

$ man fll-iso2usb

Full installation (behaves as normal HD installation)

The recommended mininmum size of a usb stick is:
sidux "LITE" needs 1.7gig PLUS you need data space,
sidux "FULL" needs 3.5gig PLUS you need data space

Pre format your device with ext3 and partition the USB-HD or USB-Key as you would a standard PC.

Start the installation from the Live-ISO and choose the partition on the USB-device, where sidux is to be installed, for example sdbX and follow the sidux installer prompts. Read Installing to your HD

To boot from your USB-HD or USB-Key 'Boot from USB' must be enabled in your BIOS.

Installing sidux with VirtualBox

The Steps.

Requirements

Recommended ram: 1 gig : Ideally 512 MB for the guest and 512 MB for the host. (it can be run on less, but do not expect to have good performance).

Hard disk space: While VirtualBox itself is very lean (a typical installation will only need about 30 MB of hard disk space), the virtual machines will require fairly huge files on disk to represent their own hard disk storage. So, to install MS Windows XP (TM), for example, you will need a file that will easily grow to several GB in size. To have sidux in VirtualBox you need to allocate a 5 gig image plus a swap allocation.

Installation:

32 bit
apt-get update
apt-get install virtualbox-ose-qt virtualbox-ose-modules-2.6-sidux-686
64 bit
apt-get update
apt-get install virtualbox-ose-qt virtualbox-ose-modules-2.6-sidux-amd64

Then copy and paste this line into the terminal:

sed -i "s/^\(LOAD_VBOXDRV_MODULE\=\).*/\11/" /etc/default/virtualbox-ose

Now add your user name to vboxusers:

adduser <username> vboxusers 

Next:

modprobe vboxdrv

Finally log out from the desktop and then log back in and start Virtualbox from the Menu

Installing sidux to the virtual machine

Use virtualbox's wizard to create a new virtual machine for sidux, then follow the instructions for a regular sidux-installation.

VirtualBox has a comprehesive PDF Help, that you can download

Installing sidux with QEMU

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 sidux.qcow 3G

To create the image file named "sidux.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 sidux.iso -net nic -net user -m 512 -boot d sidux.qcow

If your CD-ROM is bootable, run Qemu with:

qemu -cdrom sidux.iso -net nic -net user -m 512 -boot d sidux.qcow

Now install sidux 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 sidux.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/sdaN 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/sdaN disk image using software RAID:

 modprobe linear
 mdadm --build --verbose /dev/md0 --chunk=16 --level=linear --raid-devices=2 /dev/loop0 /dev/sdaN

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/sdaN 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/sdaN, 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 now 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/sdaN 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/modules

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/sidux-debug.iso -net nic -net user -m 512

The official documentation of the QEMU Project

Some content for QEMU for the sidux-manual was accessed off this site under GNU Free Documentation License 1.2 and modified for the sidux-manual

Page last revised 24/04/2009 0300hrs UTC