Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.
On Tue, Jun 05, 2007 at 10:47:25AM +0100, Luciano Rocha wrote:
> On Tue, Jun 05, 2007 at 11:12:12AM +0200, Lars Ellenberg wrote:
> > On Mon, Jun 04, 2007 at 11:58:30AM -0500, David Masover wrote:
> > > On Monday 04 June 2007 08:56:41 Lars Ellenberg wrote:
> > >
> > > dd if=/dev/drbd0 of=/dev/null bs=1M count=1 skip=1
> > >
> > > That one should be instantaneous,
> >
> > no, since "skip" for dd litteraly means skip, it does not mean seek.
> > it means read /dev/drbd0 from the start (offset 0), throw away the first
> > megabyte, then ouput the second megabyte.
>
> No it doesn't.
>
> strace dd if=/dev/hdg of=/dev/null bs=1M count=1 skip=1
> ...
> 4391 open("/dev/hdg", O_RDONLY|O_LARGEFILE) = 0
> 4391 _llseek(0, 0, [0], SEEK_CUR) = 0 -> does this support seek?
> ...
> 4391 _llseek(0, 1048576, [1048576], SEEK_CUR) = 0 -> skip 1 ibs
> 4391 read(0, "\0"..., 1048576) = 1048576
> 4391 write(1, "\0"..., 1048576) = 1048576
>
> with skip=10:
> ...
> 4420 _llseek(0, 10485760, [10485760], SEEK_CUR) = 0
>
>
> IEEE Std 1003.1, 2004 says on dd skip and seek:
> skip=n
> Skip n input blocks (using the specified input block size) before
> starting to copy. On seekable files, the implementation shall read
> the blocks or seek past them; on non-seekable files, the blocks
> shall be read and the data shall be discarded.
now, thats fine, and a definite improvement on the dd tool :)
it has a long time been to stupid to do seeking on input files.
I'm too lazy to dig up the version numbers.
--
: Lars Ellenberg Tel +43-1-8178292-0 :
: LINBIT Information Technologies GmbH Fax +43-1-8178292-82 :
: Schoenbrunner Str. 244, A-1120 Vienna/Europe http://www.linbit.com :