Can I install Linux and Solaris on the same drive?

Can I install Linux and Solaris on the same drive?

Yes, with certain precautions.
Be especially careful with RedHat Linux 6.1 (see below)
Unfortunately, both Solaris/x86 and
Linux swap partitions use the same ID, 0x82. So if you install Solaris
on a drive with a Linux swap partition already on it, it will install
on the Linux swap partition. You have two choices:

1. You can put the Linux swap partition on another drive (or not use
a swap partition if you have enough memory).

2. You can install Linux after (not before Solaris). If you try the
latter, the install program will probably ask if you want to format
what it thinks is your Linux swap partition (and is actually your
Solaris partition) as a swap file. Be sure to not do this!


Red Hat Linux 6.1 (October 1999)


Red Hat Linux 6.1's installer automatically uses all Linux swap partitions
on all drives. Since Solaris/x86 uses the same ID, the installer overwrites
it too! This is not a problem with older versions of RedHat Linux
(as long as Linux and Solaris were on separate drives).


Personally I don't use the installer to upgrade
(I just install individual RPMs).


Here's the summary from

Red Hat Gotchas,
http://www.redhat.com/support/docs/gotchas/6.1/gotchas-6.1-4.html#ss4.12

Problem: Installation of Red Hat Linux 6.1 can overwrite
Solaris. If you have Solaris Intel on your machine, you
will have problems with Red Hat Linux 6.1

Fix:
Solaris partitions use the same type as Linux swap
partitions. The installer will use all found swap
partitions.

Currently, there are several possible work-arounds to this
problem. If Solaris is on a separate drive from the drive you
wish to install Red Hat Linux 6.1 on, please disconnect this
drive.

The other workaround is to change the "Partition type" of the
Solaris partition.
Before you install Red Hat Linux to another type, install Red Hat Linux,
and then change the type back to another type.
This can be accomplished by going using expert mode and
choosing fdisk over disk druid.




# fdisk /dev/hda

Command (m for help): p

Disk /dev/hda: 255 heads, 63 sectors, 784 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 345 2771181 83 Linux
/dev/hda2 346 784 3526267+ 5 Extended
/dev/hda5 346 751 3261163+ 83 Linux
/dev/hda6 752 784 265041 82 Linux swap

Command (m for help): t
Partition number (1-6): 6
Hex code (type L to list codes): 08
Command (m for help): w


After the install you can change the partition type to back
0x82 so that Solaris will boot.


This "gotcha" was removed from the RedHat 6.2 list, so hopefully
the problem doesn't occur with newer versions of RedHat Linux.
For more information, see the Linux HOWTOs and LILO User Guide.
For information on installing Solaris/x86 on your second hard drive, see
below.





Home
FAQ