From: Hin-Tak Leung Subject: Re: off-spec-ness of HFS+ image from apple, hfsplus 2nd volume header, and mount options Date: Sun, 5 Aug 2012 20:06:19 +0100 (BST) Message-ID: <1344193579.98419.YahooMailClassic@web29403.mail.ird.yahoo.com> References: Reply-To: htl10@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, Till Kamppeter , Naohiro Aota , Matthew Garrett , Karel Zak To: Vyacheslav Dubeyko Return-path: Received: from nm24-vm6.bullet.mail.ird.yahoo.com ([212.82.109.197]:20069 "HELO nm24-vm6.bullet.mail.ird.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754828Ab2HETGV convert rfc822-to-8bit (ORCPT ); Sun, 5 Aug 2012 15:06:21 -0400 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --- On Sun, 5/8/12, Vyacheslav Dubeyko wrote: > Hi Hin-Tak, >=20 > On Aug 3, 2012, at 12:40 PM, Hin-Tak Leung wrote: > >=20 > > I know parition map can have different ideas about > volume sizes. I was talking about the HFS+ volume header > itself - located on the 3rd 512-byte, and *supposedly* > located on the 2nd 512-byte from the "end" - the "end" being > the size declared by multiplying the blocksize with > blockcount in the HFS+ header, and counting from 1024 byte > before the primary header.=20 > >=20 > > The smaller set of files also have blockcount way over > the image size itself, and the 2nd header is located at the > beginning of the last used 4k block. > >=20 > > Here they are: > >=20 > > dd if=3Dxcode_4.3.3_for_lion.dmg of=3D/tmp/header1 count=3D3 > skip=3D65 > > dd if=3Dxcode_4.3.3_for_lion.dmg of=3D/tmp/header2 count=3D1 > skip=3D3858241 > >=20 > > ("header1" includes the 2x512 bytes before the primary > volume header, hence count=3D3). > > The HFS+ header says 482273 blocks of 4 KiB, which > means the 2nd header sould be located at 65 + 482273 * 8 - > 2, i.e. at skip 3858247 instead of 3858241 as above. > >=20 >=20 > I made some experiments with creation of hfs+ volumes under > Mac OS X (10.6.8) Snow Leopard. I can't detect such anomaly > in the case of my version of Mac OS. For example, I > created=A0 partition with size of 2097155 sectors (sector > is 512 bytes in size) and I can see second volume header in > the 2097153 sector. It means that second volume header is > located on the distance in 1024 bytes from partition's end. > In volume header I can see volume size in 0x40000 blocks > (block is 4096 bytes) or 2097152 sectors. The detected > position of second volume header is coincided with Apple's > technical specification. >=20 > Unfortunately, I haven't any Apple hardware with installed > Mac OS X Lion. So, I think that maybe reported by you > anomaly is take place under only Lion. Maybe, it was made as > optimization efforts for SSD case.=A0 Do you have > opportunity to make similar experiments under Lion? Those images did mount and worked on Lion (as I mentioned I was helping= a Mac-user friend to set up his dev environment in March). I can try d= ownloading some of the earlier xcode images (or other dev material imag= es) from Apple's to see if earlier Mac OS'es are supposed to be able to= cope with that anomaly. I should point out again that I did not make those images, nor know how= they were made - they are "freely" available on apple's web site. They= are the updates/installers of their standard dev tools (contain Apple'= s patched version of gcc, binutils, autoconf, etc) on Mac OS X, and Mac= OS X [some version] obviously have no problem loop-back mounting them,= even when they are off-spec. It is free registration, and apple doesn't really try to bombard one wi= th more info/offers, so everybody is free to take a look around, if int= erested. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html