Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Apr 2021 17:01:17 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>
To:        John-Mark Gurney <jmg@funkthat.com>
Cc:        "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>, freebsd-virtualization@freebsd.org
Subject:   Re: resizing aarch64 image on arm64
Message-ID:  <202104070001.13701H9k007930@gndrsh.dnsmgr.net>
In-Reply-To: <20210406233040.GT14975@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> Rodney W. Grimes wrote this message on Tue, Apr 06, 2021 at 06:01 -0700:
> > > tech-lists wrote this message on Mon, Apr 05, 2021 at 16:59 +0000:
> > > > Can anyone tell me how to resize
> > > > https://download.freebsd.org/ftp/releases/VM-IMAGES/13.0-RC5/aarch64/Latest/FreeBSD-13.0-RC5-arm64-aarch64.raw
> > > > 
> > > > on an amd64 host?
> > > 
> > > note that this has been unxz'd already.
> > > 
> > > truncate -s 6g FreeBSD-13.0-RC5-arm64-aarch64.raw	# enlarge
> > > mdconfig -f FreeBSD-13.0-RC5-arm64-aarch64.raw		# make device
> > > gpart recover md1					# fix up gpt
> > > gpart resize -i 3 md1					# expand ufs partition
> > > growfs md1p3						# grow ufs
> > > 
> > > Note that mdconfig may output a different md device than md1, use
> > > that instead.
> > 
> > NICE!  Maybe this could be a second example in growfs(8) as
> > an example for "How to prepare an image for use with emulation"?
> 
> In most/all cases for images, just a truncate is needed as Glen
> mentioned.  The growfs(7) rc script is run at first boot to size
> up the root fs as needed.  It can always be run manually later via:
> service growfs onestart

Though that is true, I suspect that running the growfs on
the host is much faster than doing so inside of say.. QEMU,
and is probably 10x faster than doing it before it ends up
on a SD card, though it would increase the dd time to write
the now much larger image.

Also one may be pre-growing the file system to add a bunch of
files to it before booting, I personally shall be using this
technique to build sd cards for arm boards now that I know
how to do it.

> 
> if/when the size of the disk changes...
> 
> Hmm, just noticed that growfs(7) isn't linked from growfs(8), guess
> I need to fix that.
> 
> -- 
>   John-Mark Gurney				Voice: +1 415 225 5579
> 
>      "All that I will do, has been done, All that I have, has not."
> 

-- 
Rod Grimes                                                 rgrimes@freebsd.org



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