[fdutils] format_n_write for faster disk-from-image creation?
Charles R. Anderson
cra at WPI.EDU
Mon Jul 21 15:51:02 CEST 2003
On Mon, Jul 21, 2003 at 12:10:05PM +0000, Julien Plissonneau Duquene wrote:
jpd> IMO you would have to implement this in another utility than
jpd> superformat, which is meant to be portable, and uses "standard" Linux
jpd> ioctls to format and verify tracks. For example, the "format and
jpd> write" capability may not be available on all controllers (like cheap
jpd> USB chips).
Well, I would see that as being a waste to reimplement the entirety
of superformat in another utility just to add one feature. If the
format and write capability isn't there, it could either error out
or fall back to a normal format without data. Or a symlink could be
used so that if superformat is called as that symlink, it behaves in
the new way.
jpd> Anyway to do that you would have to use FDRAWCMD (or implement another
jpd> ioctl in the floppy driver), and while you are at it there are other
jpd> things to do :
format_track currently uses the FD_FORMAT FDRAWCMD. I'd probably
start by copying this function to a new one format_track_with_data
and modify that to use the FDRAWCMD FD_FORMAT_N_WRITE, which takes a
sector of data as an additional parameter. No additional kernel
support should be needed, so the utility should remain portable
across Linux kernels.
jpd> - verifying while being on the same track (faster) and using raw cmds
jpd> (avoids read-ahead, track changes, retries on errors, *way* faster)
jpd> - write patterns & verify before writing+verifying actual data, also
jpd> using raw cmds, and optionnaly immediately discarding bad disks.
I was thinking of using MD5 to compare the input file to the data
written. This could be done for each track-sized chunk of data,
either during or after formatting, just like the --verify-later
option does. This would bring yet another advantage to a utility
like this, since currently one has to format/verify, then dd, then
verify the data with dd/diff/md5sum, all separately.
I don't know about you, but I am sick of making Linux boot disks
that fail to boot because they failed to write properly, even after
passing the format verify.
fdutils mailing list
fdutils at tux.org
More information about the Fdutils