From owner-freebsd-geom@FreeBSD.ORG Sat Jun 29 22:16:30 2013 Return-Path: Delivered-To: geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0AC21ADA; Sat, 29 Jun 2013 22:16:30 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward19.mail.yandex.net (forward19.mail.yandex.net [IPv6:2a02:6b8:0:1402::4]) by mx1.freebsd.org (Postfix) with ESMTP id B1D8D1828; Sat, 29 Jun 2013 22:16:29 +0000 (UTC) Received: from smtp16.mail.yandex.net (smtp16.mail.yandex.net [95.108.252.16]) by forward19.mail.yandex.net (Yandex) with ESMTP id 95FD91121562; Sun, 30 Jun 2013 02:16:26 +0400 (MSK) Received: from smtp16.mail.yandex.net (localhost [127.0.0.1]) by smtp16.mail.yandex.net (Yandex) with ESMTP id 615BE6A06AD; Sun, 30 Jun 2013 02:16:26 +0400 (MSK) Received: from v10-166-195.yandex.net (v10-166-195.yandex.net [84.201.166.195]) by smtp16.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Jm9CZ0wHn9-GPBOHLDU; Sun, 30 Jun 2013 02:16:25 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1372544186; bh=txQ9kYXpB6N0qf6eWCT4hzbrZAzTrN6xE7aIWWKwAU0=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:X-Enigmail-Version:Content-Type: Content-Transfer-Encoding; b=k3vt41PaGPxJ+352fGVW+OyyMG3XVyRT+XUi57quzzc6sloiRUUoPtFtLbyhWiOHm NqW+xcAXpDRjURtMOsLuStrM18IR+Du1LfpgkOduqAzFsk48pXPCBQ+OrTyNsk5oq5 PKKlYmMMf2bt+F74npaFJpVMZ575Hiv1tDpgXleA= Authentication-Results: smtp16.mail.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <51CF5C09.2090303@yandex.ru> Date: Sun, 30 Jun 2013 02:13:29 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Don Lewis Subject: Re: funkiness when resizing a BSD slice References: <201306260731.r5Q7VMBY002283@gw.catspoiler.org> In-Reply-To: <201306260731.r5Q7VMBY002283@gw.catspoiler.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: geom@FreeBSD.org X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jun 2013 22:16:30 -0000 On 26.06.2013 11:31, Don Lewis wrote: > I've got a machine that used to dual boot FreeBSD and a Fedora. It had > one disk slice for FreeBSD, another slice for Fedora, and a third slice > that was marked as Linux swap that both FreeBSD and Linux used as swap. > The FreeBSD slice had only an "a" ufs partition that covered the entire > slice (in addition to the "c" partition). > > FreeBSD outgrew its available space. Since I wasn't using the Fedora > slice anymore, I wanted to delete the Fedora slice, grow the FreeBSD > slice, grow the "a" partition, and the run growfs to expand the ufs > filesystem. Things started off smoothly, but I ran into problems after > I grew the FreeBSD slice. I eventually stumbled around until I expanded > the "a" partition, but then bsdlabel whined about the size of the "c" > partition until I manually edited its size, contrary to the > instructions. Hi, yes, the described problem exists. I see two ways how this can be solved. 1. geom resize method. It is called, when parent provider is growing. So in some way this can be handled by each specific partitioning scheme. 2. Add to the gpart(8) and gpart(4) support to call gpart resize without -i parameter (like this was done recently for set/unset attributes). Without "-i" resize command will update partition table metadata, if it contains some information about available size. > I poked around inside the twistly little passages inside geom and I > *think* the proper way to fix this is to add a resize method to > g_bsd_class in geom_bsd.c. I *think* this resize method should update > d_secperunit in the disklabel at the start of the bsd slice, update > gpt_last in the basetable, and update p_size in the "c" partition entry. geom_bsd isn't used usually, it was replaced with g_part_bsd. -- WBR, Andrey V. Elsukov