Booting with "fromiso" - Overview

For normal use we recommend the ext4 file system. It is the default file system for sidux.

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

fromiso with Grub2

sidux has provided a grub2 file named 60_fll-fromiso to generate a fromiso entry to the grub2 menu. The only file to configure fromiso is called grub2-fll-fromiso and is found in /etc/default/grub2-fll-fromiso..

First open a terminal and become root with:

sux

Then open an editor, which may be kwrite, mcedit, vim or another that you prefer:

mcedit /etc/default/grub2-fll-fromiso

Next uncomment (remove the # ) the lines you need to be operative and replace the default instructions within the "quote marks" with your preferences.

For example, compare this altered grub2-fll-fromiso with the default, (the highlighted lines are the changed lines for instructional purposes):

# Defaults for grub2-fll-fromiso update-grub helper
# sourced by grub2's update-grub
# installed at /etc/default/grub2-fll-fromiso by the maintainer scripts

#
# This is a POSIX shell fragment
#

# specify where to look for the ISO
# default: /srv/ISO ### Note: This is the path to the directory that contains the ISO,
it is not to include the actual sidux-*.iso file.###
FLL_GRUB2_ISO_LOCATION="/media/disk1part4/sidux-iso" # array for defining ISO prefices --> sidux-*.iso # default: "sidux- fullstory-" FLL_GRUB2_ISO_PREFIX="sidux-" # set default language # default: en_US FLL_GRUB2_LANG="en_AU" # override the default timezone. # default: UTC FLL_GRUB2_TZ="Australia/Melbourne" # kernel framebuffer resolution, see # http://manual.sidux.com/de/cheatcodes-vga-de.htm#vga # default: 791 #FLL_GRUB2_VGA="791" # additional cheatcodes # default: noeject FLL_GRUB2_CHEATCODE="noeject nointro"

Save and close the editor, then run in the terminal

update-grub

Your grub2 menu.cfg will be updated to see the different ISOs you have placed in the directory you specified and will be available on your next boot up.

fromiso with grub-legacy

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/vmlinuz0.686 /media/sda5/sidux/vmlinuz0.686
cp /mnt/boot/initrd0.686 /media/sda5/sidux/initrd0.686
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/vmlinuz0.686 boot=fll quiet vga=791 fromiso=/sidux/sidux.iso
initrd (hd0,4)/sidux/initrd0.686

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. When the fromiso uses ext2/ext3/ext4 the default is simply:

persist

When the fromiso uses a vfat filesystem, then you must use a file that contains a linux filesystem and the cheatcode will look like:

persist=/sidux/sidux-rw

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-sticks/SSD-cards

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 the drive.

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/SSD-cards, 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. Read/writes to flash type drives are contingent on the specifications of your USB stick.

ext2 file systems

With ext2 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.ext2 ${disc}/sidux/sidux-rw && tune2fs -c 0 "${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 USB/SSD devices

To do an installation of sidux on a USB-stick/SSD-card is as easy as a normal HD-Install. Just follow this simple guideline.

Requirements:

Any PC that has a USB 2.0 protocol and supports booting from USB/SSD.

A sidux.iso image.

3 kinds of installation to USB/SSD

USB/SSD fromiso Installation, sidux-on-a-stick

Pre format your usb device with ext2 or fat32 before proceeding (at least a 2 gig capacity) . The device should have 1 partition only and as some BIOSes are temperamental this must be marked bootable.

The fromiso installation is done through Menu>System>install-sidux-to-usb. On a LIVE-CD you can also click on sidux Installer Icon and choose Install to USB.

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/SSD. If you did not activate persist you are able to turn it on by adding persist on the grubline of the grub screen. (If vfat, it is probably best to start again though).

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

This installs the iso image to the USB device sdb with persist, 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 to a USB/SSD (behaves as normal HD installation)

The recommended mininmum size of a USB-stick/SSD-card is:
sidux "LITE" needs 2.5 gig PLUS you need data space,
sidux "FULL" needs 4 gig PLUS you need data space

Pre format your device with ext2 and partition the USB-stick/SSD-card as you would a standard PC.

Start the installation from the Live-ISO and choose the partition on the USB/SSD-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/SSD 'Boot from USB' must be enabled in your BIOS.

Other note worthy points are:

Full installation to a USB Hard Disk Drive like an installation to a partition

A USB Hard Disk Drive has one quite good and appealing application, (particularly to new users coming from MS or another distro), and that is you can install sidux to a USB HDD, plug it in without needing to configure a PC for dual boot (repartitioning, grub alterations etcetera).

Start the installation from the Live-ISO, (or from a USB-stick/SSD-card), as a standard install, not a USB install and choose the partition on the device, where sidux is to be installed, for example sdbX and follow the sidux installer prompts. Grub must be written to the USB HDD partition.

Read Installing to your HD

Other note worthy points are:

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:

apt-get update
apt-get install virtualbox-ose-qt virtualbox-ose-source dmakms module-assistant

Then prepare the module:

m-a prepare
m-a a-i virtualbox-ose-source

Then activate Dynamic Module-Assistant Kernel Module Support for virtualbox, so that the next time the Linux kernel is updated a virtualbox module is prepared for it too, without manual intervention. To do that, add virtualbox-ose-source to the /etc/default/dmakms configuration file.

mcedit /etc/default/dmakms
virtualbox-ose-source

Then reboot the computer.

This is essential reading on dmakms

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

A QT GUI tool is available to help configure QEMU:

apt-get install qtemu

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 01/02/2010 0810 UTC