Re: How to burn Fedora DVDs to avoid readahead bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 12 May 2007, D. Hugh Redelmeier wrote:
>| From: Andre Robatino <andre@xxxxxxxxxxxxxxx>
>|
>|  When I burned the Fedora ISOs to CDs, I used cdrecord with padding to
>| avoid the readahead bug - see
>|
>| http://www.troubleshooters.com/linux/coasterless.htm
>
>Your analysis matches my understanding.
>
>| 3) Find some other tool besides cdrecord that can do the necessary padding
>| for DVDs.  Are there any?
>
>I pad the iso file, burn the padded file, unpad the iso file, and then
>check to see if the burn worked.
>
>You can use the command isosize(8) to find out how much of an image
>size is the actual iso9660 file system.
>
>I wrote a utility that I use to pad (and unpad) an image file.  I call
>it "isopad".  It pads by 128k bytes of zero which has been enough for
>my systems.
>
>To see if a burn worked, I just use cmp(1) to compare the contents of
>the dvd with the image.  I only check the filesystem part:
>	cmp --bytes `isosize whatever.ios` whatever.iso /dev/hdc
>This uses the cmp(1) --bytes flag which is handy but not in the man
>page.
>
>================ isopad ================
>#!/bin/sh
>
># isopad [+] [-] isofile...
>#
># The Linux IDE CD driver in 2.6 tries to read ahead, even past the end of
> the # CD or DVD.  Even when the program issuing the original read request
> was only # trying to read legitimate parts of the disc (albeit near the
> end). # The result is spurious I/O errors and read failures.
># It does not seem that this driver bug is going to be fixed soon.
>#
># This program is intended to facilitate a workaround.  It can pad (or
> unpad) # a .iso file so that, when it is burned, the resulting disc will
> allow # reads past the end of the content to succeed.
>#
># "+" means pad the following .iso files.
># "-" means remove all padding.
># neither means test file and iso sizes.
>#
># To see how much readahead is enabled on a drive: hdparm -a /dev/hdc
>#
># Why do the padding in place, rather than on a copy of the file?
># .iso files are usually quite large so copying takes a lot of time and
> space. #
># Copyright 2005 D. Hugh Redelmeier
># License: GPL
># Version: Sat Jun 18 02:31:48 EDT 2005
>
># stop at the least sign of trouble
>set -u -e
>
># op is "", "-", or "+": operation to be performed
>op=""
>
>for fn
>do
>	case "$fn"
>	in
>	"-h"|"--help")
>		echo "Usage: $0 [-|+|] isofile..."
>		;;
>	"+"|"-")
>		op="$fn"
>		;;
>	*)
>		isosize -x "$fn"
>		isz=`isosize "$fn"`
>		fsz=`stat --format='%s' "$fn"`
>
>		# conventional block size for CDs
>		bs=2048
>
>		# my guess at a sufficient amount of padding (in blocks)
>		pb=64
>
>		if [ $fsz -lt $isz ]
>		then
>			echo "$fn is shorter ($fsz) than it should be ($isz)" >&2
>			exit 3
>		elif [ ` expr $fsz % $bs ` -ne 0 ]
>		then
>			echo "$fn file size ($fsz) is not a multiple of $bs" >&2
>			exit 4
>		elif [ ` expr $isz % $bs ` -ne 0 ]
>		then
>			echo "$fn isosize ($isz) is not a multiple of $bs" >&2
>			exit 5
>		else
>			case "$op" in
>			"")
>				if [ $fsz -eq $isz ]
>				then
>					echo "$fn: isosize == file size == $fsz"
>				else
>					echo "$fn: isosize $isz; file size $fsz"
>				fi
>				;;
>			"+")
>				echo "$fn: padding with $pb blocks of $bs zero bytes"
>				dd if=/dev/zero bs=$bs count=$pb >>"$fn"
>				;;
>			"-")
>				if [ $fsz -eq $isz ]
>				then
>					echo "$fn: already $fsz bytes"
>				else
>					echo "$fn: truncating from $fsz to $isz bytes"
>					dd if=/dev/null of="$fn" seek=$isz bs=1
>				fi
>				;;
>			esac
>		fi
>		;;
>	esac
>done
>================ end isopad ================

I'm totally bumfuzzled here folks, what with all this talk of padding etc.
AIUI, by definition, the iso IS an image of the disk, in the cases I've played 
with, I have never ever come across an iso that had a mod%2048 of other than 
zero, 2048 being the block size of the iso9660 file system.

And, in every case where a cd or dvd failed the k3b verify phase, I have been 
able to grab a copy of kcalc, divide the size of the .iso as it exists on my 
hard drive by 2048 to obtain a 'block count', at which point a

dd if=/dev/cdrom BS=2048 count=the_count_above >md5sum

and the result except for one occasion where my burner was actually doing an 
exit stage left, a perfect md5sum for the disk, exactly the same as the hard 
drive file.

And the disk of course Just Worked(TM)

So whats all this 'padding' for anyway?  AIUI, any padding would break the 
iso9660 file format except that it might be properly ignored due to being 
completely beyond the the reach of the filesystems ken.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Call me bored, but don't call me boring.
             -- Larry Wall in <199705101952.MAA00756@xxxxxxxx>


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux