From owner-freebsd-fs@FreeBSD.ORG Tue Oct 19 14:52:54 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E0121065675 for ; Tue, 19 Oct 2010 14:52:54 +0000 (UTC) (envelope-from kpielorz_lst@tdx.co.uk) Received: from mail.tdx.com (mail.tdx.com [62.13.128.18]) by mx1.freebsd.org (Postfix) with ESMTP id 0B0988FC15 for ; Tue, 19 Oct 2010 14:52:53 +0000 (UTC) Received: from HexaDeca64.dmpriest.net.uk (HPQuadro64.dmpriest.net.uk [62.13.130.30]) (authenticated bits=0) by mail.tdx.com (8.14.3/8.14.3/Kp) with ESMTP id o9JEqqqs016620 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO) for ; Tue, 19 Oct 2010 15:52:52 +0100 (BST) Date: Tue, 19 Oct 2010 15:52:52 +0100 From: Karl Pielorz To: freebsd-fs@freebsd.org Message-ID: X-Mailer: Mulberry/4.0.8 (Win32) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: ZFS 'read-only' device / pool scan / import? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2010 14:52:54 -0000 Hi, On FreeBSD if I bring the system up 'single user' - the first time I do (for example): " zpool status " There's a pause, a flurry of disk activity - and the system appears to import any pools it finds, and the status appears. I'd guess at this point - some data is written to the disks? - Is there any way of avoiding that, i.e. a kind of "If you were to import the pools/display a status, what would you show, without actually writing any data?" (or importing it) - i.e. to ensure the devices are opened read only? The reason I ask is we recently had a pool that had a mishap. The backing RAID controller dropped a drive (we were using them in JBOD). This happened cleanly. The system got shutdown, and I think the wrong drive was replaced. When it came up the RAID controller 'collapsed' the device list (so there was no gap where the old drive was) - that, plus the wrong drive being replaced meant when we looked at the system we had: " pool: vol state: UNAVAIL status: One or more devices could not be used because the label is missing or invalid. There are insufficient replicas for the pool to continue functioning. " A number of devices were listed as 'corrupted data' - some devices were listed twice as members of the pool - i.e. pretty screwed up. 'undoing' the damage and restarting the server - just threw up the same status. I'm wondering if through the action of having the pool imported/mounted etc. - ZFS has actually *written* to the drives that were available that other drives aren't available / corrupt - and basically, because that info was written, and check-summed correctly - it takes that as gospel now, rather than actually 're-checking' the drives (or is simply unable to re-check the drives - because the meta data has been changed from the previous boot). If you see what I mean :) In the end, we're fortunate - we have backups (and they're currently restoring now) - but I was just interested in if you 'attempt' to mount/import a messed up pool - it could potentially screwup any chances of mounting that pool cleanly again, even if you were to 'undo' the hardware changes. I have a feeling that a zpool import or 'initial' zpool status has to be a read/write operation (i.e. would fail anyway if you could magically make the underlying devices read-only?) -Kp