Linux+Windows2000+Solaris HOWTO Rahul Draft ver 0.1 Revision 1 Date: 2001/9/4 ******************** Submitted for first review ************* Describes how to triple boot Linux, Windows 2000 and Solaris on one x86 system. ----------------------------------------------------------------------------- Contents 1. Introduction 1.1 Why this Howto? 1.2 What this howto discusses? 1.3 What this howto does not discuss!! 1.4 Configuration reference list 1.5 Terminology Notes about -Windows -Linux -Solaris 1.6 Handling partition tables 1.7 Using boot loaders 2. Preparing to install 2.1 Warning 2.2 Dry run installations 2.3 Planning disk layout 2.4 Installation path 2.5 Allocating disc space 2.6 Partition scheme 3. Starting Installation 3.1 Partitioning your Hard Drive 3.2 Installing Windows 3.3 Installing Linux 3.4 Installing Solaris 4. Restoring Lilo 5. Playing with trinity 5.1 Mounting Windows partition on Solaris 5.2 Mounting Linux partition on Solaris 5.3 Mounting Solaris partition on Linux 5.4 Mounting Windows partition on Linux 5.5 Using gnu tools 5.6 Configuring KDE and GNOME on Solaris 5.7 Running Linux binaries on Solaris 6. Copyright, credits, information ------------------------------------------------------------------------ 1. Introduction 1.1 Why this howto ? I wanted to install Solaris on system that already had Windows 2000 and Linux 7.1 running on. But could not make Solaris configuration assistant proceed due to two problems. i). it recognized that my partition table already had 3 entries - Windows, Linux primary & swap and halted installation indicating that partition table should have less than 3 entries. Later i found out that it makes two entries of its own - X86BOOT & SOLARIS -and hence should see two empty entries available. ii). Solaris partition has same type entry as Linux swap - 82h. Installing Linux after Solaris seems to wipe this partition out. Although I could have made a logical drive available in extended partition, Solaris didn't seem to like it. After two days of messing up with partition table and all possible combinations of installing the threesome; the installation path that gave least hassles is discussed here. Besides ease of installation, the flexibility of making and recovering partitions that is achieved is also a consideration. More of that later. 1.2 what this Howto discusses? i. To install RedHat Linux 7.1, Windows 2000 and Solaris 8 on a single system. ii. To use Lilo to boot any of the three Os iii.To Mount... Windows partition in Solaris Linux partition in Solaris Solaris partition in Linux iv. Configuring Solaris to use Gnu tools v. Installing KDE & GNOME GUI environment vi. Running Linux binaries on Solaris 1.3. What this Howto does not discusses! #######(I'll keep these for later revisions of this Howto) i. Installations with NTFS partition in C: drive ii. Keeping Windows as last installation option after Linux and Solaris iii.detailed installation procedure of any OSes. For linux lots of documentation is already available. Windows 2000 is easy. 1.4. Configuration Reference list This list would serve as the base reference for softwares used in the entire configuration process. Unless you have sigficantly different version, installation steps remain more or less the same.For example not much differs if you use Solaris 5.7 or Windows 2000 professional (or even windows Me/98/95 for that matter!) i. RedHat 7.1 kernel 2.4 ii. Solaris 5.8 Version Generic_108529-65 32bit iii.Windows 2000 server build 5.00.2195 Initial partitioning will be done with dos fdisk or Windows installer disk partition utility. Later Linux fdisk will be more useful. Solaris fdisk is used just for displaying information. We consider Windows Fat32 file system in c: drive, ext2 for linux and ufs type sunx86 for Solaris. While NTFS is generally prefered on Windows Server, it's not discussed here atleast for the present. However keeping NTFS in other logical partitions doesnt make any difference. Please also ensure that your hardware is compatible with respective OSes.Both Windows 2000 server and Solaris 8 need atleast 64MB RAM. For systems having large hard disks it's essential that bios support booting from partitions farther away. Also system with intel i810/815 motherboard would need two patches to be installed for Solaris window display to function properly. You can download these from www.sun.com by searching with keyword 'intel i810 patch'. 1.5 Terminology notes Each of the Os has different terminology of addressing devices, partitions and slices; displaying the partition table in different units (cylinders, sectors or KBs) and boot loader. Here is a brief overview... i. Windows 2000 It uses Disk Manager service for managing partitions. Each is labeled alphabetically as C: D: etc. with capacity displayed in MBs or GBs. Its bootloader shows simple boot options, using arrow keys for navigating and enter to select. Not much to really bother about. ii.Linux Fdisk is the default partitioning tool which can show partitions in terms of cylinders or sector with the 'u' option. It labels disk as hda, hdb and partitions inside as hda1, hda2 etc. accessible from /dev folder. See a snapshot below *** Disk /dev/hda: 255 heads, 63 sectors, 2491 cylinders Units = cylinders of 16065 * 512 bytes Device Boot Start End Blocks Id System /dev/hda1 1 384 3084448+ b Win95 FAT32 /dev/hda2 * 385 386 10584 b Win95 /dev/hda3 449 900 3628640 82 Linux swap /dev/hda4 901 2491 12779707+ 83 Linux *** at boot time it show a tux boot screen which can be bypassed with ctrl-x for passing any boot time parameters. iii.Solaris It also has its own fdisk which is quite limited in capability as compared to Linux fdisk, but then we won't be using it any way. it labels disks as c0d0 , partitions as c0d0p0 and slices inside partition as c0d0s0, c0d0s1 etc. It considers the partition allocated to it as one virtual disk which is then divided into slices. There can be up to 8 slices (c0d0s0-s7).By default second slice is for swap and third slice is /.There can be more slices like /home/exports or /opt etc. these don't show up in its partition table as seen here. *** Total disk size is 39714 cylinders Cylinder size in 1008 (512 bytes) cylinders cylinder Partition Status Type Start End Length % 1 Win95 Fat 32 0 6119 6120 15 2 Active X86 BOOT 6120 6140 21 0 2 Solaris 7142 14343 7200 18 3 EXT-DOS 14343 39699 25357 64 *** 1.6 Handeling partition table If all these table-cylinder-sector talk intimidates you, it's time to dig deeper into the issue. Partition table is the index that keeps record of how the physical disk space is distributed into logical divisions that are assigned the drive letters. Each such division is called a partition and for all practical purposes it is treated as separate disk. There can be two types of partitions- primary and extended. Primary partition are numbered 1-4 and each can be assigned only one drive letter. It's possible to boot from primary partition and it makes one entry in the table. The extended partition, can contain many logical drives which may have different types of filesystems. An extended partition makes just one entry in table irrespective of how many logical drives it has. These logical drives are numbered 5 onwards. Note that there is upperlimit of 4 entries in the standard partition-table. The partitioning scheme can be found using the fdisk program. The partition units are generally given at the top of table, and may be cylinders or sectors Linux displays: Disk /dev/hda: 255 heads, 63 sectors, 2491 cylinders Units = cylinders of 16065 * 512 bytes Solaris displays Total disk size is 39714 cylinders Cylinder size in 1008 (512 kbytes) cylinders It is essential to note the units since the arithmetic of disk space allocation is based on it. 1.7 Boot loaders Each OS installes a boot record in the first sector of its boot partition. This keeps the options to be provided at boot time. The one in the first disk partition is called master boot record and is generally used by the default boot loader. It reads a configuration file to pick the image of OS to be booted. Since Lilo is definitely the most flexible one we'll stick to it. 2. Preparing to install Here is the list of homework you need to do before starting the install. Keep a pen, paper and calculator handy as you will need to calculate the capacities in terms of cylinders and sectors. Make sure you put everything on paper as you need to reference what block of cylinders you had left empty in Linux install when you are in Solaris installation. 2.1 Warning Do not try this on a production level server system. BACKUP all the data and configurations as a single step gone wrong can leave you with a "bad PBR signal" or " no operating system". Please dont sue me if it happens. The process described here works best if you are installing everything from scratch. You may try this on another hard disk before messing up your actual system. 2.1 Dry run installation It would be of great help to first run the stand alone installation of the OS you are unfamiliar with so that you are comfortable with the options, configuration values and other peculiarities. Like solarise prefers to install its swap partition in the beginning of disk (sector 3) as it provides maximum flexibility and allows Autolayout of the slices- a task which may seem otherwise intimidating to a newbie. You may decide to leave 512MB partition in the beginning of the disk to accommodate that. It would also be hard to begin installation from the scratch after you took a wrong turn at Solaris installer and ended up with a reboot that halts at "bad PBR signal" ! Also keep making the bootdisks of the respective os. it will save you a lot of headache. 2.2 Installation path Although it's theoretical possible to install in any order, here it is assumed that Windows 2000 is first to be installed on your system. Then Linux and finally Solaris. Reasons for this particular installation path are discussed later in the partitioning scheme section.On installing Linux (with lilo in mbr) after Windows 2000 (in Fat 32 partition) , it will automatically make an entry for windows in the lilo.conf file and present two options at boot time. installing Solaris afterward will wipe out lilo but it will be reinstalled later. Then Lilo and solaris boot manager will chain boot. You will infact be able to boot Windows from either of the two! 2.3 Planning disk layout before beginning the actual installation it would be necessary to plan the amount of diskspace to be allocated to each OS as well as the partitioning scheme. I assume a 20 GB hard disk. 2.4 Allocating diskspace i. Windows 2000 Windows 2000 runs happily with 1 GB. Adding 2 GB for loads of Windows software means we keep 3 GB for first Windows partition ii. Linux A full install of Redhat Linux 7.1 needs 2324 Mb. so lets keep aside 3GB. iii. Solaris It can be installed in following package group options Entire software group + OEM Entire software group Developer group Enduser group it's suggested diskspace for developer group is 1GB but installing KDE (~112MB) and gnome(~390MB) with Gnu tools would need more space. Since i had loads of other developer tools (Sun Forte for Java etc.) in hand, I decided for 4 GB, but you may manage with less. 2.5 Partitioning scheme Now we have the following scenario... Windows 2000 is the first existing OS (1 partition entry) Linux has to be installed before Solaris due to partition type 82h problem Linux partition entry should not be visible to Solaris installer. These condition can be resolve if the disk is partitioned as follows: | | |-------------- extended -------------| | Windows c: 3 GB |Solaris partition 4GB |Linux ext2 |Linux swap | Windows d: | | | | | | Now since Linux is encapsulated inside the extended partition, Solaris would see only two entries - Windows primary and extended. installing Linux in extended and then Solaris in the intermediate partition prevents the problem due to swap partition type entry. The remaining diskspace (~10 GB) is given as Windows D: drive. 3. starting Installation Now lets actually start messing up! 3.1 Partitioning your Hard disk The best scenario is when you decide to install everything from scratch, including Windows. Then make the following partitions when the installer gives the option. 1. Windows primary 3GB C: format as FAT 32 2. free partition 4 GB (do not format this) 3. extended partition in rest of the disk (do not create any logical drives) 3.2 Installing Windows Now install Windows 2000 in C:drive. ;) 3.3 Installing Linux After the Windows setup is complete, get your Linux cd and reboot. Assuming your system can boot from the cd drive you will get the anaconda Linux installer. Now we'll make further partition for linux as follows. ( Note:If youare using a large capacity hard disk like this you may be prompted to make sure that your bios supports booting from a partition further than 8GB. mine did. Still make boot disks when prompted.) RedHat Linux installer comes with both fdisk and Disk Druid for partitioning. Choose fdisk. It will show 3 partitions. in the extended partition create logical drives as follows -3GB Linux ext2 / partition - swap ( size is generally kept twice the amount of ram system has) You may prefer not to assign entire capacity to root but also create /usr and /home separately. Then redistribute the 3GB space accordingly. continue with Linux installation. -assign the rest of the space to windows Fat type partition. if everything goes alright, in your next reboot you will be greeted by the penguin along with Windows and Linux as boot options. Don't forget to make the Linux bootdisk. 3.4 Installing Solaris Solaris installation is handled by the configuration assistant and can be done in three modes... 1. Solaris webstart which is fully text mode and bit intimidating for beginners. 2. Solaris interactive is gui and thus easier to handle. 3. Custom jumpstart is for automatic installation and better avoided. Here we use Interactive mode. After you choose the partition for installation, it will ask for configuring the swap space and the remaining slices. Make c0d0s2 as root (2.4 GB), c0d0s1 as swap and c0d0s3 as /exports/home. After installation finishes system will reboot and Lilo would be gone. Instead, Solaris loader will be showing the partitions as below *** SunOs - Intel Platform edition Primary boot subsystem vsn 2.0 Partition Status Type Start End ============================================================ 1 WINDOWS 63 616897 2 Active X86 Boot 6168960 21168 3 SOLARIS 7199456 7257280 4 EXT_DOS 14458500 25559415 Please select the partition you wish to boot: 2 *** Note that it does not show any linux partition as they are encapsulated inside extended dos. Consequently you can't boot linux from Solaris boot loader. But it does show the Windows partition so you can now boot Windows from here. Next we work to get back the lilo. 4. Restoring the Lilo To get back the LILO screen, insert the linux boot floppy and reboot. when you log in as root run fdisk /dev/hda to note the solaris partition which is active. In this case it is /dev/hda2. Now edit /etc/lilo.conf and add the following lines other=/dev/hda2 label=solaris we will also have to edit the entry of Windows to make it coexist by appending the table=/dev/hda entry other=/dev/hda1 optional label=dos table=/dev/hda save it and run /sbin/lilo command to install lilo in mbr. This should show an output like Added Linux Added dos * Added Solaris where dos is the default boot OS. This should do the trick. Now reboot and you'll get back the lilo screen. If you choose Solaris, the Solaris boot loader will be displayed giving the countdown. If you run the linux fdisk your hard disk partition will look somewhat like this Device Boot Start End Blocks Id System /dev/hda1 1 384 3084448+ b Win95 FAT32 /dev/hda2 * 385 386 10584 be Unknown /dev/hda3 449 900 3628640 82 Linux swap /dev/hda4 901 2491 12779707+ 5 Extended /dev/hda5 901 1285 3092481 83 Linux /dev/hda6 1286 1318 265041 82 Linux swap /dev/hda7 1319 2491 9422091 c Win95 FAT32 (LBA) This is given just for reference purpose, while actual scheme my differ slightly. 5. Playing with trinity Of the three OSes Windows 2000 does not recognise the partitions of either Linux and Solaris. Its Logical Disk manager ( Computer Management > Disk Management)shows all the partitions - C: and Solaris as primary and rest as extended. Not much can be done by the way of mounting Linux/Solaris partitions. 5.1 Mounting Windows partition in Solaris The easiest way to share data now is to do it through a FAT32 partition. Solaris recognises it as partition of type pcfs. It is specified as device:drive where drive is either the DOS logical drive letter (c through z) or a drive number (1 through 24). Drive letter c is equivalent to drive number 1 and represents the Primary DOS partition on the disk; drive letters d through z are equivalent to drive numbers 2 through 24, and represent DOS drives within the Extended DOS partition.Syntax is mount -F pcfs device:drive /directroy-name where directory name specifies the location where the file system is mounted. To mount the first logical drive (d:) in the Extended DOS partition from an IDE hard disk in the directory /d use mount -F pcfs /dev/dsk/c0d0p0:d /d You can use mount directory-name after appending following line is in /etc/vfstab file device:drive directory-name pcfs no rw for example c0d0s0:c /c pcfs no rw To mount a DOS diskette in the first floppy drive, if Volume Management is not running run the command mount -F pcfs /dev/diskette /pcfs/a If Volume Management is running, then running volcheck will automatically mount the floppy and removable disks like cdrom. The floppy drive will then be accessible as /vol/dev/rdiskette0/floppy-name. This implementation of pcfs conforms to the behavior exhibited by Windows 95 version 4.00.950. See pcfs man page for more information. 5.2 Mounting Linux Partition in Solaris This can be done by installing an ext2fs utility available from sunfreeware for download, from ftp://ftp.sunfreeware.com/pub/freeware/intel/7/lxrun/ext2fs.tar.gz (111,226, bytes). This file contains the programs needed to mount the Linux file system in Solaris environment. 5.3 Mounting Solaris partition in Linux The default installation of Redhat Linux 7.1 kernel comes with support of ufs filesystem in read mode only. If it's not so in your case you can rebuild the kernel with support for ufs system. quoting Max Berger from Linux-Solaris Howto " Here are your kernel options for ``Solaris compatibility'': · Under code maturity: Prompt for development drivers Unfortunately UFS writing is still experimental. · In file systems: UFS file system support UFS is the Solaris file system UFS file system write support" The only way to pass data to Solaris partition types / Solaris (x86) partition table support" Is needed for the slices within your Solaris partition to be found. Additional info about kernel building can be found in the Kernel- HOWTO. " Now check what partition has been assigned to Solaris in fdisk output (/dev/hda3 here). This partition can be mounted in /Solaris directory as mount -t ufs -o ufstype=sunx86 /dev/hda3 /Solaris To mount Solaris partitions automatically at boot time, append a line /dev/hda3 /Solaris ufs ufstype=sunx86 0 0 in /etc/fstab file. 5.4 Mounting Windows partition in Linux With the newer releases this is builtin as default install option hence nothing much needs to be done except defining the mount poings in the /etc/fstab and making corresponding directories for mounting c: and d: . 5.5 Installing Gnu tools on Solaris Lots of gnu tools are available from www.sunfreeware.com. This includes emacs, gcc, vim, bison etc. Though they are not supported by Sun still they are availabel as Companion cdrom for free download. Also see the www.sun.com/linux page for latest updates. Installation can be done using the pkgadd command. The companion cdrom comes with its own installer script. All these get installed in /opt/SFW directory by default. #########will add more after review 5.6 Installing KDE and GNOME on Solaris In the same companion cdrom comes the Solaris port of KDE and GNOME desktops. Though Gnome is better supported, it's more resource hungary. To add the option of either desktops in the dtlogin screen run the dtlogin-install script in /opt/SFW/kde/dtlogin/ or /opt/SFW/gnome/dtlogin/ directory. Now refresh the screen and both the desktops will be there in option. Linux user would feel right at home in Solaris! #########will add more after review 5.7 Running Linux binaries in Solaris There is a package called lxrun that emulates the system call environment of Linux on Solaris.It allows access to Linux programs while running Solaris within OpenWindows. For details see the lxrun page at Sun www.sun.com/Linux/lxrun or official lxrun page at www.ugcs.caltech.edu/~steven/lxrun/. You can download it from www.sun.com/Linux/lxrun/download.html and it also ships with the companion cdrom To use lxrun, you need to mount Linux file system within Solaris environment. See the section on mounting Linux filesystem in Solaris for details. #########will add more after review 6. Copyright, credits, information ############ will add after first review