FreeBSD on SSD on ASUS P5KPL-C

Warren Block wblock at wonkity.com
Thu Nov 22 03:37:23 UTC 2012


On Tue, 20 Nov 2012, Snow Mountains wrote:

> 2012/11/20 Warren Block <wblock at wonkity.com>:
>> On Tue, 20 Nov 2012, Snow Mountains wrote:
>>
>>> Just one small problem. Here I got this:
>>>
>>> # gpart create -s bsd ada2s1
>>> gpart: geom 'ada2s1': File exists
>>> # gpart set -a active -i 1 ada2s1
>>> gpart: index '1': No such file or directory
>>>
>>> Expected? Anyway, is it any way to but FreeBSD on something like s2?
>>
>>
>> Sorry, typo.  FreeBSD does not have to be the first slice.
>>
>> # gpart create -s bsd ada2s2
>> # gpart set -a active -i 1 ada2s2
>
> Hm, still doesn't work. Look:
>
> # gpart destroy -F ada2
> ada2 destroyed
> # gpart create -s mbr ada2
> ada2 created
> # gpart bootcode -b /boot/mbr ada2
> bootcode written to ada2
> # gpart add -t ntfs -b 2048 -s 30g ada2
> ada2s1 added
> # gpart create -s bsd ada2s2
> gpart: arg0 'ada2s2': Invalid argument

Got a chance to set up a scratch drive and check this.  Turns out I left 
out the step of creating a "slice" (MBR partition) to hold the FreeBSD 
partitions.  Also, GPT labels cannot be used in an MBR.  Fixed below.  I 
will probably add this to my disk setup article because it has come up 
more than once.

--------

Create the MBR partitioning scheme:

# gpart create -s mbr ada2

Add MBR bootcode:

# gpart bootcode -b /boot/mbr ada2

Add the Windows 7 partition, forcing it to start at block 2048 because 
"-a" is not going to do what is expected for slices because of 
decades-old CHS stuff:

# gpart add -t ntfs -b 2048 -s 30g ada2

Create the FreeBSD slice:

# gpart add -t freebsd ada2
# gpart create -s bsd ada2s2

Set this MBR slice active and add FreeBSD bootcode:

# gpart set -a active -i 2 ada2
# gpart bootcode -b /boot/boot ada2s2

Add the FreeBSD partitions.  -a will work here, aligning the partitions.

# gpart add -t freebsd-ufs -a 4k -s 3g ada2s2
# gpart add -t freebsd-ufs -a 4k -s 1g ada2s2
# gpart add -t freebsd-ufs -a 4k       ada2s2

Note: can't use GPT labels... since this is MBR.


More information about the freebsd-questions mailing list