is there terminal command that shows/reads the file system(s) (and versions) of a .iso or .dmg image?
E.g. Udf 2.50/Joliet/hfs+
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this communityis there terminal command that shows/reads the file system(s) (and versions) of a .iso or .dmg image?
E.g. Udf 2.50/Joliet/hfs+
Yes - you can read the details from ISO and DMG from the command line using OS provided tools.
The primary command line tool to manipulate disk images is hdiutil
and you may need to attach / authenticate / mount them and use diskutil
to determine file systems contained within a dmg or iso if the wrapper doesn't contain the information you require.
The option I use is hdiutil imageinfo
but also hdiutil fsinfo
has exceptional details on these containers that may be useful to you.
% hdiutil imageinfo foo.dmg
Format Description: UDIF read-only compressed (zlib)
Class Name: CUDIFDiskImage
Checksum Type: CRC32
Size Information:
CUDIFEncoding-bytes-total: 1015091
Total Empty Bytes: 13726208
Sector Count: 30730
Total Bytes: 15733760
CUDIFEncoding-bytes-wasted: 0
Total Non-Empty Bytes: 2007552
Compressed Ratio: 0.50548329507778633
CUDIFEncoding-bytes-in-use: 1015091
Compressed Bytes: 1015091
Checksum Value: $81F7C3A0
Segments:
0: /Users/me/foo.dmg
Partition Information:
1:
Name: disk image (Apple_HFS : 2)
Partition Number: 1
Checksum Type: CRC32
Checksum Value: $AAEEB101
-1:
Name: Driver Descriptor Map (DDM : 0)
Partition Number: -1
Checksum Type: CRC32
Checksum Value: $77150592
2:
Name: (Apple_Free : 3)
Partition Number: 2
Checksum Type: CRC32
Checksum Value: $00000000
0:
Name: Apple (Apple_partition_map : 1)
Partition Number: 0
Checksum Type: CRC32
Checksum Value: $5AC9B785
Format: UDZO
There are dozens of verbs to send to the tool, so I suppose the one you need may vary based on your specific query against the data contained within the packaged file.
hdiutil fsid
get the enclosed filesystsm? I can't test as I don't have anything that's not HFS+
hdiutil fsid
works on the ISO images I tested it on. Which reported the expected ISO 9660 filesystem as well as UDF, and on a hybrid disc it even reported a FAT12 partition, among others on that disc.
Dec 25, 2020 at 14:11
hdiutil imageinfo
is the one I use the most, but OP here is so vague, we can't really guess what level of knowledge they have, what they're doing or what research / actual problem they face is... (do they know what a man
page is? do they really just need to know which ISO are PC and need a one liner with awk|sed|grep
treatment, etc...
diskutil info /dev/<disk#>
?hdiutil
anddiskutil
. You can read the manual page forcommand
in Terminal by typingcommand
and then right-click on it and select: Open man Page