From owner-freebsd-virtualization@freebsd.org Wed Apr 7 00:01:22 2021 Return-Path: Delivered-To: freebsd-virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2609C5C2D09 for ; Wed, 7 Apr 2021 00:01:22 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FFPgj1MFHz3By7 for ; Wed, 7 Apr 2021 00:01:20 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 13701HV4007931; Tue, 6 Apr 2021 17:01:17 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 13701H9k007930; Tue, 6 Apr 2021 17:01:17 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <202104070001.13701H9k007930@gndrsh.dnsmgr.net> Subject: Re: resizing aarch64 image on arm64 In-Reply-To: <20210406233040.GT14975@funkthat.com> To: John-Mark Gurney Date: Tue, 6 Apr 2021 17:01:17 -0700 (PDT) CC: "Rodney W. Grimes" , freebsd-virtualization@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4FFPgj1MFHz3By7 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [0.07 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; RBL_DBL_DONT_QUERY_IPS(0.00)[69.59.192.140:from]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; SPAMHAUS_ZRD(0.00)[69.59.192.140:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.83)[-0.834]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[freebsd-virtualization]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2021 00:01:22 -0000 > 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