From owner-freebsd-fs@FreeBSD.ORG Sat Jun 13 12:55:21 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 C20F9279 for ; Sat, 13 Jun 2015 12:55:21 +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 98BA39FC for ; Sat, 13 Jun 2015 12:55:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (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 t5DCtF7L079581 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 13 Jun 2015 05:55:18 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <557C282D.8060809@freebsd.org> Date: Sat, 13 Jun 2015 20:55:09 +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: felipemonteiro.carvalho@gmail.com CC: "freebsd-fs@freebsd.org" Subject: Re: Uberblock location References: <557B0255.8060809@freebsd.org> <01184F08-1C6B-4282-9203-1BF98F07A05A@gmail.com> In-Reply-To: <01184F08-1C6B-4282-9203-1BF98F07A05A@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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: Sat, 13 Jun 2015 12:55:21 -0000 On 6/13/15 5:43 PM, felipemonteiro.carvalho@gmail.com wrote: > hello, > > Where can I find the source code that you are mentioning? I am reading the source in https://github.com/zfsonlinux/zfs?files=1 but it is very large and so far I couldnt pinpoint where it finds the uberblock. why are you posting to a FreeBSD mailing list and looking at Linux sources? Our ZFS code is not there, but in https://svnweb.freebsd.org/base/head/sys/cddl/ I speak of the boot code (at https://svnweb.freebsd.org/base/head/sys/boot/zfs/ specifically, and https://svnweb.freebsd.org/base/head/sys/boot/ in general, because it is a 'stand alone' implementation of a ZFS reader. it could be copied to run as a regular user process. > > Also the mention of bootblock confuses me since ita for booting while I am working in a general case, not necessarely involving boot. > > thanks, > > Felipe > > Enviada do meu iPhone > >> Em 12/06/2015, às 18:01, Julian Elischer escreveu: >> >>> 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, > >