tag:blogger.com,1999:blog-2474579806767004724.post587521860796573368..comments2023-09-03T12:22:36.756+04:00Comments on Linux / Aix Administration - Tips & Stuff: Creating large empty files in Linux / UNIXAnonymoushttp://www.blogger.com/profile/06075017084210151388noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-2474579806767004724.post-32055236810081698662010-12-26T04:27:16.861+04:002010-12-26T04:27:16.861+04:00You can create an empty file with dd by using the ...You can create an empty file with dd by using the seek option with a count of 0.<br />E.g. to create a 1G file use<br />dd if=/dev/zero of=disk.img bs=1 count=0 seek=1GIndienoreply@blogger.comtag:blogger.com,1999:blog-2474579806767004724.post-35469445104504091982010-11-17T08:09:24.137+04:002010-11-17T08:09:24.137+04:00i woul also like to point out ..
if you need to cr...i woul also like to point out ..<br />if you need to create large files inside of a virtual machine anon's<br />post <br /><br />"truncate -s M 10 output.file<br />It creates a 10 MB file... instantaneously" <br />would be the best option primeraly due to the reduced Read/Write speeds that virtual machines "annoyingly" possess i create many 100s of these "large files" on daily basis when creating raw HD images within my virtual cloud . all running debian one of these VM's can create 30-40 50gb files in almost no time at allAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474579806767004724.post-22011565139488397442010-08-20T16:07:02.318+04:002010-08-20T16:07:02.318+04:00If you don't want to wait an hour with dd, try...If you don't want to wait an hour with dd, try this :<br /><br />truncate -s M 10 output.file<br />It creates a 10 MB file... instantaneously<br /><br />(M stands for 1024*1024 bytes, MB stands for 1000*1000)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474579806767004724.post-70702728811507409852009-11-25T19:02:19.509+04:002009-11-25T19:02:19.509+04:00@Kenga - I'm not aware of a method to do what ...@Kenga - I'm not aware of a method to do what you are asking, but I'm not saying it does not exist.<br /><br />You could try to DD it once on the host, then use your storage system to snap the volume and clone it however many times over. Seems that would be faster likely.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474579806767004724.post-60388703001435065302009-11-25T12:15:31.554+04:002009-11-25T12:15:31.554+04:00Josh,
"I need to just allocate space without...Josh,<br /><br />"I need to just allocate space without actually writing anything to that file." This means that I don't want be smoking all the time 200Gb of zeros are beeing written to the disk by dd. <br /><br />What if I need to make 10 500Gb chunks on my storage???? I should go smokin for an 24 hours?Kenga Ruhttps://www.blogger.com/profile/05136991987066015709noreply@blogger.comtag:blogger.com,1999:blog-2474579806767004724.post-41622407646154836152009-11-24T20:44:59.336+04:002009-11-24T20:44:59.336+04:00@Kenga the same procedure listed in the article sh...@Kenga the same procedure listed in the article should work for SUSE as well. Did you try the dd command?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2474579806767004724.post-51188438251101555332009-11-24T14:43:31.280+04:002009-11-24T14:43:31.280+04:00Is there any way to create large file on SUSE Linu...Is there any way to create large file on SUSE Linux Enterprise Server 10 in the same way the Solaris utility mkfile do?<br /><br />I need to just allocate space without actually writing anything to that file.Kenga Ruhttps://www.blogger.com/profile/05136991987066015709noreply@blogger.comtag:blogger.com,1999:blog-2474579806767004724.post-24573019330572066832009-01-22T15:25:00.000+04:002009-01-22T15:25:00.000+04:00or for easiness 'bs' can be specified in 'MB' i.e...or for easiness 'bs' can be specified in 'MB' i.e... bs=1M or what ever the requirement is, so for creating 1 GB file [dd if=/dev/zero of=testfile bs=1M count=1024]Naveenhttps://www.blogger.com/profile/07521840696271741807noreply@blogger.comtag:blogger.com,1999:blog-2474579806767004724.post-68030236215605551822008-12-12T20:33:00.000+04:002008-12-12T20:33:00.000+04:00I believe your count size is wrong. A 1GB file sh...I believe your count size is wrong. A 1GB file should have a count of 1024000 with a block size of 1024, i.e. bs=1024 count=1024000.Anonymousnoreply@blogger.com