SlackwareThis Forum is for the discussion of Slackware Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Distribution: Slackware 9.1 but FUBAR with packages I compile myself, and OpenBSD (not exactly a distro) on QEMU
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:
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.....
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.....
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..........