From owner-freebsd-current@freebsd.org Mon Aug 1 19:52:07 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BA36BABA54 for ; Mon, 1 Aug 2016 19:52:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23F2D17DE for ; Mon, 1 Aug 2016 19:52:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id b62so192999012iod.3 for ; Mon, 01 Aug 2016 12:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=hHftmhshxhis8hl7TkZAoQtcsBf0mf8uzs4Ea1qKk7w=; b=nOBAbm1IiFzV1k4pw+2WXi88nQE72IXlbd/Vd5LMi4auK0ttjHZIsKBwFCMn8UESlD Uhh23d/TuOumAlP1KW81ShXfsaMu/UOIAq3bBu31INS53jDTEGUDIY9QyET1jVb4xKTt j8cQdv6ZHjlIktdcV6FbhZWP9fG2xxSkSpi6o6v1hcEO7aHF2arkpyLUW19Zl6crC08b +SVzONo0pUnEc9l3rSkgh/x5QljV+1KXPCF/WviiyMAvfz66xVChTT0mT4Uawg5ipJ+d +i6btUEXIkHuFNcgTIa7ELO7Sm/5drf8teeIrVkPtTpO16y9O4pSORDlhRKayoyiCEpb C35w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hHftmhshxhis8hl7TkZAoQtcsBf0mf8uzs4Ea1qKk7w=; b=aLsiuUz+OgtX5BMI3nFmQ3XDITJ8QZfHR+5lc26SeGknwvSwyZZ+CavBFx2yM4zb+m IivJ7pjEYFamhJ6u0cequJ+6kVw0uF6/4P2qpoN5fmRzT0fy9WLpJmcdhzmSimehBp5w 6XBWWbDAmaz+iMJEOHvE38QnNW2JcLOn+Ru5a+qK4tj+rHSahkEYwNtuO6tn8iBz71kz dMSKfx5WraunnonmzV3dEFghJB6ACSvmGihWHTX95dZjJtm4cmr14Q/FLgqVhKNeGT9g duOR/G/AGufNsqUE9gnex0ALgOdh7ACINwe2X7qFUdzZFFFVDzU09I2wSr8qwTaaxx8X UeHA== X-Gm-Message-State: AEkooutPiuJcqJ4I8SGy8haXGUN8xNgZtFYGSvENsMoIg+3gE07fMr0XaqDV1awzUnPjjjCy5P1XgAKGBsIYDg== X-Received: by 10.107.167.206 with SMTP id q197mr58855313ioe.197.1470081126422; Mon, 01 Aug 2016 12:52:06 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.137.131 with HTTP; Mon, 1 Aug 2016 12:52:05 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <1470080210.1283.36.camel@freebsd.org> References: <20160801110554.289d040d@freyja.zeit4.iv.bundesimmobilien.de> <20160801174035.GI74453@gmail.com> <0b4f142a-7c44-832d-5fe2-c2a6264383cc@shrew.net> <1470080210.1283.36.camel@freebsd.org> From: Warner Losh Date: Mon, 1 Aug 2016 13:52:05 -0600 X-Google-Sender-Auth: OGRHZBtIYOnbS3d547RSHIAVDZ4 Message-ID: Subject: Re: CURRENT: [USB] : GEOM_PART: da4 was automatically resized. To: Ian Lepore , "Andrey V. Elsukov" Cc: Matthew Grooms , FreeBSD Current Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 01 Aug 2016 19:52:07 -0000 On Mon, Aug 1, 2016 at 1:36 PM, Ian Lepore wrote: > On Mon, 2016-08-01 at 13:55 -0500, Matthew Grooms wrote: >> On 8/1/2016 12:40 PM, Randy Westlund wrote: >> > On Mon, Aug 01, 2016 at 11:05:54AM +0200, O. Hartmann wrote: >> > > On every(!) USB drive which worked well with 11-CURRENT up to 11 >> > > -BETA, I fail >> > > to access with 12-CURRENT (12.0-CURRENT FreeBSD 12.0-CURRENT #14 >> > > r303475: Fri >> > > Jul 29 11:59:11 CEST 2016) with the error shown below. >> > > >> > > On USB flash drives I created myself, the suggested gpart command >> > > solved the >> > > problem, but I can not do this with drives I was given by a >> > > vendor or supplier. >> > > >> > > What is wrong? >> > > >> > > Kind regards and thank you very much in advance, >> > > >> > > O. Hartmann >> > > >> > > >> > > On console, I get the report: >> > > >> > > [...] >> > > GEOM_PART: da4 was automatically resized. >> > > Use `gpart commit da4` to save changes or `gpart undo da4` to >> > > revert them. >> > >> > I noticed something similar when I was trying to dd a more recent >> > memstick installer to a USB drive on 12-CURRENT. When I plugged in >> > the >> > flash drive I couldn't dd to it until I noticed that message in >> > syslog >> > and ran 'gpart undo da0'. Looks like something is unhelpfully >> > auto-resizing partitions. >> > >> >> Do you have growfs_enable in your rc.conf file? I think this is added >> to >> certain flash images by default so it will automatically grow to your >> device capacity. See ... >> >> /etc/rc.d/growfs >> >> ... and ... >> >> https://lists.freebsd.org/pipermail/freebsd-rc/2014-May/003497.html >> >> -Matthew > > I think rather than being related to growfs, this is fallout from > r303019 [*] which automatically resizes the device geom based on what > the device reports. I suspect the intent was to make gpt backup > partition data appear at the right place on the device even when the > original image is created on a device of a different size. > > Unfortunately, leaving an uncommited geom change lurking in the system > is going to lead to a fair amount of confusion, since it makes other > attempts to work with the device fail, usually with no clue about why > it's failing. Uncommitted geom changes are a bit like an invisible > time bomb in your system; it wouldn't be so bad if they weren't so > invisible, and weren't so hard to figure out how to properly get out of > the situation. > > Something like a "gpart undo -r " to recursively undo all > uncommitted changes would go a long way towards fixing the "what to do" > part. I'm not sure how to make pending changes more visible. Maybe it > would work to have gpart show flag uncommitted changes somehow. > > * https://svnweb.freebsd.org/base/head/sys/geom/geom_disk.c?view=log Yea, this change "looks" ok, but if it has this side effect it should be backed out ASAP. I've CC'd Andrey for comment. I can't imagine that this was his intent with the change, since the commit log makes no mention of it and I'm having trouble understanding the justification for the 'pend change' bit... Warner