Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 446392 - sys-apps/coreutils-8.16: dd appears to restrict skip= to 32-bit values
Summary: sys-apps/coreutils-8.16: dd appears to restrict skip= to 32-bit values
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-07 20:32 UTC by Richard Yao (RETIRED)
Modified: 2012-12-19 19:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao (RETIRED) gentoo-dev 2012-12-07 20:32:56 UTC
I wanted to dump the first 16KB of L2 of ZFS on my disk to examine it when debugging a bootloader issue, but that failed with the following:

# dd if=/dev/sda1 of=/tmp/start bs=512 count=32 skip=240056884736
dd: ‘/dev/sda1’: cannot skip: Invalid argument
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000485126 s, 0.0 kB/s

I suspect that dd uses 32-bit values for the skip parameter.
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2012-12-07 21:09:49 UTC
As a workaround you can do:

# dd if=/dev/sda1 of=/tmp/tmp-start bs=32768 count=1 skip=3750888824
# dd if=/dev/tmp-start of=/dev/start bs=16384 count=1 

And of course try the current stable.
Comment 2 SpanKY gentoo-dev 2012-12-08 03:01:13 UTC
still happen in 8.20 ?

how about USE=gmp ?  (i don't remember if that affects dd ...)
Comment 3 SpanKY gentoo-dev 2012-12-19 19:23:47 UTC
can't reproduce w/8.20 on x86_64 or x86 system

x86_64 (64bit):
$ strace -e lseek dd if=/dev/zero of=/dev/null bs=512 count=32 skip=240056884736
lseek(0, 0, SEEK_CUR)                   = 0
lseek(0, 122909124984832, SEEK_CUR)     = 0
32+0 records in
32+0 records out
16384 bytes (16 kB) copied, 0.00341417 s, 4.8 MB/s
+++ exited with 0 +++

or on a real device:
# strace -e lseek dd if=/dev/md0 of=/dev/null bs=1 count=1 skip=240056884736
lseek(0, 0, SEEK_CUR)                   = 0
lseek(0, 240056884736, SEEK_CUR)        = 240056884736
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.0160826 s, 0.1 kB/s
+++ exited with 0 +++

x86 (32bit):
$ strace -e _llseek dd if=/dev/zero of=/dev/null bs=512 count=32 skip=240056884736
_llseek(0, 0, [0], SEEK_CUR)            = 0
_llseek(0, 122909124984832, [0], SEEK_CUR) = 0
32+0 records in
32+0 records out
16384 bytes (16 kB) copied, 0.0030879 s, 5.3 MB/s

or on a real device:
# strace -e _llseek dd if=/dev/md0 of=/dev/null bs=1 count=1 skip=240056884736
_llseek(0, 0, [0], SEEK_CUR)            = 0
_llseek(0, 240056884736, [240056884736], SEEK_CUR) = 0
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.000848877 s, 1.2 kB/s