how install two freebsd9.2 on one disk?
freebsd at edvax.de
Sun Nov 17 10:50:32 UTC 2013
On Sun, 17 Nov 2013 13:51:07 +0330, s m wrote:
> for some reason, i want to install two freebsd9.2 OS on one SSD. is it
> i have problem in partitioning my disk for two OS. you know
> there is just one ada0 which can be partitioned.
If you're using the (recommended) partitioning method GPT, you
need to create several partitions, e. g.
ada0p1 = boot code
ada0p2 = OS installation #1 /
ada0p3 = OS installation #1 /usr
ada0p4 = OS installation #1 /home
ada0p4 = OS installation #2 /
ada0p5 = OS installation #2 /usr
ada0p6 = OS installation #2 /home
Use labels to get rid of possible confusion with the disk
devices. Name the /, /var, /usr partitions (or only the /
partitions if you don't do any further partitioning) so you
can conclude which one belongs where, e. g.
ada0p2 label "os1root"
ada0p3 label "os1usr"
ada0p4 label "os1home"
ada0p4 label "os2root"
ada0p5 label "os2usr"
ada0p6 label "os2home"
Use those labels in /etc/fstab instead of the device names.
The FreeBSD Handbook covers this topic in detail:
You'll also find excellent additional documentation here:
If you decide to use the (legacy) partitioning method MBR, you
would first create two slices and then partition them accordingly
for the two OS installations, e. g.
ada0s1 = slice for OS installation #1
ada0s1a = OS installation #1 /
ada0s1d = OS installation #1 /usr
ada0s1e = OS installation #1 /home
ada0s2 = slice for OS installation #1
ada0s2a = OS installation #2 /
ada0s2d = OS installation #2 /usr
ada0s2e = OS installation #2 /home
Note you could also use dedicated disks here (if you only have
one partition per slice, the slices "becomes" the partition,
as like ada0 = ada0c would be the whole disk, ada0s1 = ada0s1c
would be the whole 1st slice). This is not trivial, but simple.
But you need to understand "traditional stuff" well. :-)
As you're probably initializing the SSD with UFS, keep in mind
that you can apply certain optimizations to make the SSD have
a long and happy life. :-)
# newfs -m 0 -i 16384 -b 16384 -f 2048 -l -L os1root ada0s1
# newfs -m 0 -i 16384 -b 16384 -f 2048 -l -L os2root ada0s2
This is just an example which somehow corresponds to the legacy
partitioning method mentioned above. You need of course to set
the parameters to _your_ intended way of use!
> if i define more partitions on ada0, can i use some of them for the first
> OS and the others for second one?
That would be the basic idea.
If you want to share a /home partition, that is also possible,
e. g. ada0p5 label "home" can be mounted from both installations
similarly (identical entry in /etc/fstab).
> if yes, how can i manage booting?
> how and where should i install boot manager in order to manage them in
> booting time??
The boot manager would be installed into the first partition
(active partition) where the BIOS boots into. From there on,
the "next" partition will be selected for loading the kernel
and starting the OS.
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions