Child pages
  • Triple booting Windows, Linux and OpenIndiana installed on the same disk
Skip to end of metadata
Go to start of metadata

(original article by Jean-Pierre Andre)

 

This configuration may be useful for a laptop with no easy access to an external disk. It is based on using the OpenIndiana bootloader, which is the only one able to boot the three systems.

1 - Backup important informations present on the computer.

Make images of the partitions you cannot easily rebuild, such as tool partitions preinstalled by the vendor.

2 - Shrink Windows, if already installed.

This is easily done by Gparted which is present on most live-CD/DVD/USB installers for Linux and OpenIndiana.

3 - Create the necessary partitions.

This is also done by Gparted. Best to separate the system partitions and you user data partitions. You need :

  • one or two Windows system partitions
  • at least three Linux partitions (root, home and swap)
  • an OpenIndiana partition
  • one or more user data partitions

This is clearly more than four partitions, so you have to use an extended partition. However some vendors ship the computer with all four primary partitions used, so you may have to delete one of them and replace it by an extended partition, then reinstall the deleted one as a logical partition.

 

Define your partitions types as :

  • 07 for NTFS
  • 83 for Linux root and home
  • 81 for Linux swap (do not use the usual 82)
  • bf for OpenIndiana
  • 07 (NTFS) or even 0c (FAT) for user partitions to be shared by OSes

 

Make a copy of your partition layout. This must be exact to the sector if you need to rebuild your partitions. In particular the OpenIndiana installer will destroy the partitions beyond the ninth, and if you need more than nine partitions, you will have to recreate them. A convenient tool for saving/restoring the partition layout is sfdisk.

4 - Install Windows if not already installed.

 

Make a copy of the MBR. You can do that from a live-CD/DVD/USB :

dd
dd if=/dev/sda of=backup-mbr bs=512 count=1
dd if=/dev/dsk/c0t0d0p0 of=backup-mbr bs=512 count=1

The /dev/sda notation is what you'd encounter if using a Linux Live CD/DVD/USB. The /dev/dsk/c0t0d0p0 notation is typical of Solaris systems.

To find out what letters your disks are assigned to, you can use "dmesg | grep sd" in Linux and "pfexec format -e" in Solaris.

5 - Install Linux

Select ext3 (or ext2) as the file system type for Linux root. This will have to be readable by the OpenIndiana installer.

This will probably install grub2 as its bootloader and overwrite the current MBR. At this stage, you should be able to dual boot Windows and Linux.

FIXME : the bootloader may have to be stored in the Linux boot partition (problem encountered by Axelle ?)

 

Make a second copy of the MBR (can be done from the installed Linux), and make a copy of the grub2 menu, which is found in /boot/grub2/grub.cfg

6 - Install OpenIndiana

This will install grub as its bootloader and overwrite the current MBR

Make a third copy of the MBR and make a copy of the grub menu, which is found on /rpool/boot/grub/menu.lst

 

Use an OpenIndiana text editor to insert a few lines in menu.lst to be able to boot Windows and Linux. These lines must be inserted either just before this one :

#---------- ADDED BY BOOTADM - DO NOT EDIT ----------

or inserted just after this one :

#---------------------END BOOTADM--------------------

 

The entry to be inserted for Windows is simple and may have been inserted automatically by the OpenIndiana installer :

Windows
 title Windows
         rootnoverify (hd0,0)
         chainloader +1

The entry to be inserted for Linux can be derived from the grub.cfg saved at step 5. Find a couple of consecutive lines from grub.cfg beginning with "linux" and "initrd". Replace the linux header by "kernel" and insert both lines in the menu.lst of OpenIndiana, so :

Linux
title Linux
        root (hd0,4)
        kernel /boot/vmlinuz... (copy the full line)
        initrd /boot/initramfs... (copy the full line)

The "4" in "root (hd0,4)" means that Linux was installed on the 5th partition (the first logical partition). You have to adjust to your own partition number for Linux root (subtract one from the partition number).

 

If you cannot install the systems in the above order (typically when wanting to reinstall Linux), you have to get the OpenIndiana MBR from the backup and reinstall it, and you have to update the menu.lst as shown above.

Example setup

Example
---------------- begin example -----------
splashimage /boot/grub/splash.xpm.gz
foreground 343434
background F7FbFF
default 0
timeout 30
 
title Windows
    rootnoverify (hd0,0)
    chainloader +1
 
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title OpenIndiana oi_151.1.8
findroot (pool_rpool,2,a)
bootfs rpool/ROOT/openindiana
 
splashimage /boot/solaris.xpm
foreground FF0000
background A8A8A8
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive
#---------------------END BOOTADM--------------------
 
title Linux
         root (hd0,4)
    kernel    /boot/vmlinuz-3.9.5-301.fc19.x86_64 root=UUID=8f5bf987-2c2e-403c-8dab-8988142cb1cf ro rd.md=0 rd.lvm=0 rd.dm=0  vconsole.keymap=fr rd.luks=0 vconsole.font=latarcyrheb-sun16 rhgb quiet
    initrd    /boot/initramfs-3.9.5-301.fc19.x86_64.img
---------------- end example -----------
  • No labels