Why doesn't tar recognize .iso files, even though the documentation says it should?
man tar
says that OS X's tar
implementation should be able to extract .iso files.
tar creates and manipulates streaming archive files. This implementation can extract from tar, pax, cpio, zip, jar, ar, and ISO 9660 cdrom images and can create tar, pax, cpio, ar, and shar archives.
However, tar
gives me the following error:
$ tar -xvf test.iso
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
What's with the discrepancy?
The .iso is created from a .dmg using Apple's hdiutil
utility. poweriso
can extract it without issue.
I'm on OS X 10.7.4. tar --version
reports bsdtar 2.8.3 - libarchive 2.8.3
.
Solution 1:
Chances are that it is not a pure ISO image so tar
may not recognize it. I have tested tar
on some random ISO images and it could handle them all, so it's likely specific to that particular image. Note that hdiutil
can create non-ISO CDR images so you would have to explicitly tell it to use the ISO format (note that the ISO format is somewhat restrictive, so many CDs use a different format either in addition to ISO or instead of it).