From owner-freebsd-fs@FreeBSD.ORG Fri Jun 12 16:01:39 2015 Return-Path: Delivered-To: freebsd-fs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 420CA340 for ; Fri, 12 Jun 2015 16:01:39 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F195650 for ; Fri, 12 Jun 2015 16:01:38 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from jre-mbp.elischer.org (ppp121-45-248-228.lns20.per4.internode.on.net [121.45.248.228]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t5CG1Vns075470 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 12 Jun 2015 09:01:34 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <557B0255.8060809@freebsd.org> Date: Sat, 13 Jun 2015 00:01:25 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Felipe Monteiro de Carvalho , freebsd-fs@freebsd.org Subject: Re: Uberblock location References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2015 16:01:39 -0000 On 6/12/15 9:49 PM, Felipe Monteiro de Carvalho wrote: > Hello, > > I am writing a program to read ZFS partitions, and although I already > read a lot of documentation, there is 1 problem which is blocking me: > How does the driver find the uberblock? > > I know, I can just get any test volume, find the ZFS uberblock and in > my case it is positioned in 0x20C00 and there are lots and lots of > copies (older versions?) of it. > > But there is no guarantee that it doesn't just happen to be in this > position in my image and in another version it would be elsewhere, so > I need the algorithm utilized to find it. I presume you have looked at the zfs reading library in the bootblocks? > > Any ideas? > > thanks,