Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Oct 2018 09:05:05 +0000
From:      Lorenzo Salvadore <phascolarctos@protonmail.ch>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Shrinking a partition
Message-ID:  <TcMYOIZpC_lK8VhbEpqYkStIYu3zUfwwc_qgzEjGD58WJ7h2Qut6ZQswFQzLKMU019ZEMyBopOIhSyQIK65Vr6QeHFoEO6F1Ww6meFbC3pQ=@protonmail.ch>

next in thread | raw e-mail | index | archive | help
> Hello,
>
> Is it possible to shink a partition under FreeBSD?
>
> I found only one reference that seems to say it is possible
> https://unix.stackexchange.com/questions/324308/resizing-root-partition
>
> but whenever I try, growfs complains that the new size is smaller than
> the original size/
>
> So, I am wondering if it is another case of "don't trust what you read
> on the web"?
>
> Thanks in advance,
>
> Olivier

Maybe it is possible: I do not know, I never tried. I admit I do not unders=
tand
the logic behind the answer of stackexchange (making smaller than what you
want, then bigger again... when and how the data would be moved?), but even
if I understood it, if I were you, I would try a different strategy.

The best thing when changing partitions is to backup all data and restore i=
t on
the disk after having created the new partition scheme. Moreover, since you
are dealing with sizes of partitions, I guess you are not using ZFS.
With ZFS you do not have do worry about sizes of partitions any more: you
can create as much filesystems as you want and their sizes will shrink and =
grow
accordingly to their need (you can set maximal and minimal sizes if needed)=
. And
it has many more other advantages, see https://www.freebsd.org/doc/handbook=
/zfs.html .
If you choose to move from UFS to ZFS, as far as I know you can do it only =
by
saving your data through backup and then restore it on your disk after havi=
ng
set ZFS.

I hope my answer can be useful.

Lorenzo Salvadore.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?TcMYOIZpC_lK8VhbEpqYkStIYu3zUfwwc_qgzEjGD58WJ7h2Qut6ZQswFQzLKMU019ZEMyBopOIhSyQIK65Vr6QeHFoEO6F1Ww6meFbC3pQ=>