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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Increase /tmp size 1

Status
Not open for further replies.

gallows

Technical User
Jun 12, 2004
223
US
I recently installed Solaris 9 using jumpstart. I had the profile set up to set up 3 partitions: swap - 4gb, /var 10gb and the rest went to root. Apparently /tmp partition is automatically created at 512k. I need to increase it to 4gb. The disk is 72gb, so root partition has plenty of space. Is there a way to increase the /tmp by stealing space from /root partition? I was thinking about doing something like:
mkdir /export/tmp
ln -s /export/tmp /tmp
Will this work? Is there a better or preferred way of increasing /tmp?
I am in the process of rebuilding another server to replace this one and am creating the /tmp along with the other filesystems but won't be able to bring it online anytime soon. Any help or advice is greatly appreciated.

Thanks,
gallows
 
/tmp should be the size of swap space. You should have an entries in /etc/vfstab that looks something like this.

/dev/dsk/c0t0d0s1 - - swap - no -
swap - /tmp tmpfs - yes -

These entries mount the swap space into /tmp.
 
Thanks for the reply bfitzmai. If I do the ln -s /export/tmp /tmp, wont't that mount the swap space into /tmp if I have the entries in vfstab that you described? I'm a little confused:))

gallows
 
No... You said you already have 4 GB of swap space alloted. Sounds like to me that swap is not set up correctly. If swap is 4GB then /tmp should be 4GB. Swap is /tmp and /var/tmp. If you do a df -k you should see the sizes of swap /tmp and /var tmp... They should be the same size. If not, you are mounting swap incorrectly.

Now you can add swap space using the swap command. You create a file using the "touch -m 50M <filename>" and swap -a <file name>. I think this is correct, will post the proper commands later today when I get to work. But, if swap isn't set up correctly, doing this will not help.

I have seen workstations with your problem... The person who installed the file system mounted swap as a ufs partition, not knowing swap should remain a raw partition. /tmp was only 512K.. When I looked in the vfstab file, I saw swap was mounted to a mount point /swap. Modifing the /etc/vfstab file to what I posted earlier, corrected the problem.
 
Thanks again bfitzmai. My vfstab has:
/dev/dsk/c1t0dos1 - - swap - no -
swap - /tmp tmpfs - yes size=512

df -lk
swap 5707336 24 5707312 1% /var/run
swap 524288 0 524288 0% /tmp
As you pointed out, swap and tmp should be the same size. This system was installed using Jumpstart. I saw the config file had swap set to 4000 (4gb). There was NOT a separate entry for /tmp. It looks like Solaris 9 created the /tmp automatically and at 512k. So, I want to increase /tmp to the same size as swap, 4gb.

thanks,
gallows
 
First try with bfitzmai suggestion in vfstab like,

swap - /tmp tmpfs - yes -

To add swap space from a file system.

#mkfile 40m /export/swapfile

This command will create a 40-megabyte file that can be used for swapping. Enable the new swap file with the swap command:

#swap -a /export/swapfile

Check your change;

# swap -l

swapfile dev swaplo blocks free
/dev/dsk/c0t1d0s1 32,9 8 614872 614872
/export/swapfile - 8 81912 81912


Now two swap areas are defined. Note that no major/minor device numbers are listed for a file system swap file.

To enable the new swap file at the next system boot, add the following entry to /etc/vfstab:

/export/swapfile - - swap - no -

The swap file will be added at boot time by /sbin/swapadd.

 
I won't get a chance until tomorrow to replace the size=512 with the - . Will I need to reboot after doing this?

Thanks,
gallows
 
Not sure if the command mountall will work... Give it a try if not, reboot.
 
You may need to reboot.
Take backup of vfstab file before making any changes.
 
It looks like my boss decided to leave everything as is and not to worry about it since the replacement server will be online fairly soon. I plan on still trying both suggestions, bfitzmai and bsek, and really appreciate your help. I will post back here with the results. It probably won't be any time soon.

gallows

 
I tried bfitzmai's suggestion of replacing the size with a - and it worked like a champ. Thanks bfitzmai and bsek for your help.

gallows
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top