# multiple partitions



## frabato56 (Sep 30, 2011)

Hi All,

I've been using linux for some time and I'm interested in trying FreeBSD but after reading the handbook I am still uncertain about partitioning. Here is what I have in linux terms:

sda1 windows 7
sda2 windows xp
sda3 linux sabayon
sda4 ext3 personal data

I would like to install FreeBSD on sda3 or ad0s3. Is that possible? does FreeBSD deal with primary and extended partitions? From what I know, I would go about it like this, delete ad0s3 and then create ad0s3, ad0s4, ad0s5 and ad0s6 in that space to be used for /, swap, /var, /usr. I would like to keep the other partitions intact. I would appreciate any guidance as I'm a bit nervous about this operation. My computer is backed up but if I mess things up it will take quite a bit of work to restore it.

Thanks


----------



## frabato56 (Oct 1, 2011)

Another point of confusion for me is the term "slice". Is slice synonymous with partition or is a slice a subdivision of a partition?

Thanks


----------



## wblock@ (Oct 1, 2011)

There are two common partitioning schemes.  The older and more common is MBR.  This is where you have up to four primary partitions, one of which can be used for extended partitions.  FreeBSD calls these partitions "slices", that's the "s" in ad0s1.  The tiny FreeBSD boot loader can't boot from an extended partition, but if you're determined to use one and have grub or one of the other more capable multi-boot thingamabobs, it can be done, but don't be that guy.  FreeBSD can subdivide slices with what it calls "partitions", which are identified with a letter.  So ad0s1a is drive ad0, slice 1, partition a.

The second common partitioning scheme is GPT.  This is the newer and better system, allowing up to 128 partitions on a drive.  Since there are so many, setup can be simplified by just using GPT partitions instead of FreeBSD partitions.  The notation is ad0p1 for GPT partition 1.  Unlike an MBR, you do need a place to put the bootcode, usually the first partition.

Windows XP doesn't support GPT partitions.  Windows 7 does.

Having said all that, yes, you can install FreeBSD in sda3.  FreeBSD will address it as ad0s3.  Typical FreeBSD "partitions" on that "slice" will be

```
ad0s3a  /
ad0s3b  swap
ad0s3c  (not used, represents the whole drive)
ad0s3d  /var
ad0s3e  /tmp
ad0s3f  /usr
```

Do a full backup including the MBR first (yes, I saw that you already had one).  The MBR can be backed up from Linux with
`# dd if=/dev/sda1 of=mbr.bak size=512 count=1`
Copy that file to a USB disk or memory stick.

When installing FreeBSD, don't mess with sizes of MBR partitions (this screen).  Just change the type of the third one to FreeBSD (165, 0xa5).  Q for Quit, leave the master boot record untouched, then choose the Auto Default option for FreeBSD partitions ("Label") on this screen.

Occasionally that "leave the master boot record untouched" will write new bootcode anyway (it's a bug no one has tracked down, new installer for FreeBSD-9 makes it probably not matter).  If that happens, restore the MBR from your backup with
`# dd if=mbr.bak of=/dev/sda1`


----------



## frabato56 (Oct 1, 2011)

Everything is much clearer thanks to your reply.

Thanks!


----------

