GNU bug report logs - #29259
tail does not seek to the end of block device

Previous Next

Package: coreutils;

Reported by: David Durham <daviddurham01 <at> gmail.com>

Date: Sat, 11 Nov 2017 20:30:02 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 29259 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: David Durham <daviddurham01 <at> gmail.com>, 29259 <at> debbugs.gnu.org
Subject: Re: bug#29259: tail does not seek to the end of block device
Date: Sun, 12 Nov 2017 21:50:29 -0800
On 11/11/17 12:08, David Durham wrote:
> sudo tail -c 1024 /dev/sda2 | hd  the entire /dev/sda2 device rather than
> seeking to the end. This takes a very long time with large disks. Deltik
> gives a nice explanation here -
> https://superuser.com/questions/1267402/how-do-i-tail-a-block-device-in-linux
> - of how ioctl can be used to obtain the size of a block device instead of
> fstat.
> 
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
> Virus-free.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> 

Yes maybe. The answer at the link shows how to do it efficiently with
the existing `dd` and `blockdev --getsize64` tools.
I also mentioned there the iflag=skip_bytes option which allows
one to efficiently skip portions of a disk independently from the I/O size.

Given dd is a more natural tool for dealing with device I/O,
and that processing the end of a device is an unusual use case,
I'm on the fence as to whether `tail` should handle this case specially.

cheers,
Pádraig




This bug report was last modified 6 years and 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.