S
S
Sergey Karbivnichy2015-01-03 13:17:23
linux
Sergey Karbivnichy, 2015-01-03 13:17:23

DD - Is it possible to write zeros to a partition starting at a certain offset?

Is it possible to fill a partition with zeros using dd in linux, starting from 250 gigabytes. The disc itself is 500.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Melkij, 2015-01-03
@melkij

man dd
seek

R
Rsa97, 2015-01-03
@Rsa97

# man dd
...
seek=n   Seek n blocks from the beginning of the output before copying.
         On non-tape devices, an lseek(2) operation is used.  Otherwise,
         existing blocks are read and the data discarded.  If the user
         does not have read permission for the tape, it is positioned
         using the tape ioctl(2) function calls.  If the seek operation
         is past the end of file, space from the current end of file to
         the specified offset is filled with blocks of NUL bytes.
...

D
Dmitry, 2015-01-03
@EvilsInterrupt

You need to:
1. Use the /dev/zerooos/ device - I deliberately wrote it with an error so as not to discourage the study of the system, but there is still a hint!
2. You need the dd parameter that specifies the block size
3. You need the dd parameter that specifies the output device
4. You need the dd parameter that specifies the seek position in the output device, expressed in size, taking into account point 2

A
Alexey Shumkin, 2015-01-03
@ashumkin

Hmm. It's easier for someone to write a question and wait for an answer on the Toaster than to read man dd*facepalm*

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question