From owner-freebsd-geom@FreeBSD.ORG Thu Jul 27 19:06:20 2006 Return-Path: X-Original-To: freebsd-geom@FreeBSD.org Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CCCE316A4DE; Thu, 27 Jul 2006 19:06:20 +0000 (UTC) (envelope-from rik@inse.ru) Received: from mail.inse.ru (inse.ru [144.206.128.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2EE2F43D70; Thu, 27 Jul 2006 19:06:14 +0000 (GMT) (envelope-from rik@inse.ru) Received: from [127.0.0.1] (www.inse.ru [144.206.128.1]) by mail.inse.ru (Postfix) with ESMTP id C07A933C46; Thu, 27 Jul 2006 23:06:12 +0400 (MSD) Message-ID: <44C91045.8090606@inse.ru> Date: Thu, 27 Jul 2006 23:13:09 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (X11; U; Linux i686; ru-RU; rv:1.7.12) Gecko/20060103 ASPLinux/1.7.12-1.5.1.1asp X-Accept-Language: ru-ru, ru MIME-Version: 1.0 To: freebsd-geom@FreeBSD.org Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Poul-Henning Kamp , Pawel Jakub Dawidek Subject: bsdlabel: potential bug and/or question about it X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jul 2006 19:06:20 -0000 Hi, I am trying to understand filesystem structure to extract data from half-broken hard drive and I've started to read sources of bsdlabel (if someone know any articles about bsdlabel and/or ufs2 structure please let me know). My question is what for mbroffset and what is it? I have only some surmises about it, but it looks that this code could lead to filesystem corruption. But I hope I am wrong :-) http://cvsup.pt.freebsd.org/cgi-bin/cvsweb/cvsweb.cgi/src/sbin/bsdlabel/bsdlabel.c.diff?r1=1.89&r2=1.90 My train of thought was that in case we have the mbroffset not equal to offset of c (raw) partition we wouldn't substruct mbroffset from all offsets. Lets also assume that this case we meet while we started to edit such slice. We've finished editing and started to write results. In case of write we would add mbroffset unconditionally and thus we get wrong offsets and corrupted partition table. Best regards, rik