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
1 Hi All,
2
3 A bit off topic, but given I'm trying this on a gentoo system and the high
4 cumulative knowledge of contributors to this M/L, I thought I might as well
5 ask here. I'm trying to access the various partitions within a .dmg archive,
6 but I have so far failed to achieve this. I decompressed it with dmg2img:
7
8 ============================
9 $ dmg2img -v BaseSystem.dmg
10
11 dmg2img v1.6.7 (c) vu1tur (to@×××××××××.org)
12
13 BaseSystem.dmg --> BaseSystem.img
14
15 reading property list, 44613 bytes from address 482080925 ...
16 partition 0: begin=203, size=430, decoded=284
17 partition 1: begin=948, size=430, decoded=284
18 partition 2: begin=1695, size=430, decoded=284
19 partition 3: begin=2424, size=430, decoded=284
20 partition 4: begin=3137, size=35000, decoded=23564
21 partition 5: begin=38420, size=430, decoded=284
22 partition 6: begin=39148, size=430, decoded=284
23 partition 7: begin=39893, size=430, decoded=284
24
25 decompressing:
26 opening partition 0 ... [2] 100.00% ok
27 opening partition 1 ... [2] 100.00% ok
28 opening partition 2 ... [2] 100.00% ok
29 opening partition 3 ... [2] 100.00% ok
30 opening partition 4 ... [584] 100.00% ok
31 opening partition 5 ... [2] 100.00% ok
32 opening partition 6 ... [2] 100.00% ok
33 opening partition 7 ... [2] 100.00% ok
34
35 Archive successfully decompressed as BaseSystem.img
36 ===================================================
37
38 The above output from dmg2img indicates there are 8 partitions within this
39 image. Copying it on a USB stick:
40
41 # dd if=BaseSystem.img of=/dev/sdb
42 4194032+0 records in
43 4194032+0 records out
44 2147344384 bytes (2.1 GB, 2.0 GiB) copied, 586.076 s, 3.7 MB/s
45
46
47 However, gdisk has a different view:
48
49 [snip ...]
50 Sector size (logical/physical): 512/512 bytes
51 Disk identifier (GUID): 82509A33-366D-447F-9585-851F941276D8
52 Partition table holds up to 128 entries
53 Main partition table begins at sector 2 and ends at sector 33
54 First usable sector is 34, last usable sector is 4193998
55 Partitions will be aligned on 8-sector boundaries
56 Total free space is 262157 sectors (128.0 MiB)
57
58 Number Start (sector) End (sector) Size Code Name
59 1 40 3931847 1.9 GiB AF00 disk image
60
61 gdisk only shows one partition, which I can mount on the USB stick as a single
62 HFS+ partition.
63
64 7z shows the filesystem contents within the dmg and img archive, but it does
65 not output each partition:
66
67 Scanning the drive for archives:
68 1 file, 482126050 bytes (460 MiB)
69
70 Listing archive: BaseSystem.dmg
71
72 --
73 Path = BaseSystem.dmg
74 Type = Dmg
75 Physical Size = 482126050
76 Method = Copy Zero2 ZLIB CRC
77 Blocks = 590
78 ----
79 Path = 4.hfs
80 Size = 2013085696
81 Packed Size = 482080513
82 Comment = disk image (Apple_HFS : 4)
83 Method = Copy Zero2 ZLIB CRC
84 --
85 Path = 4.hfs
86 Type = HFS
87 Physical Size = 2013085696
88 Method = HFS+
89 Cluster Size = 4096
90 Free Space = 740196352
91 Created = 2018-10-24 02:10:14
92 Modified = 2018-10-24 09:23:00
93
94 Date Time Attr Size Compressed Name
95 ------------------- ----- ------------ ------------ ------------------------
96 2018-10-24 09:14:13 D.... OS X Base System
97 2018-10-24 09:10:14 D.... OS X Base System/.HFS+
98 Private Directory Data
99 2018-08-17 21:54:02 D.... OS X Base System/.vol
100 [snip ...]
101
102
103 Any idea how I can access each partition within the disk image itself on
104 Linux?
105
106 --
107 Regards,
108 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>