[Top][All Lists]

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

Re: dd PATCH: add conv=direct

From: Bruce Allen
Subject: Re: dd PATCH: add conv=direct
Date: Wed, 7 Apr 2004 16:35:27 -0500 (CDT)

> > If you want to add O_DIRECT support to dd then it should be implemented
> > properly, and that means implementing it for both read and write.
> > 
> > In fact the user should be able to specify the read-O_DIRECT and the
> > write-O_DIRECT independently - if for no other reason than that the source
> > and dest filesytems may not both support O_DIRECT.
> Of course if both directions are supported they must be independently
> specifiable.  I just don't see a compelling use case for the input side.

Andy, since I was the one who suggested adding a conv=odirect flag to the
output side, so that we could use a standard tool (dd) to force
reallocation of bad sectors by writing to them, let me argue that it ALSO
makes sense to allow O_DIRECT (as an independent option) on the input

At least one obvious use is to help FIND unreadable disk sectors (or to
verify that some sector is indeed unreadable).  One would like to be able
to do:

  dd if=/dev/hda of=/dev/null bs=512 count=1 skip=LBA conv=idirect

and see if the dd suceeds or fails.

If dd fails, then without having an O_DIRECT option (idirect) at the input
side, there is no way of telling if the failure was because of an
unreadable sector at LBA, or an unreadable sector somewhere else in the
block containing LBA. With the O_DIRECT input option, you can be sure that
if this command fails it's because the sector at LBA was unreadable, not
some nearby sector.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]