Unix command to fill filesystem

I have been trying to fill all available file space on my Solaris box for my project but have not been successful. I have tried the following script:

tr '\0' '\060' < /dev/zero | dd of=zero2.txt bs=1024 count=1953125

But the only thing i get in return is this:
"d: bad numeric argument: "1953125

Any assistance would be greatly appreciated.


#mkfile [size you want]m  zero2.txt
mkfile 20m somefilename

On linux

#dd if=/dev/zero of=myfilename bs=1024  count=[number of kbytes you want]
dd if=/dev/zero of=somefilename bs=1024 count=100

Thanks i tried your solution and this is what I see:

ipsecesp ptypf rsd1c sd4f ttyp7 zero
ipstate ptyq0 rsd1d sd4g ttyp8 zero1.txt
ipsync ptyq1 rsd1e sd4h ttyp9 zero2.txt
kbd ptyq2 rsd1f sd5a ttypa zfs
keysock ptyq3 rsd1g sd5b ttypb
kmdb ptyq4 rsd1h sd5c ttypc
kmem ptyq5 rsd4a sd5d ttypd
# dd if=/dev/zero of=zero2.txt bs=1024 count=100
dd: dev/zero: open: No such file or directory
#
#

Please note the red slash in your post.... my typo caused this for you. sorry.

OK you are correct that fixed it so if I want to Fill the free space of the subject filesystems with all zeros by creating a series of 2 gigabyte files until the filesystems are full would be this then?

tr '\0' '\060' < dd if=/dev/zero of=zero2.txt bs=1024 count=1000000

Why do you need \060 as the character? - what you gave does not work.

Just use mkfile: it acutally allocates files and fills the disk - this is what it was designed for.

Should you really need to fill with '\060' (a.k.a. '0') instead of nulls, you can use:

dd if=/dev/zero  bs=1024 count=1000000 | tr '\0' '0' > zero2.txt

If you don't mind what is in the file. This outputs the letter "y" at an alarming rate:

yes > bigfile.txt

Deducing the free space, then running "mkfile" is the better approach.

And if you want a really big file that does not fill the file system:

$ mkfile -n 9223372036854775807 wtf
$ ls -l wtf
-rw-------   1 jlliagre staff    9223372036854775807 Dec  1 23:15 wtf
$ ls -lh wtf
-rw-------   1 jlliagre staff       8.0E Dec  1 23:15 wtf