Create file for space Reserve


 
Thread Tools Search this Thread
Special Forums Hardware Filesystems, Disks and Memory Create file for space Reserve
# 1  
Old 01-22-2010
Question Create file for space Reserve

Hi All,

I want to make a 3GB of space reserve on Solaris. Let me know whether there is a way by creating empty file of 3GB so that i can delete that file in future to utilize that space. Or any other better ways for space reserve.

-Vinodh' Kumar
# 2  
Old 01-22-2010
the find command, du, and other command line tools can monitor space. I am not sure if filling up your HD with dummy files to take up space only to delete them later on is a good practice. Seems like a lot of work for something that can be accomplished in a better way.

What are your exact concerns?
# 3  
Old 01-22-2010
Yes exactly want to create dummy file and delete in future for space. I need to know the command to create empty file with specified amount of size.

Or any other workout to manage space.
# 4  
Old 01-22-2010
This is usually done by reigning in the size of a filesystem.
But you can create a sparse file:
Code:
dd if=/dev/zero of=sparsefile bs=1 count=1 seek=3G

This should take less than a second to create. But this is probably not what you want.
If you want to reserve space as contiguously as possible to be used later by a database, then you should not create a sparse file, but a dense file:
Code:
dd if=/dev/zero of=densefile bs=1M count=3072

This will take a lot longer to create, as it fills the entire file with zeroes.


Use caution with the dd command though. You should read the man page first to understand what it does and think twice before issuing a command as it is a very powerful command that can easily destroy things.
Not every dd understands G and M, but only k as a signifier. I that is the case then you should be able to use 1024k instead of 1M or 3145728k instead of 3G in the examples above.


If you create both files and you issue
Code:
ls -l *file

then you should see both files and they should have the same size.
Code:
du -k *file

will show the difference

S.

---------- Post updated at 09:22 ---------- Previous update was at 08:53 ----------

Since you are on Solaris. check out:
Code:
man mkfile


Last edited by Scrutinizer; 01-22-2010 at 04:29 AM..
# 5  
Old 01-22-2010
Code:
mkfile

command solved my problem.

Thank youSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Create the space only in the Third column by awk

Hi All , I am having an input file like this Input file r s e y Pin Numbers s n eppppppppppppppppppc ... (3 Replies)
Discussion started by: kshitij
3 Replies

2. Red Hat

No space in volume group. How to create a file system using existing logical volume

Hello Guys, I want to create a file system dedicated for an application installation. But there is no space in volume group to create a new logical volume. There is enough space in other logical volume which is being mounted on /var. I know we can use that logical volume and create a virtual... (2 Replies)
Discussion started by: vamshigvk475
2 Replies

3. Shell Programming and Scripting

Help needed to create a UNIX Space monitoring script

Hi All, Its urgent.. pls help me out.. I want to create a KSH which should generate a report with the list of users and the files larger than 5 GB created by them in a direcorty and send autogenerated e-mail to them. my input would be users list,directory path and the file size (say 5 GB) ... (11 Replies)
Discussion started by: anman0523
11 Replies

4. UNIX for Advanced & Expert Users

Reserve Ephemeral ports

my apps use port 40001; however, for example, firstly, I ftp to other server, it made a high port locally, remote is port 21, unfortunately, it hit my port 40001 and my apps is unable to startup. This chance is very very little, but I hit it. Can resevse my port 40001? otherwise command don't use it (5 Replies)
Discussion started by: goodbid
5 Replies

5. AIX

Reserve Ports

Hi I have a ticket to Reserve ports for SAS install in SAS servers. Does anyone knows the procedure how to do it. it will be helpful for me please Thanks in Advance (4 Replies)
Discussion started by: gulamibrahim
4 Replies

6. Solaris

Create user with Restricted Space usage

Hi, What is the command or how to create a user with the restricted usage of space on a disk. Also let me know how to change the limit of the space size allotted in future for the same user. ~Vinodh Kumar V M (3 Replies)
Discussion started by: vino_hymi
3 Replies

7. Linux

proper way to reserve ports in linux

How do you debug a perl script non interactively, similar to bash -x? (1 Reply)
Discussion started by: marcpascual
1 Replies

8. Solaris

Reserve Failed error for HD

Hi Guys, Anybody come across this error when formating a harddisk. "Reserved Failed" Supected hardisk failure, is my assumption correct. Thanks (5 Replies)
Discussion started by: bigmoon
5 Replies
Login or Register to Ask a Question