From owner-freebsd-current@FreeBSD.ORG Sun Feb 3 21:09:04 2013 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 293263DD; Sun, 3 Feb 2013 21:09:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 02EABA69; Sun, 3 Feb 2013 21:09:03 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.6/8.14.6) with ESMTP id r13L8uGp072257; Sun, 3 Feb 2013 14:08:56 -0700 (MST) (envelope-from ian@FreeBSD.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r13L8XP5028661; Sun, 3 Feb 2013 14:08:33 -0700 (MST) (envelope-from ian@FreeBSD.org) Subject: Re: gpart resize vs. cache? From: Ian Lepore To: Tim Kientzle In-Reply-To: <3D812191-2D6E-43B2-B9C1-F00FFA44C5F8@freebsd.org> References: <3D812191-2D6E-43B2-B9C1-F00FFA44C5F8@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 03 Feb 2013 14:08:33 -0700 Message-ID: <1359925713.93359.440.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-current Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 21:09:04 -0000 On Sun, 2013-02-03 at 12:06 -0800, Tim Kientzle wrote: > I'm tinkering with a disk image that automatically > fills whatever media you put it onto. But I'm having > trouble with gpart resize failing. > > Disk layout: > MBR with two slices mmcsd0s1 and mmcsd0s2 > bsdlabel with one partition mmcsd0s2a > > Before I can use growfs, I have two gpart resize operations: > > 1) gpart resize -i 2 mmcsd0 > > 2) gpart resize -i 1 mmcsd0s2 > > Step 1 resizes mmcsd0s2 and always succeeds. > > Step 2 resizes mmcsd0s2a and always fails > with "No space on device." > > BUT if I reboot between these steps, step #2 > always succeeds. > > I suspect that step #1 is updating the partition > information on disk but that step #2 is somehow > reading the old size of mmcsd0s2 and thus finding > that there is no available space to grow the partition. > > gpart(1) doesn't say anything about caching of > disk partiition info and "gpart list" does show the > updated information after step #1. > > Is there some trick that will force the partition > information in memory to be updated (short of > a reboot or unmount/remount the root filesystem)? This sounds like one of those situations where the "force re-taste" incantation may work... just open/close the parent geom for write. From script, it's as easy as : >/dev/mmcsd0s2 If that doesn't work, try /dev/mmcsd0. The re-taste trick is usually only needed on things like a usb sdcard reader where it can't tell you changed media and tries to use the in-memory info from the prior card. Since you're using a geom-aware tool to make a geom change, I wonder why it doesn't do the re-taste automatically? -- Ian