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 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.
seek=n
Skip n blocks (using the specified output block size) from the
beginning of the output file before copying. On non-seekable files,
existing blocks shall be read and space from the current end-of-file
to the specified offset, if any, filled with null bytes; on seekable
files, the implementation shall seek to the specified offset or read
the blocks as described for non-seekable files.
--
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20070605/ec0f2aed/attachment.pgp>