Increasing ZFS Disk Sizes

Peter Maloney peter.maloney at brockmann-consult.de
Tue Apr 24 06:49:15 UTC 2012


On 04/24/2012 05:22 AM, Tim Gustafson wrote:
> Hi,
>
> I've got a 9.0-RELEASE system that's installed using the hand mfsroot
> installer.  My gpart tables look like this:
>
> =>        34  976773101  ada0  GPT  (465G)
>           34        128     1  freebsd-boot  (64k)
>          162   33554432     2  freebsd-swap  (16G)
>     33554594  943218541     3  freebsd-zfs  (449G)
>
> =>        34  976773101  ada1  GPT  (465G)
>           34        128     1  freebsd-boot  (64k)
>          162   33554432     2  freebsd-swap  (16G)
>     33554594  943218541     3  freebsd-zfs  (449G)
>
> I'd like to increase the size of the freebsd-zfs partition.  I was
> thinking of "breaking" my mirror, like this:
>
> zpool detach tank ada0p3
>
> and then swapping out one of the disks with a blank 2TB disk, and then running:
>
> gpart create -s gpt ada0
> gpart add -b 34 -s 64k -t freebsd-boot ada0
> gpart add -s 16G -t freebsd-swap -l swap0 ada0
> gpart add -t freebsd-zfs -l disk0 ada0
> gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptzfsboot -i 1 ada0
Add "-a 2048" to align for better write performance (especially on SSDs 
and 4k sector disks) (most disks I find do equally well with alignment 
of 4, but some disks (eg. the new Seagate Green 3TB ones) have TERRIBLE 
write performance if the first partition starts before 2048.

gpart create -s gpt ada0
gpart add -b 34 -s 64k -t freebsd-boot ada0
gpart add -a 2048 -s 16G -t freebsd-swap -l swap0 ada0
gpart add -a 2048 -t freebsd-zfs -l disk0 ada0
gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptzfsboot -i 1 ada0

(and if you have problems with partitions being slightly the wrong size, 
use -s <number of sectors> instead of [giga]bytes)


And the zfs side of things looks fine, as Matthew also said.


More information about the freebsd-fs mailing list