[wellylug] How to I make an ISO image?

Volker Kuhlmann hidden at paradise.net.nz
Fri Jun 27 21:20:35 NZST 2003


> You shouldn't need to worry about the blocksize under Linux.

Not necessarily true. Due to the number of kernel bugs in Linux you
will be having a few surprises if you assume that Linux can detect
end-of-file on a cd/dvd correctly. The bugs have been present at least
since 2.0.x and haven't been fixed yet.

To properly read an iso filesystem from cd/dvd, use isoinfo -d -i
/dev/{cdrom, hdaX, srX} to get the number of blocks the filesystem
occupies. The block size for isofs is always 2048. Then use

dd bs=2k count=<numberofblocks> </dev/cdrom >diskimg.iso

I have seen a number of cases where current kernels detect end-of-file
before(!!) the complete filesystem has been read. No kidding. In that
case you're stuffed. Try turning dma off on your cdrom drive, or try
using a windows machine instead.

I made scripts for this a while ago - writecd --blockread /dev/cdrom,
and md5 for handling MD5 checksums. In the scriptutils package on my
website.

Before you burn any iso image(cd or dvd), append at least several
hundred kB of zeroes to the diskimage, or you will run into trouble
reading that disk again under Linux. See cdrecord -pad, but the 30k
that writes are nowhere near enough.

dd bs=10k if=/dev/zero count=300 >>diskimg.iso

Btw, dvds may have a udf filesystem. I haven't yet found a way to
establish the block count and block size of one of those (anyone
knows)?

Volker

-- 
Volker Kuhlmann			is possibly list0570 with the domain in header
http://volker.dnsalias.net/		Please do not CC list postings to me.



More information about the wellylug mailing list