Re: Resizing EBS with ZFS on AWS

From: Shane Ambler <FreeBSD_at_ShaneWare.Biz>
Date: Sat, 02 Dec 2023 04:30:37 UTC
On 2/12/23 11:26, Shane Ambler wrote:
> Hi,
> 
> I recently started an EC2 with the 14.0 ZFS AMI
> 
> After filling the drive, I expanded it, recovered the gpart partition
> and expanded the partition and zpool size and kept going.
> 
> Then I saw that I would need more space, so I have expanded the EBS vol
> again, while the EC2 was shutdown. This time the EC2 will not boot.
> 
> Using the EC2 console I get to...
> 
> Trying to mount root from zfs:zroot/ROOT/default []...
> Mounting from zfs:zroot/ROOT/default failed with error 2: unknown file
> system.
> GEOM: nda0: the secondary GPT header is not in the last LBA.
> 
> 
> What can I do at mountroot> to recover gpart? or boot from here?
> 

OK so it seems the expanding disk was a red herring, I had altered
loader.conf to break boot.

I came up with steps to attach the unbootable EBS to another instance,
import the pool, fix loader.conf, then re-attached to the original
instance and got it to boot.

Might need to document these cloud recovery steps somewhere.

-- 
FreeBSD - the place to B...Scaring Daemons

Shane Ambler