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+
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+
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+
– Tetsujin
Dec 25 '20 at 13:25
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.
– user3439894
Dec 25 '20 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...
– bmike
Dec 25 '20 at 14:14
hdiutil create -size 1m -fs UDF -volname Test ~/Desktop/Test.dmg followed by newfs_udf --wipefs yes -b 2048 -r 2.60 -v Test ~/Desktop/Test.dmg Now I need a terminal command which shows me: "UDF 2.60". The commands show me that the fs is UDF but not the version (2.60). Or did I miss something?
– user400439
Dec 29 '20 at 09:38
diskutil info /dev/<disk#>? – Joy Jin Dec 25 '20 at 12:42hdiutilanddiskutil. You can read the manual page forcommandin Terminal by typingcommandand then right-click on it and select: Open man Page – user3439894 Dec 25 '20 at 14:00