From owner-freebsd-stable@freebsd.org Mon May 20 12:37:18 2019 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B8BB15AC3EC for ; Mon, 20 May 2019 12:37:18 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13::5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "eg.sd.rdtc.ru", Issuer "eg.sd.rdtc.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EC4087458D for ; Mon, 20 May 2019 12:37:06 +0000 (UTC) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: freebsd-stable@freebsd.org Received: from [10.58.0.4] (dadv@[10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x4KCavG7051701 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 20 May 2019 19:36:57 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: trying to expand a zvol-backed bhyve guest which is UFS To: Freddie Cash , Paul Mather References: <20190520014645.GC6971@rpi3.zyxst.net> <54BFD570-E9B9-49A5-8785-2D80D4FC05D1@gromit.dlib.vt.edu> Cc: FreeBSD Stable , tech-lists From: Eugene Grosbein Message-ID: <75903282-0efc-b622-771c-38914289b779@grosbein.net> Date: Mon, 20 May 2019 19:36:57 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC4087458D X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-1.39 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.66)[-0.657,0]; MX_INVALID(0.50)[greylisted]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-0.96)[-0.955,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; R_SPF_PERMFAIL(0.00)[]; NEURAL_HAM_SHORT(-0.18)[-0.181,0]; IP_SCORE(0.00)[country: RU(0.01)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29072, ipnet:2a03:3100::/32, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 12:37:18 -0000 20.05.2019 9:14, Freddie Cash wrote: > On Sun, May 19, 2019, 6:59 PM Paul Mather, wrote: > >> On May 19, 2019, at 9:46 PM, tech-lists wrote: >> >>> Hi, >>> >>> context is 12-stable, zfs, bhyve >>> >>> I have a zvol-backed bhyve guest. Its zvol size was initially 512GB >>> It needed to be expanded to 4TB. That worked fine. >>> >>> The problem is the freebsd guest is UFS and I can't seem to make it see >>> the new size. But zfs list -o size on the host shows that as far as zfs >> is >>> concerned, it's 4TB >>> >>> On the guest, I've tried running growfs / but it says requested size is >>> the same as the size it already is (508GB) >>> >>> gpart show on the guest has the following >>> >>> # gpart show >>> => 63 4294967232 vtbd0 MBR (4.0T) >>> 63 1 - free - (512B) >>> 64 4294967216 1 freebsd [active] (2.0T) >>> 4294967280 15 - free - (7.5K) >>> >>> => 0 4294967216 vtbd0s1 BSD (2.0T) >>> 0 1065353216 1 freebsd-ufs (508G) >>> 1065353216 8388544 2 freebsd-swap (4.0G) >>> 1073741760 3221225456 - free - (1.5T) >>> >>> I'm not understanding the double output, or why growfs hasn't worked on >>> the guest ufs. Can anyone help please? >> >> >> Given the above, the freebsd-ufs partition can't grow because there is a >> freebsd-swap partition between it and the free space you've added at the >> end of the volume. >> >> You'd need to delete the swap partition (or otherwise move it to the end >> of >> the partition on the volume) before you could successfully growfs the >> freebsd-ufs partition. >> > > Even if you do all that, you won't be able to use more than 2 TB anyway, as > that's all MBR supports. > > If you need more than 2 TB, you'll need to backup, repartition with GPT, > and restore from backups. Strictly speaking, FreeBSD is capable of using over 2TB "disk" with MBR. And there are multiple ways to achieve that. Simplies one is to boot one time using another root file system (mdconfig'ed image, iSCSI or just another local media) and use "graid label -S" for large media to create GRAID "Promise" array with two SINGLE volumes. First volume should span over boot/root partion in the MBR and then instead of /dev/vtb0s1 it will be shown like /dev/raid/r0s1. No existing data will be lost if there are two 512b blocks free at the end of media for GRAID label. Second volume should span over rest of space and can be arbitrary large as GRAID uses 64 bit numbers. It may be seen as /dev/raid/r1 then. You may then just "newfs /dev/raid/r1" or put BSD label on it beforehand or use this "device" for new ZFS pool etc. There is also GEOM_MAP capable of similar things but it is less convenient. But, if your boot environment supports GPT, it is easier to use GPT.