Six OS's in one disk? Yes it is possible
By realneel on Dec 02, 2005
Six (6) OS's in one diskDo you want to install 6 OS's on a single disk? If so read on..
The goal is to have 6 bootable OS on a single disk. Why should one do it? Because better sharing, more reliability, easier comparisons between OS versions, quicker recovery, ...BTW, I have only tried this on sparc.
Although I am sure that people have been doing this for ages, I first heard it from Charles Suresh, who encouraged me to go ahead and give it a try.
Create PartitionsDisk partitions usually are from 0 - 7, with 2 being the overlap. For our experiment, we set 1 to be the swap. We sized the other partitions equally, with 0 being a little smaller than others. On my 36G disk, the partition looks like the following
0 root wm 2178 - 5655 4.79GB (3478/0/0) 10047942
1 swap wu 0 - 2177 3.00GB (2178/0/0) 6292242
2 backup wm 0 - 24619 33.92GB (24620/0/0) 71127180
3 root wm 5656 - 9285 5.00GB (3630/0/0) 10487070
4 root wm 9286 - 12915 5.00GB (3630/0/0) 10487070
5 root wm 12916 - 16545 5.00GB (3630/0/0) 10487070
6 root wm 16546 - 20175 5.00GB (3630/0/0) 10487070
7 root wm 20176 - 24619 6.12GB (4444/0/0) 12838716
Install The OS
Install Solaris from any source. I typically download the images from
nana.eng, and use my jumpstart server. You can also install from CD,
DVD etc.. Once you install on a slice, you can dd(1) it to other slices, and
fix /etc/vfstab. This is
the fastest way of installing multiple solaris instances on a disc. If
you want another version, or a different build, bfu is your friend. You
can also save off these slices to some /net/... place and restore an
OS at will (again using dd
both ways since you need to preserve the boot blocks). If you slice
multiple machines this way, you can even copy slices across machines
(assuming same architecture etc) - more scripts are needed to change /etc/hosts,
hostname, net/\*/hosts etc
Install via Jumpstart: Setup ProfileIf you like things automated, you could perform a hands-off install via custom jumpstart. The first step is to setup the profile for your server. Since you want to preserve the existing partitions, you have to use the preserve keyword. The profile for my machine looks like the following
filesys c1t1d0s0 existing /
filesys c1t1d0s1 existing swap
filesys c1t1d0s3 existing /s3 preserve
filesys c1t1d0s4 existing /s4 preserve
filesys c1t1d0s5 existing /s5 preserve
filesys c1t1d0s6 existing /s6 preserve
filesys c1t1d0s7 existing /s7 preserve
To install an OS on another slice, just change the root disk (c1t0d0s0 above).
Make sure that the directory where the profiles are stored is shared read-only.
Also ensure that you have a sisidcfg file setup correctly.
|[neel@slc-olympics] config > cat
[neel@slc-olympics] config >
Run the check script.
Note that these profiles can be stored on any server. That machine does not need to have anything special installed. You only need to make sure that the location of the profile, and other custom jumpstart scripts are shared via NFS in a "read-only" mode.
JumpstartOn the jumpstart server (abc.yyy in my case), we added our machine to the list of clients as follows
./add_install_client -i bbb.aaa.xxx.xxx -e a:b:c:d:e:f -c slc-olympics:/export/config -p slc-olympics:/export/config zorrah sun4u
Now reboot your machine as follows
$ reboot -- net - install
Booting via multiple disks/partitions
- Find the path (ls -l /dev/rdsk/..)
- At the ok prompt, type show-disks and select disk
- Type nvalias diskX
# this paste's the selected path
- init 0
- boot diskX