From owner-freebsd-scsi@FreeBSD.ORG Mon Dec 16 21:17:52 2013 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7218FC29 for ; Mon, 16 Dec 2013 21:17:52 +0000 (UTC) Received: from outgoing.acpcloud.de (outgoing.acpcloud.de [109.68.51.22]) by mx1.freebsd.org (Postfix) with SMTP id CC9311EA8 for ; Mon, 16 Dec 2013 21:17:51 +0000 (UTC) Received: from CASHUB2.acp-xch.local (10.5.2.15) by EHUB2.acp-xch.local (10.5.2.11) with Microsoft SMTP Server (TLS) id 14.2.318.4; Mon, 16 Dec 2013 22:16:36 +0100 Received: from [192.168.0.11] (10.5.2.2) by mail.acpcloud.de (10.5.2.23) with Microsoft SMTP Server (TLS) id 14.2.318.4; Mon, 16 Dec 2013 22:16:36 +0100 Message-ID: <52AF6DB7.5010004@xamine.com> Date: Mon, 16 Dec 2013 22:16:39 +0100 From: Rolf Grossmann Organization: Xamine GmbH User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: , Subject: Re: camcontrol rescan not updating disk size? References: <52AF2DE0.70101@progtech.net> <52AF380A.30407@interlog.com> In-Reply-To: <52AF380A.30407@interlog.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.5.2.2] X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 21:17:52 -0000 On 16.12.2013 18:27, Douglas Gilbert wrote: > On 13-12-16 11:44 AM, Rolf Grossmann wrote: >> Hi, >> >> I'm having a problem with a virtualized system. I've grown the virtual >> disk, but my FreeBSD 9.1-STABLE r246991 won't recognize the new size: >> >> # grep da1 /var/run/dmesg.boot >> da1 at mpt0 bus 0 scbus2 target 1 lun 0 >> da1: Fixed Direct Access SCSI-2 device >> da1: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) >> da1: Command Queueing enabled >> da1: 75776MB (155189248 512 byte sectors: 255H 63S/T 9660C) >> >> # camcontrol readcap 2:1:0 >> Last Block: 314572799, Block Length: 512 bytes >> >> # camcontrol rescan 2:1:0 >> Re-scan of 2:1:0 was successful >> >> # geom disk list da1 >> Geom name: da1 >> Providers: >> 1. Name: da1 >> Mediasize: 79456894976 (74G) >> Sectorsize: 512 >> Mode: r1w1e1 >> descr: VMware Virtual disk >> ident: (null) >> fwsectors: 63 >> fwheads: 255 >> >> IMHO that should now read "Mediasize: 161061273088 (150G)". >> >> (What I'm actually trying to do is "zpool online -e mypool da1", but >> that doesn't recognize the new size either, so I'm thinking geom is a >> good indicator of the system's idea of the disk size.) >> >> I've tried a full and targetd rescan multiple times to no avail. I don't >> see anything to rescan the size or flush some sort of cache. My Google >> searches also came up empty. I'm out of ideas what else to try short of >> a reboot (which I'd really like to avoid). > > A related point: according to sbc3r36.pdf when an LU changes its > size then it should "establish a unit attention condition with an > additional sense code set to CAPACITY DATA HAS CHANGED". Can you > determine if that happens? If it does then CAM needs enhancing, if > not targetd needs some work. I've reproduced the problem on my 9.2-STABLE test system that I can reboot and compiled in CAMDEBUG. As far as I can see the emulated scsi controller does not send any unit attention condition. Also, I think relying on the device to tell you about changes should be optional, but the rescan (or whatever other command I should use) should always detect the correct size. On the other hand, John-Mark Gurney is also correct in pointing out that closing and reopening the device (as in zpool export; zpool import) does update the size. Of course that still requires me to shut down everything running on that filesystem, which is what I'm trying to (though probably can't) avoid. So what's next? Should I open a bug report? Anything else I should try? Thanks for your help. Rolf. Rolf Grossmann Software Developer Xamine GmbH | Holzstra=DFe 28 | 80469 M=FCnchen Fon: +49 89 7201888-22 | Fax: +49 89 7201888-99 Gesch=E4ftsf=FChrer: Peter Herold | Sitz der GmbH: M=FCnchen, Deutschland Registergericht: AG M=FCnchen (HRB 167040) | USt-IdNr.: DE 253 181 639