Showing posts with label multi-boot. Show all posts
Showing posts with label multi-boot. Show all posts

Monday, February 2, 2009

Multi-booting several Windows based OSes

Microsoft itself explains how to make coexist different versions of her OSes on the same disk. The key point is that they have to be installed in age order: the youngest last. Quite uncomfortable, particularly if you already have a consolidated setup and want to add an older version.
I also tried to install WindowsXP (64bit) after Windows2000 professional (32bit) on two different partitions, but then Windows2000 didn't boot anymore. Even if they are on separate partitions the share the C:\ for the bootloader. I don't believe it's a 32-64 bit issue, but I have no time to investigate.
I feel better this way (each OS with its own bootloader):
  1. install (or keep installed) Windows "A" in its proper partition (e.g. the first one);
  2. add a partition to hold Windows "B" (e.g. the second one);
  3. use the preferred tool (e.g. grub) to hide partition "A";
  4. install Windows "B";
  5. install grub on the mbr of the hard drive and make it reading the menu.lst containing:
    title Windows A
    unhide (hd0,0)
    hide (hd0,1)
    rootnoverify (hd0,0)
    chainloader +1
    makeactive

    title Windows B
    unhide (hd0,1)
    hide (hd0,0)
    rootnoverify (hd0,1)
    chainloader +1
    makeactive


Sunday, December 28, 2008

Multi-booting (automatic way) several Ubuntu based distributions

There is a simple way to boot from different ubuntu .iso images saved on the same media, but a manual intervention is needed in order to rename some files before (re)booting.
It is possible to automate it: it's tricky, but it works.

Briefly:
  1. make an usb stick (or hard disk) FreeDOS bootable;
  2. put the .iso images on it;
  3. put the correct pair of kernel and initrd which boots the .isos;
  4. edit (fd)config.sys and autoexec.bat in order to make a menu and a batch that renames some files and boots (using Grub4DOS).

In detail (with the goal of booting the "alternate" distro of kubuntu hardy in either i386 or amd64 flavour):
  1. make your usb device boot any (in principle) OS capable of file manipulation. The plain old DOS is enaugh (and fast to load) but not free. FreeDOS is a good choice and making an usb stick FreeDOS bootable is simple;
  2. make a folder called "hardy" under the root;
  3. download the alternate iso images and put them into the folder "hardy";
  4. rename them "i386-k.iso" and "amd64-k.iso" for short;
  5. under the folder "hardy" make two sub-folders "i386" and "amd64";
  6. download the proper (check here for details) pair of kernel and initrd of each distro and put them into the corresponding folder;
  7. get Grub4DOS and put the dos executable "grub.exe" in the root folder (it will be used to boot the kernel which in turn will run the installer on the .iso image);
  8. make two configuration files for Grub4DOS to load the proper kernels;
    the first "i386-k.lst" (add kernel options as needed):
    default 0
    timeout 1
    title i386
    root (fd0)
    kernel /hardy/i386/vmlinuz root=/dev/ram0 noapic
    initrd /hardy/i386//initrd.gz
    boot

    the second "amd64-k.lst" (add kernel options as needed):
    default 0
    timeout 1
    title amd64
    root (fd0)
    kernel /hardy/amd64/vmlinuz root=/dev/ram0 noapic
    initrd /hardy/amd64/initrd.gz
    boot
  9. in the root folder, make an "fdconfig.sys" file, which acts as menu:
    switches=/F /N
    menudefault=0,30
    menu Kubuntu USB installer
    menu
    menu 0 - Exit to FreeDOS
    menu 1 - Install from kubuntu-8.04.1-alternate-amd64.iso
    menu 2 - Install from kubuntu-8.04.1-alternate-i386.iso
    0?rem
    1?rem
    2?rem
  10. in the root folder, make an "autoexec.bat" file, which manipulates files and invokes the loader:
    rem common preparation
    cd \hardy
    ren *.iso *.isn

    rem select distro
    if "%config%"=="1" ren amd64-k.isn amd64-k.iso
    if "%config%"=="2" ren i386-k.isn i386-k.iso

    rem run distro
    if "%config%"=="1" \grub --config-file=\hardy\amd64-k.lst
    if "%config%"=="2" \grub --config-file=\hardy\i386-k.lst

    cd \

unmount the usb device to be sure all get saved and reboot.

Wednesday, December 10, 2008

Multi-booting from USB stick

While still looking for a better way to boot several OS distributions, I'm writing down the one I use with satisfaction.
There are a lot of how-tos about the topic on the web: they often contain steps which are distribution-specific, like renaming or moving folders to other locations, in order to avoid conflicts, for example. I dont'like it. I like, instead, a more general, systematic way:

  1. suitably partition (FAT filesystem) the usb drive:


    • the first primary partition, with the bootable flag set, reserved to hold some shared data (some operating system do recognize only the first one on removable media), and to hold a bootmanager to deal with the multi-boot scheme;

    • allocate (generally) one partition per distro to avoid conflicts;


  2. copy the distro (generally the content of an .iso image) on its devoted partition;

  3. install syslinux on that partition;

  4. edit "syslinux.cfg" accordingly; if the distro comes from a bootable .iso, most of the time it's enough to:


    • copy the "isolinux" folder over the "syslinux" one;

    • in the new folder "syslinux", rename "isolinux.cfg" to "syslinux.cfg";


  5. install a bootmanager, like Grub4DOS, to the master boot record of the bootable partition;

  6. in the bootmanager menu, add an entry for each partition to chainload its own syslinux.

Tuesday, October 21, 2008

Multi-booting (manual way) several Ubuntu based distributions

As for Gentoo distributions, for some reasons I need to carry with me different Ubuntu distributions (x86, amd64, live, alternate, etc.) on the same usb disk and to be able to boot and install from them. You (quite) cannot boot directly from the .iso image (with some other distros you can, i.e. quantian). You (quite) cannot put them in a single partition because they all share the same directory structure and jailing each one in a sub-directory did not work. The easiest way is to have each distro in its own partition and a multi-boot scheme for the usb disk.
As stated in the page linked above, it is possible to use a pair of kernel and initrd to load the installer from an .iso image.
If you have several .iso images (related to the same version of the distro) in the same partition, you can choose which one to load from, by renaming the other ones with an extension different from ".iso". The boot process automatically loads and installs from the first image it finds.

Multi-booting several Gentoo distributions

For some reasons I need to carry with me different Gentoo distributions (x86, amd64, live, minimal, etc.) on the same usb disk and to be able to boot and install from them.
You cannot boot directly from the .iso image (with some other distros you can, i.e. quantian).
You cannot put them in a single partition because they all share the same directory structure and jailing each one in a sub-directory did not work.
The easiest way is to have each distro in its own partition and a multi-boot scheme for the usb disk.
But there's still some problems: it seems that different versions (2006, 2007, 2008..) have a different "usb behaviour". Furthermore, the boot process of each distro looks for the boot files over all partitions it can see, and it cannot distinguish (until version 2008, at least) among different distros. It happens, that the amd64 distro booted from the second partition finds a set of boot files in the first partition (the x86 one) and tries to use them. It results that the boot process stops or misbehaves.
The solution is to pass to the kernel (with grub, lilo, syslinux, etc.) the option
cdroot=/dev/therightdevice
This solution is easy but unsatisfactory because the device name may change from machine to machine. Unfortunately, the obvious remedy to refer to devices by label (cdroot=LABEL=therightlabel) or by uuid (cdroot=UUID=therightuuid) didn't work.

Friday, October 3, 2008

Tuesday, September 30, 2008

Grub chainloads syslinux and back

Some introductory considerations:
  • Booting from an USB device with GRUB is quite easy (here and there..).
  • Booting from an USB device with syslinux is also quite easy (here).
  • Chainloading GRUB from syslinux seems not to be possible without tricks: syslinux boots from the boot record and sees its own partition only, thus GRUB should reside on the same partition and be packaged as an "xxxx.bin" file to be passed to syslinux via the "kernel /path_to/xxxx.bin" directive. Never tried and I'll never too, until I'll not find somehow useful.
  • Chainloading syslinux from GRUB seems not to be possible without a patch. I don't know about GRUB2. This could be useful for multi-booting (syslinux-based) partitions.
  • Chainloading GRUB4dos from syslinux is possible, because "grub.exe" can reside on the same FAT partition where syslinux is. Only an entry in "syslinux.cfg" with the "kernel /path_to/grub.exe" directive is needed
  • Chainloading syslinux from GRUB4dos (on the same partition) should be possible because GRUB4dos is more flexible than GRUB, but I didn't manage to make it work, even if I tried all combinations of paths, mappings and syntaxes, like here.
  • Chainloading syslinux from GRUB4dos (on different partitions) is possible. I managed it through the mapping, explained (again) here. It solves some problems in multi-booting usb devices.

To load syslinux (on different partitions) from GRUB4dos, my steps were:
  1. take a partitioned device;
  2. take the first primary partition, formatted as FAT;
  3. get GRUB4dos and install it on the master boot record of that partition;
  4. get syslinux and install it on (some of) the other partitions;
  5. edit "menu.lst" in the proper grub4dos folder in order to chainload syslinux with the entry:

    title -your entry title-
    map (hdx,y)+1 (fd0)
    map --hook
    root (fd0)
    chainloader +1
    boot

    where x and y identify the syslinux-based partition in the usual grub-style form.
    I tried to map the syslinux-based partition to an "hd_" device instead of "fd0", but no success: I don't know why.