You are not logged in.

#1 2011-11-09 08:41:50

Jordanlw
Member
Registered: 2010-07-27
Posts: 44

DD, specify seek & skip in sectors while bs is 1MB

Hello,
here's the command I'm trying to run:

dd if=/dev/sda of=/dev/sda skip=578906112b seek=64b bs=1MB

The error message is:

dd: `/dev/sda': cannot skip: Invalid argument
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000105794 s, 0.0 kB/s

What I think is happening is it's multiplying seek & skip by 512*1MB rather than just 512.
Thanks.

Offline

#2 2011-11-09 08:56:20

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: DD, specify seek & skip in sectors while bs is 1MB

man dd wrote:

       bs=BYTES
              read and write up to BYTES bytes at a time
...
       skip=BLOCKS
              skip BLOCKS ibs-sized blocks at start of input
...     
       BLOCKS  and  BYTES  may be followed by the following multiplicative suffixes: c
       =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000,  M  =1024*1024,  xM  =M  GB
       =1000*1000*1000, G =1024*1024*1024, and so on for T, P, E, Z, Y.

I think 578906112b = 578906112*512*1MB.

Offline

#3 2011-11-09 10:44:42

Jordanlw
Member
Registered: 2010-07-27
Posts: 44

Re: DD, specify seek & skip in sectors while bs is 1MB

How do I get it so 578906112b is "578906112 multiplied by 512 bytes"?

Offline

#4 2011-11-09 10:49:14

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: DD, specify seek & skip in sectors while bs is 1MB

Jordanlw wrote:

How do I get it so 578906112b is "578906112 multiplied by 512 bytes"?

Have you tried

dd if=/dev/sda of=/dev/sda skip=578906112 seek=64b bs=512

? It's 'skip=578906112' (w/o the 'b') times 'bs=512'.

Offline

#5 2011-11-09 11:00:35

Jordanlw
Member
Registered: 2010-07-27
Posts: 44

Re: DD, specify seek & skip in sectors while bs is 1MB

That's what I started with, unfortunately it was too slow.

Offline

#6 2011-11-09 11:02:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: DD, specify seek & skip in sectors while bs is 1MB

Jordanlw wrote:

That's what I started with, unfortunately it was too slow.

Increase the bs to e.g 16MB and decrease skip accordingly.

Offline

#7 2011-11-09 12:31:27

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: DD, specify seek & skip in sectors while bs is 1MB

578906112 is divisible by 2048, and you actually want 512 times that, so you could drop the "b" and use skip=282669 bs=1048576 (which happens to be 1M).

However, *assuming* (it's not clear from your posts) that you want seek=64*512, you cannot use a bs bigger than 64*512=32768.

So I *think* that the best you can do is:
bs = 32768
skip = 578906112 * 512 / 32768 = 9045408
seek = 64*512/32768 = 1

dd if=/dev/sda of=/dev/sda skip=9045408 seek=1 bs=32768

But please take this with a grain of salt as I've never used skip or seek. A backup is recommended smile.

Offline

Board footer

Powered by FluxBB