LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 9.1, dd is not working (http://www.linuxquestions.org/questions/slackware-14/slackware-9-1-dd-is-not-working-196296/)

Kocil 06-22-2004 05:17 AM

Slackware 9.1, dd is not working
 
Dear all.

I just upgraded my box from Slackware 9.0 to 9.1,
but this command does not work anymore.
dd if=/dev/zero of=root_fs bs=1M seek=100
It creates a very big file until no more space left on the harddisk.

I checked it, dd belongs to fileutils package on 9.0 but belongs to coreutils-5.0 on 9.1.
I have upgraded coreutils to 5.2.1, but the problem remains.

Could somebody confirm this ?
And it would be great if you give hints for the solution.

Thank you very much.

keefaz 06-22-2004 05:32 AM

did you try the 'conv=notrunc' option ?

wpyh 06-22-2004 09:26 AM

dd if=/dev/zero of=root_fs bs=1M seek=100

This command reads from /dev/zero, outputs to root_fs (in the current directory), but skips the first 100*1M in /dev/zero, all with a blocksize of 1M, until it reaches end-of-file. But _unfortunately_, there is no end of file for /dev/zero, because it's supposed to output an infinite amount of zeroes. That's why dd happily outputs zeroes to root_fs, and not stop until no more space is left on the mounted filesystem on which the root_fs resides.

To make it stop at a certain time, use the 'count' option. For example:

dd if=/dev/zero of=1M_file bs=1024 count=1024

Try it ;)

Kocil 06-22-2004 04:07 PM

Oops ...
I made mistake. Count is the keyword.
My reference said
dd if=/dev/zero of=1M_file bs=1M count=1 seek=100

I missed the count, but your example is better.

Thank you very much wpyh.

wpyh 06-22-2004 09:19 PM

;)

Btw, ketemu lagi di info... :P I guess this forum is english-only :P

Crashbox 06-23-2004 02:54 PM

this may be a dumb question, but why would you want to do this? i understand why you would need dd working, but why fill all remaining space with zeroes? my only thought is that it has something to do with swap space.....

-crash

Tinkster 06-23-2004 05:25 PM

For instance to create a crypto-loop device? :)


Cheers,
Tink

thegeekster 06-23-2004 08:42 PM

Quote:

Originally posted by Crashbox
this may be a dumb question, but why would you want to do this? i understand why you would need dd working, but why fill all remaining space with zeroes? my only thought is that it has something to do with swap space.....

-crash

The way I read Kocil's post is he only wants to zero out the file "root_fs", not zero out all the free space on the disk................this is a recommended procedure for making your own initrd image for a bootable rescue disk, after which you create an ext2 filesystem on it and mount it to a loop device to add the needed kernel image and files for booting.......... :)

Crashbox 06-23-2004 10:55 PM

tink & geek...thanks for the knowledge....now i need to do some research to figure out what a crypto-loop device is for.......

thegeekster 06-24-2004 03:16 PM

Start with this: Linux Encryption HOWTO

:)


All times are GMT -5. The time now is 04:24 AM.