Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Sep 2022 14:30:12 -0600
From:      Alan Somers <asomers@freebsd.org>
To:        milky india <milkyindia@gmail.com>
Cc:        freebsd-fs <freebsd-fs@freebsd.org>
Subject:   Re: Need help with live system expansion (zfs+geli)
Message-ID:  <CAOtMX2g2YT%2Bd-p-MJdzAohCU3HqU9m%2B0U7ogBmCNUa4tgV3dLw@mail.gmail.com>
In-Reply-To: <CACQUA7mYYwe_9vgEAkbaeAHsikTbhK5v9EswpTS41nnvDiVh9w@mail.gmail.com>
References:  <CACQUA7kC1E%2BHTEAFY=o%2BFpRcfmhJ-qPWuXseNvT5eJzK4Bcdpw@mail.gmail.com> <CAOtMX2g%2BGZ6SjQQPu-YWJhttYS3D7YhU-kAqMY4xHxXoe6rdVg@mail.gmail.com> <CACQUA7nD2Hrkvo5P7_9gyWkJwX8-ZhMAc3HdgrzTCK=XVqRMog@mail.gmail.com> <CAOtMX2iDg3H75Jp5-N5MgLAvBHKFs8UXvCVPBi_YQKMqYWsz6g@mail.gmail.com> <CACQUA7mzfvwRVhc00kGk3rZHKhFtMChZ983EJ0OBn90DJfaMUQ@mail.gmail.com> <CAOtMX2ijrHuhh8E=M%2BD=FKXq9c0tbOq-ZDNRQZ4n32U5=dEaVg@mail.gmail.com> <CACQUA7nTyT9hpguEbQ1LskHJxq1OUckswbpD__Fov-G9t8Myxg@mail.gmail.com> <CAOtMX2gLaur3c8TATuVeZdDNPoLcG%2B4BrTgOp=Ow3jAuStkKtA@mail.gmail.com> <CACQUA7=6YTN027oUa9xDPNc8Y1MS4rtVYwCxsc0HLpJ8G%2BC8yQ@mail.gmail.com> <CAOtMX2h-adnaupXrwH90HpepnnBpUZFY5OaF_e6a91vFCe8Vjw@mail.gmail.com> <CACQUA7kL7GJTBvxvSh6dnMZ9qzyOS--6S4xt7q5nSc2s=hKwdw@mail.gmail.com> <CAOtMX2hat0FbJWpJA-fQZGxuV_NPASMazTifrJe2WPK8a_%2BMLw@mail.gmail.com> <CACQUA7mYYwe_9vgEAkbaeAHsikTbhK5v9EswpTS41nnvDiVh9w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Sep 17, 2022 at 2:25 PM milky india <milkyindia@gmail.com> wrote:
>
>
>
> On Sun, Sep 18, 2022 at 12:20 AM Alan Somers <asomers@freebsd.org> wrote:
>>
>> On Sat, Sep 17, 2022 at 2:03 PM milky india <milkyindia@gmail.com> wrote=
:
>> >
>> >
>> >
>> > On Sat, Sep 17, 2022 at 10:58 PM Alan Somers <asomers@freebsd.org> wro=
te:
>> >>
>> >> On Sat, Sep 17, 2022 at 12:52 PM milky india <milkyindia@gmail.com> w=
rote:
>> >> >
>> >> >
>> >> >
>> >> > On Sat, Sep 17, 2022 at 10:43 PM Alan Somers <asomers@freebsd.org> =
wrote:
>> >> >>
>> >> >> On Sat, Sep 17, 2022 at 12:31 PM milky india <milkyindia@gmail.com=
> wrote:
>> >> >> >
>> >> >> > Sorry about that, again - I'm not sure what you mean by bottom-p=
ost vs top-post.
>> >> >> >
>> >> >> > Be that as it may - I read the geli man page. I was specifically=
 warned against using "geli resize" since it may not work as expected https=
://forums.FreeBSD.org/threads/how-to-extend-zfs-geli-encrypted-disk-space-n=
ot-showing.86447/post-581642
>> >> >> > Is this advise wrong?
>> >> >> > > "The geli has autoresize flag which will handle the new provid=
er size after gpart resize command."
>> >> >> > followed by
>> >> >> > > You are right, no geli resize needed.
>> >> >> >
>> >> >> > What would be the correct sequence of commands to fix this - Sim=
ply "geli resize" ? (the -s option seems to be additional, will it figure i=
t out without providing s?)
>> >> >> >
>> >> >> > On Sat, Sep 17, 2022 at 10:20 PM Alan Somers <asomers@freebsd.or=
g> wrote:
>> >> >>
>> >> >> top-posting is where you insert your reply above the previous emai=
l.
>> >> >> Bottom posting is where you insert your reply below it, like I'm
>> >> >> doing.  The forum user said that you shouldn't need to run "geli
>> >> >> resize" because the AUTORESIZE flag is on.  But as you can see fro=
m
>> >> >> your "geli list" output, it's actually off.  So you need to run "g=
eli
>> >> >> resize".  The "-s" flag should be unnecessary since your provider =
is
>> >> >> already online.  At any rate, you can try it both ways.  You might
>> >> >> want to make a copy of /var/backups/ada0p3.eli, just in case you m=
ake
>> >> >> a mistake.
>> >> >
>> >> > Thanks - I hope I am bottom posting this as was expected of me.
>> >> >
>> >> > So if I understand correctly the AUTORESIZE flag is present for ada=
op2 and NOT for adap3 (which is the partition we are concerned about) - hen=
ce the advice given to not use "geli resize" isn't applicable here. Am I un=
derstanding this correctly?
>> >>
>> >> Yes
>> >>
>> >> >
>> >> > > So you need to run "geli resize"
>> >> > Is this the only command that I need to run to resize my geli parti=
tion?
>> >>
>> >> Yes
>> >>
>> >> >
>> >> > > The "-s" flag should be unnecessary since your provider is
>> >> > already online.
>> >> > Ok thanks.
>> >> >
>> >> > >You might want to make a copy of /var/backups/ada0p3.eli, just in =
case you make a mistake.
>> >> > Don't have the luxury of backup currently.
>> >>
>> >> Um, ok.  I can't guess why you aren't able to do that, but it isn't
>> >> strictly necessary.
>> >>
>> >> >
>> >> > I suppose at the end of it - if this works - "geli list" would refl=
ect the size to be 458G? (vs 290G currently)
>> >> > And that's the output I can trust to have solved the issue - or is =
there more to it?
>> >>
>> >> Yes.
>> >
>> > > The "-s" flag should be unnecessary since your provider is already o=
nline.
>> > When I try to run "geli resize /dev/ada0p3.eli" it complains. So I gue=
ss options s is must ? If yes - do I need to put in the exact size down to =
bytes from the output of geli list ? Under "Mediasize" ?
>> > ---------------------------------------
>> > geli: Option 's' not specified.
>> > ----------------------------------------
>>
>> Dude, it's easier just to try it, than to ask us.  Go for it.  The
>> worst case scenario if you get the argument wrong is that nothing
>> happens.
>
>
> > The worst case scenario if you get the argument wrong is that nothing h=
appens.
> I'm not very sure if I put in the wrong value of s (old size) then "nothi=
ng happens" - I would imagine if I put in a size less than the current size=
 then possibly the data after that get's lost? Or if I put in a size greate=
r than the current size then there is a gap in the geli partition?
> I sense some frustration in your reply - but I'm on a live system and wou=
ldn't want to possibly risk it going kaput at this last step. That's the re=
ason I'm trying to understand what is the best value of s for geli resize a=
nd how to obtain it.

The purpose of the "-s" argument is to tell geli where to find the old
label, if the provider isn't already attached.  If you supply the
wrong argument, then geli won't be able to find the label, and thus
won't be able to do anything.  It won't destroy any data, and it will
always automatically determine the size of the current provider.  Of
course, if you're worried about losing data, you should always save a
copy of /var/backups/ada0p3.eli, as I suggested.
-Alan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2g2YT%2Bd-p-MJdzAohCU3HqU9m%2B0U7ogBmCNUa4tgV3dLw>