Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 May 2013 11:39:12 -0400
From:      Paul Kraus <paul@kraus-haus.org>
To:        Alexander Yerenkow <yerenkow@gmail.com>
Cc:        freebsd-fs@freebsd.org, Vladislav Prodan <universite@ukr.net>, freebsd-questions@freebsd.org, freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: Tell me how to increase the virtual disk with ZFS?
Message-ID:  <BA8C8B72-CBAE-40E6-926D-9AB664877FDD@kraus-haus.org>
In-Reply-To: <CAPJF9w=KHai7A4HbPVO28Tu4zsw-KrXK=RbCO8YnZKy5BogGnA@mail.gmail.com>
References:  <43529.1368277152.10278121996412321792@ffe11.ukr.net> <CAPJF9w=fzyzqpJThWYViK%2BoR9Ob48iDQndHNgWbR%2BXvceNz8_g@mail.gmail.com> <FF38DFF0-5588-4519-ADA2-7D494604713E@kraus-haus.org> <CAPJF9w=KHai7A4HbPVO28Tu4zsw-KrXK=RbCO8YnZKy5BogGnA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On May 11, 2013, at 11:13 AM, Alexander Yerenkow <yerenkow@gmail.com> =
wrote:

2013/5/11 Paul Kraus <paul@kraus-haus.org
> On May 11, 2013, at 10:03 AM, Alexander Yerenkow <yerenkow@gmail.com> =
wrote:
>=20
> > There's no mature (or flexible, or "can do what I want" ) way to
> > increase/decrease disk sizes in FreeBSD for now {ZFS,UFS}.
> > Best and quickest way - to have twice spare space, copy data, create =
new
> > sufficient disk and copy back.
>=20
> Is this a statement or a question ? If a statement, then it is =
factually FALSE. If it is supposed to be a question, it does not ask =
anything.
>=20
> It was a statement, and luckily I was partially wrong, as Vladislav =
did made what he wanted to.
> However, last time I checked there were no such easy ways to decrease =
zpools

Correct, there is currently no way to decrease the size of a zpool. That =
would require a defragmentation utility, which is on the roadmap as part =
of the bp_rewrite code enhancement (and has been for many, many years =
:-)

> or increase/decrease UFS partitions.

> Or grow mirrored ZFS as easily as single zpool.

This one I do not understand. I have grown mirrored zpools many times. =
Let's say you have a 2-way mirror of 1 TB drives. You can do one of two =
things to grow the zpool:

1) add another pair of drives (of any size) as another top level vdev  =
mirror device (you *can* use a different type of top level vdev, raidZ, =
simple, etc, but that is not recommended for both redundancy and =
performance predictability reasons).

2) swap out one of the 1 TB drives for a 2 TB (zpool replace), you can =
even offline one of the halves of the mirror to do this (but remember =
that you are vulnerable to a failure of the remaining drive during the =
resolver period), let the zpool resolver, then swap out the other 1 TB =
drive for a 2 TB. If the auto expand property is set, then once the =
resolver finishes you have doubled your net capacity.

> Or (killer one) remove added by mistake vdev from zpool ;)

Don't make that mistake. Seriously. If you are managing storage you need =
to be double checking every single command you issue if you care about =
your data integrity. You could easily make the same complaint about =
issuing an 'rm -rf' in the wrong directory (I know people who have done =
that). If you are using snapshots you may be safe, if not your data is =
probably gone.

On the other hand, depending on where in the tree you added the vdev, =
you may be able to remove it. If it is a top level vdev, then you have =
just changed the configuration of the zpool. While very not supported, =
you just might be able, using zdb and rolling back to a TXG before you =
added the device, remove the vdev. A good place to ask that question and =
have the discussion would be the ZFS discuss list at illumos (the list =
discussion is not limited to illumos, but covers all aspects of ZFS on =
all platforms). Archives here: =
http://www.listbox.com/member/archive/182191/sort/time_rev/=20

> Of course I'm not talking about real hw, rather virtual one.

Doesn't matter to ZFS, whether a drive is a physical, a partition, or a =
virtual disk you perform the same operations.

> If you happen to point me somewhere to have such task solved I'd be =
much appreciated.

See above :-) Some of your issues I addressed above, others are not =
there (and may never be).

--
Paul Kraus
Deputy Technical Director, LoneStarCon 3
Sound Coordinator, Schenectady Light Opera Company




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BA8C8B72-CBAE-40E6-926D-9AB664877FDD>