Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Apr 2012 20:22:34 -0700
From:      Tim Gustafson <tjg@tgustafson.com>
To:        freebsd-fs@freebsd.org
Subject:   Increasing ZFS Disk Sizes
Message-ID:  <CACMcHMdCaJjE1Ao7jN156tK%2ByNHDCyEZ-wam489jq2JhCJd%2BnA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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

And then running:

zpool attach tank ada0p3

Am I missing anything here, or is the this "safe" way to do this?  Do
I need to do anything special (other than the gpart bootcode command)
to make the new disk bootable?  Do I need to do anything special to
set up the swap partition?  Right now, I have this in my /etc/fstab:

/dev/gptid/47bc37af-873b-11e1-b913-003048b98c9e none swap sw 0 0

Would it be safe to change that to:

/dev/ada1p2 none swap sw 0 0

during the operation, and then back to ada0p2 when the re-silvering is complete?

Of course, once I'm done with the first disk, I will repeat the
procedure for the second disk.

Thanks!

-- 

Tim Gustafson
tjg@tgustafson.com
http://tgustafson.com/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACMcHMdCaJjE1Ao7jN156tK%2ByNHDCyEZ-wam489jq2JhCJd%2BnA>