The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
allocate more space to /home mcraul UNIX for Dummies Questions & Answers 2 05-03-2008 03:56 AM
swap space manoj.solaris Linux 1 08-22-2007 03:11 AM
How to re-allocate disk space on solaris 10 duke0001 UNIX for Advanced & Expert Users 2 12-13-2006 07:14 AM
swap space / paging space aaronh AIX 2 05-19-2004 07:06 AM
pageing space vs swap space VeroL UNIX for Dummies Questions & Answers 1 01-22-2004 07:54 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-01-2008
Registered User
 

Join Date: Jan 2008
Posts: 183
How to allocate swap space?

Hi all,

I would like to know how i can mount swap on /tmp at boot time,
I mean even before the actual script that does the mounting kicks in?
i tried this
mount -F tmpfs swap /tmp
(nothing happens it just hangs during the booting)

I also tried this
/usr/lib/fs/tmpfs/mount swap /tmp
(says mount not allowed for this FSType)

Thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-01-2008
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,103
You didn't mention which OS you are working on, but on the systems i know you cannot "mount" a swapspace at all! To "mount" means "to make part of the filesystem hierarchy" and swap space is neither part of this hierarchy nor intended to be. To mount anything there would have to be a filesystem on it but a swapspace is a raw device. There is now FS on it at all.

There is a feature in Linux where swapspace can be allocated in the filesystem by creating a "swap file" (like it is the case in Windoze systems), but this is somewhat a stretch to the concept of swap: Basically it means to first create a file to set aside space, emulate a sort-of logical volume (~= partition) on it (similar to the "drives" files in VMware) and then use this pseudo-partition as a swapspace. Still, this is EMULATION all over and doesn't change the original concept: swap space is not to be mounted.

The reason why "mount -F" will hang at boot time is simple: you force the mount so the system will not continue if the mount fails. As this mounting attempt must fail it will definitely hang.

I hope this helps.

bakunin
Reply With Quote
  #3 (permalink)  
Old 05-01-2008
Registered User
 

Join Date: Jan 2008
Posts: 183
I am using opensolaris.
Can you help me figure it out now?
By mounting i mean..
trying to mount swap on /tmp at a earlier stage than its default script.
The whole point is that i need 2 lib files to reside in /tmp at a very early stage in the boot..
This is not happening because these files have combined size of 600mb...
This amount of ram is not allocated when the script where i want to copy 2 files to the ram is executed...

so i thought of explicitly mounting swap so that i get the whole ram at this point iteself(i'm having 2gb ram).

Can you please help!
Reply With Quote
  #4 (permalink)  
Old 05-01-2008
Registered User
 

Join Date: May 2008
Posts: 4
Example:
How to Add More Swap Space without Repartitioning the Disk


To add more swap space, perform the following steps:

Become superuser.

Create a directory for the swap file, if needed—for example:

mkdir /moreswap

Create the swap file by using the mkfile command, which has the following syntax:

mkfile <number> [k|b|m] <filename>

The <number> specifies the file size in KB, bytes, or MB specified by k, b, or m. For example, to create 500MB swap space, issue the following command:

mkfile 500m /moreswap/swapFile

Activate the swap file by carrying on the same example:

# /usr/sbin/swap -a /moreswap/swapFile

You must use the absolute path name to specify the swap file. The swap file is now added, and activated. It is available until the file system is unmounted, the system is rebooted, or the swap file is removed. The swap file will be automatically activated each time the system is booted, if you perform the next step.

Add the following entry for the swap file to the /etc/vfstab file, again using the running example:

/moreswap/swapFile - - swap - no -

Issue the following command to verify that the swap file has actually been added:

/usr/sbin/swap -l
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0