Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] [OT] dmg2img hfs+ disk image
Date: Sat, 23 Feb 2019 00:00:46
Message-Id: 2658022.jVxsfG8r8u@dell_xps
Hi All,

A bit off topic, but given I'm trying this on a gentoo system and the high 
cumulative knowledge of contributors to this M/L, I thought I might as well 
ask here.  I'm trying to access the various partitions within a .dmg archive, 
but I have so far failed to achieve this.  I decompressed it with dmg2img:

============================
 $ dmg2img -v BaseSystem.dmg 

dmg2img v1.6.7 (c) vu1tur (to@×××××××××.org)

BaseSystem.dmg --> BaseSystem.img

reading property list, 44613 bytes from address 482080925 ...
partition 0: begin=203, size=430, decoded=284
partition 1: begin=948, size=430, decoded=284
partition 2: begin=1695, size=430, decoded=284
partition 3: begin=2424, size=430, decoded=284
partition 4: begin=3137, size=35000, decoded=23564
partition 5: begin=38420, size=430, decoded=284
partition 6: begin=39148, size=430, decoded=284
partition 7: begin=39893, size=430, decoded=284

decompressing:
opening partition 0 ...         [2] 100.00%  ok
opening partition 1 ...         [2] 100.00%  ok
opening partition 2 ...         [2] 100.00%  ok
opening partition 3 ...         [2] 100.00%  ok
opening partition 4 ...       [584] 100.00%  ok
opening partition 5 ...         [2] 100.00%  ok
opening partition 6 ...         [2] 100.00%  ok
opening partition 7 ...         [2] 100.00%  ok

Archive successfully decompressed as BaseSystem.img
===================================================

The above output from dmg2img indicates there are 8 partitions within this 
image.  Copying it on a USB stick:

# dd if=BaseSystem.img of=/dev/sdb
4194032+0 records in
4194032+0 records out
2147344384 bytes (2.1 GB, 2.0 GiB) copied, 586.076 s, 3.7 MB/s


However, gdisk has a different view:

[snip ...]
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 82509A33-366D-447F-9585-851F941276D8
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 4193998
Partitions will be aligned on 8-sector boundaries
Total free space is 262157 sectors (128.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40         3931847   1.9 GiB     AF00  disk image

gdisk only shows one partition, which I can mount on the USB stick as a single 
HFS+ partition.  

7z shows the filesystem contents within the dmg and img archive, but it does 
not output each partition:

Scanning the drive for archives:
1 file, 482126050 bytes (460 MiB)

Listing archive: BaseSystem.dmg

--
Path = BaseSystem.dmg
Type = Dmg
Physical Size = 482126050
Method = Copy Zero2 ZLIB CRC
Blocks = 590
----
Path = 4.hfs
Size = 2013085696
Packed Size = 482080513
Comment = disk image (Apple_HFS : 4)
Method = Copy Zero2 ZLIB CRC
--
Path = 4.hfs
Type = HFS
Physical Size = 2013085696
Method = HFS+
Cluster Size = 4096
Free Space = 740196352
Created = 2018-10-24 02:10:14
Modified = 2018-10-24 09:23:00

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2018-10-24 09:14:13 D....                            OS X Base System
2018-10-24 09:10:14 D....                            OS X Base System/.HFS+ 
Private Directory Data
2018-08-17 21:54:02 D....                            OS X Base System/.vol
[snip ...]


Any idea how I can access each partition within the disk image itself on 
Linux?

-- 
Regards,
Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] [OT] dmg2img hfs+ disk image Andrew Udvare <audvare@×××××.com>