Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help !!! Need to fill a filesystem 1

Status
Not open for further replies.

drathbone

Technical User
Jun 11, 2001
39
GB
Hi,

I have a disk thats been newfs'd and I need to check if it's faulty or not.

Ideally I need to write a script to create a large file (about 4gb) and then delete it, and then loop the process.

Any ideas of the best way to create the large file ???


Many thanks,
Darren
 
Use mkfile.

* mkfile [ -nv ] size [ k | b | m ] filename

This would make a 4GB file called temp1:

>mkfile 4096m temp1
 
If you want to fill the file, you can use /dev/zero which contains an infinite number of zeroes.

You can use dd to copy from /dev/zero to your new files

e.g. dd if=/dev/zero of=myfile bs=blocksize count=number of blocks

set bs and count to suitable values to give you a 4gb file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top