Risposte:
Installa dmg2img .
Quindi, leggi la pagina delle informazioni sul pacchetto e la pagina del manuale per vedere se ti è utile.
L'applicazione sembra convertire .dmg in un file che può essere montato usando il mountcomando:
dmg2img file.dmg imagefile.img
Dal tuo articolo di Wikipedia , il prossimo comando sembra essere disponibile per farlo:
sudo mount -o loop -t hfsplus imagefile.img /mnt
In questo modo, il file imagefile.imgè il risultato dmg2isoe il contenuto sarà disponibile all'indirizzo /mnt. Se il tipo hfsplus non viene rilevato, potrebbe essere necessario caricare il modulo kernel per esso:
sudo modprobe hfsplus
Al termine, è possibile smontarlo eseguendo:
sudo umount /mnt
mount: wrong fs type, bad option, bad superblock on /dev/loop0
file file.dmg. Puoi anche provare 7z l file.dmga elencare i contenuti.
dmg2img v1.6.2. Ho eseguito dmg2img su quello mysql-5.5.28-osx10.6-x86_64.dmgcreato mysql-5.5.28-osx10.6-x86_64.img, ma non monta.
Per estrarlo, è molto più facile usare 7zip. Fai semplicemente:
7z x file.dmg
7zfatto il lavoro, mentre si è dmg2imglamentato di un'immagine dmg corrotta.
0.unknown partitionper me.
Questo funziona per me:
7z xhfsfile di partizioneEstrai usando 7z x
root # aptitude install p7zip-full
root # 7z x ../mysql-5.5.28-osx10.6-x86_64.dmg
7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=en_IN,Utf16=on,HugeFiles=on,4 CPUs)
Processing archive: ../mysql-5.5.28-osx10.6-x86_64.dmg
Extracting 0.MBR
Extracting 1.Primary GPT Header
Extracting 2.Primary GPT Table
Extracting 3.free
Extracting 4.hfs
Extracting 5.free
Extracting 6.Backup GPT Table
Extracting 7.Backup GPT Header
Everything is Ok
Files: 8
Size: 125475840
Compressed: 117543935
root # ls
0.MBR 1.Primary GPT Header 2.Primary GPT Table 3.free 4.hfs 5.free 6.Backup GPT Table 7.Backup GPT Header
Individua la hfspartizione (qui è il 4.hfsfile):
root # ls -l
total 122548
-rw-r--r-- 1 root root 512 Feb 5 16:06 0.MBR
-rw-r--r-- 1 root root 512 Feb 5 16:06 1.Primary GPT Header
-rw-r--r-- 1 root root 16384 Feb 5 16:06 2.Primary GPT Table
-rw-r--r-- 1 root root 3072 Feb 5 16:06 3.free
-rw-r--r-- 1 root root 125435904 Feb 5 16:06 4.hfs
-rw-r--r-- 1 root root 2560 Feb 5 16:06 5.free
-rw-r--r-- 1 root root 16384 Feb 5 16:06 6.Backup GPT Table
-rw-r--r-- 1 root root 512 Feb 5 16:06 7.Backup GPT Header
Montalo nella cartella:
root # mkdir t
root # mount -oloop 4.hfs t
root # cd t/
root # ls
mysql-5.5.28-osx10.6-x86_64.pkg MySQL.prefPane MySQLStartupItem.pkg ReadMe.txt
7z x ../mysql-5.5.28-osx10.6-x86_64.dmg 4.hfs
Se riesci con le istruzioni di Lekensteyn e ottieni più potere per te. Se stai ottenendo
$ lsmod | grep hfs
hfs 54782 0
hfsplus 84912 0
$ sudo mount -o loop,ro -t hfsplus imagefile.img /mnt
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
In questo momento Ubuntu viene fornito solo con dmg2img versione 1.6.2 e la versione 1.6.4 a volte fa la differenza. Inoltre puoi estrarre partizioni specifiche da un dmg e solo alcune di esse sono hfs +
$ dmg2img -l file.dmg
partition 0: Protective Master Boot Record (MBR : 0)
partition 1: GPT Header (Primary GPT Header : 1)
partition 2: GPT Partition Data (Primary GPT Table : 2)
partition 3: (Apple_Free : 3)
partition 4: disk image (Apple_HFS : 4)
partition 5: (Apple_Free : 5)
partition 6: GPT Partition Data (Backup GPT Table : 6)
partition 7: GPT Header (Backup GPT Header : 7)
$ dmg2img -p 4 file.dmg imagefile.img
Quando si utilizza dmg2img file.dmg imagefile.imgsu Linux se si ottiene ERRORE: messaggio di inflazione non riuscito, installare 7zip come
sudo aptitude install p7zip-full
ed emettere il seguente comando sul terminale
7z x your_file.dmg
dmg2img InstallESD.dmg imagefile.imgsul terminale.Ora puoi montare imagefile.img con
modprobe hfsplus
e poi
mount -t hfsplus -o loop mountain.img /mnt
Nel caso di alcuni .dmgs, non puoi né 7z xloro né mountil risultato di dmg2img.
In tal caso, il .imgrisultante da dmg2img your.dmg new.imgpuò avere le sue partizioni estratte con 7z x:
$ 7z x factor-macosx-x86-64-0.98.dmg
[...]
Extracting archive: factor-macosx-x86-64-0.98.dmg
ERROR: factor-macosx-x86-64-0.98.dmg
factor-macosx-x86-64-0.98.dmg
Open ERROR: Can not open the file as [Dmg] archive
$ dmg2img factor-macosx-x86-64-0.98.dmg factor.img
[...]
factor-macosx-x86-64-0.98.dmg --> factor.img
[...]
Archive successfully decompressed as factor.img
$ sudo mount -o loop -t hfsplus factor.img /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/loop5, missing codepage or helper program, or other error.
$ 7z x factor.img
[...]
Extracting archive: factor.img
[...]
Everything is Ok
Folders: 2717
Files: 10266
Size: 176431113
Compressed: 264214528
$ ls -lah factor factor/factor/
factor:
total 24K
drwx------ 6 cat cat 4.0K Jul 30 2018 .
drwxr-xr-x 21 cat cat 4.0K Feb 19 16:28 ..
drwx------ 8 cat cat 4.0K Jul 30 2018 factor
drwx------ 2 cat cat 4.0K Jul 30 2018 '[HFS+ Private Data]'
drwx------ 2 cat cat 4.0K Jul 30 2018 '.HFS+ Private Directory Data'$'\r'
drwx------ 2 cat cat 4.0K Jul 30 2018 .Trashes
factor/factor/:
total 97M
drwx------ 8 cat cat 4.0K Jul 30 2018 .
drwx------ 6 cat cat 4.0K Jul 30 2018 ..
drwx------ 163 cat cat 4.0K Jul 30 2018 basis
drwx------ 45 cat cat 4.0K Jul 30 2018 core
-rw-r--r-- 1 cat cat 702 Jul 30 2018 .dir-locals.el
drwx------ 288 cat cat 12K Jul 30 2018 extra
-rw-r--r-- 1 cat cat 32 Jul 30 2018 factor
drwx------ 3 cat cat 4.0K Jul 30 2018 Factor.app
-rw-r--r-- 1 cat cat 97M Jul 30 2018 factor.image
-rw-r--r-- 1 cat cat 40 Jul 30 2018 .gitattributes
-rw-r--r-- 1 cat cat 43 Jul 30 2018 git-id
-rw-r--r-- 1 cat cat 366K Jul 30 2018 libfactor.dylib
-rw-r--r-- 1 cat cat 16K Jul 30 2018 libfactor-ffi-test.dylib
-rw-r--r-- 1 cat cat 1.3K Jul 30 2018 LICENSE.txt
drwx------ 9 cat cat 4.0K Jul 30 2018 misc
-rw-r--r-- 1 cat cat 4.6K Jul 30 2018 README.md
-rw-r--r-- 1 cat cat 3.6K Jul 30 2018 .travis.yml
drwx------ 2 cat cat 4.0K Jul 30 2018 work
Successo!
7zil file dmg. Perché convertirlo allora?
7z x your.dmgfallisce Can't open as archive: 1e quando dmg2imgneanche l'output sarà accettato mount. Chiarirò
seguendo la risposta di @aman e @tuxdna, perché dmg2img non sembra funzionare su immagini dmg compresse.
così ho realizzato uno script bash (testato su Ubuntu 14.10) per automatizzare il processo di:
lo trovi qui: https://github.com/aurelien-rainone/scripts/blob/master/mountdmg.sh
esempio di utilizzo:
panty@Computerino:[~/scripts]: mountdmg.sh -t hfsplus -d /mnt ~/Downloads/cutecom-ng.dmg
7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)
Processing archive: /home/panty/Downloads/cutecom-ng.dmg
Extracting 0.MBR
Extracting 1.Primary GPT Header
Extracting 2.Primary GPT Table
Extracting 3.free
Extracting 4.hfs
Extracting 5.free
Extracting 6.Backup GPT Table
Extracting 7.Backup GPT Header
Everything is Ok
Files: 8
Size: 33549312
Compressed: 10059312
mountdmg.sh: successfully mounted 4.hfs on /dev/loop0
mountdmg.sh: run sudo umount /dev/loop0 when finished