Re: gpart, bsdlabel and fdisk

From: Scot Hetzel <swhetzel_at_gmail.com>
Date: Thu, 22 Oct 2009 12:49:50 -0500
On Thu, Oct 22, 2009 at 3:09 AM, Aristedes Maniatis <ari_at_ish.com.au> wrote:
> On 22/10/09 6:01 PM, Scot Hetzel wrote:
>>
>> http://wiki.freebsd.org/RootOnZFS
>>
>> If anyone notices a problem with them, either let me know or update
>> the wiki page.
>
> That's very helpful, thanks Scot. It raises some questions:
>
> * you don't have the instruction to perform "echo 'a 1' | fdisk -f -
> /dev/ad4" which Robert recommends
>
Since I had created the ZFS Root on a disk that already had partions
on it, and Windows will mark it's partition active, I didn't need this
step for the MBR disk.  The GPT disk didn't need it either when I had
set it up on a extra harddrive on my laptop.

I prefer to use:

# gpart set -a active -i 1 ad4

Just to make it so that only gpart is needed to setup the system.

> * Robert recommends GPT as the "easiest way to get ZFS on root working".
> Your instructions seem to lean more toward MBR "The advantage of using a MBR
> disk is that you can still dual boot with other Operating Systems.". Are
> there any downsides of using MBR which should be explained?
>
It wasn't supposed to lean either way.  It's just that if you need to
boot multiple Operating Systems, then a MBR disk was easier to get
configured.  Recently, I had found ways to multi boot different
Operating Systems on GPT using a Hybrid GPT/MBR scheme.  I haven't had
time to look to see if gpart can create this kind of disk, and if we
have a pmbr, gptboot, or gptzfsboot that can be used to select which
Operating System to boot.  The other option would be to use GRUB.

> * I've seen posts here (sorry I don't have one handy) which recommend to not
> put swap on ZFS. Apart from crash dumps are there any other reasons to
> prefer one over the other? Your instructions explain both, without giving
> much of a guide about why you'd choose one. Is a 'native' swap faster than
> one on ZFS?
>
The reason I choose a swap partition over a ZFS swap VOL is that
problems can occur when the ZFS filesystem starts to run out of room.

> * you write LOADER_ZFS_SUPPORT=YES to src.conf, while previous instruction
> in this thread had it written to make.conf
>
While make.conf can still be used, it is currently shared between
ports and src.  src.conf is the new location to place all src build
options.

> * In order to follow http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror
> will you need to run this from the live CD rather than the first install CD?
>
> * At the top of the same page you give instructions for creating boot, swap
> and zfs partitions. But your instructions give block sizes very specific to
> your disks. It would be helpful to have something like:
>
>  gpart add -b 34 -s 128 -t freebsd-boot ad0   (why 34? this is a different
> magic number to other magic numbers I've seen suggested)

Sector 34 is the first available sector after the Primary GPT Header.  See
http://en.wikipedia.org/wiki/GUID_Partition_Table for a diagram of the
GUID Partition Table Scheme.


>  gpart add -b 162 -s 8G -t freebsd-swap ad0   (the 8G is more readable than
> specifying in sectors)
>

All the guides I had read regarding creating partitions with gpart had
used # sectors instead of specifying the size as 8G.  According to
Oliver Roberts ZFS guide (see http://www.keltia.net/howtos/zfsboot),
in order to create a 512MB swap, you have to double the number to get
1G.

> or even
>
>  gpart add -b 162 -s 8G -t freebsd-swap -l swap-ad0 ad0  (the human readable
> label appears to be a nice feature of GPT)
>
Adding a label to the partition is another addition I was going to
make, as I have several e-mails from the -CURRENT or -STABLE list that
suggest using labels when creating ZFS pool instead of the device
names, as it would make replacing drives easier.

Scot
Received on Thu Oct 22 2009 - 15:49:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:57 UTC