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

Disk Space

Status
Not open for further replies.

071

MIS
Aug 9, 2000
153
0
0
Hello,

I would like to create more disk space in /tmp.

Can this be achived by creating a swap file ? There is already a swap file in this directory which seems to be taking up a lot of space ?

drwx------ 2 root root 8192 May 12 2004 lost+found
-rw------- 1 root root 3928 May 12 2004 rpcbind.file
-rw------- 1 root root 764 May 12 2004 portmap.file
-rw-r--r-- 1 root root 127 May 12 2004 sdt_fl.PaGGb
-rw-r--r-- 1 root root 127 May 12 2004 sdt_flFOaO5j
drwx------ 3 oracle oracle 512 May 13 2004 fcgi_24736
-rw------T 1 root other 524288000 Jun 27 2005 swap
drwxr-xr-x 2 root other 512 Jul 23 16:12 hsperfdata_root

Thanks in advance.

Cheers,
71
 
You've got the right general idea.

Put the swap file in a different filesystem though. Here's a procedure that I created back when dinosaurs roamed the earth. It should still work for you.

Procedure to add swap space on a computer. Must be done as root.

First, determine the partition that you want to add the additional swap space
to. You can see the size of the local partions by typing in:
df -k -Fufs

Create a directory on the partition that you want.
mkdir /export/swap-directory

Create a file using the mkfile command in that directory. This example adds
50 MB.
mkfile 50m /export/swap-directory/swap-file

Add the created file to the system's swap space.
swap -a /export/swap-directory/swap-file

To permanently add this 50 MB swap file to swap space, you must modify the
/etc/vfstab and add this line:
/export/swap-directory/swap-file - - swap - no -
This will allow the system to see the added swap space after reboot.
 
Thanks Spamly,

Tried that but when I check the file system I can't see any difference to /tmp ?

Here's the commands that I used...

#mkdir /space/swap-dir
#mkfile 100m /space/swap-dir/swap
#swap -a /space/swap-dir/swapfile

#df -h

/dev/dsk/c0t0d0s0 5.8G 2.2G 3.5G 40% /
/proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
fd 0K 0K 0K 0% /dev/fd
swap 1.5G 40K 1.5G 1% /var/run
/dev/dsk/c0t1d0s5 8.4G 1.1G 7.2G 14% /space
/dev/dsk/c0t0d0s5 649M 500M 90M 85% /tmp
/dev/dsk/c0t0d0s4 1.9G 121M 1.7G 7% /export/home


Many thanks.


Cheers,
71
 
Interesting.

What does your /etc/vfstab for the standard swap/tmp entry look like?

It looks like you're explicitly mounting up c0t0d0s5 under /tmp. This wouldn't be the same as swap space. /tmp and swap usually share the same space, but don't really have to. It doesn't look like your system is setup this way.

Here's an example "df -h | grep swap" and /etc/vfstab from one of my servers:
Code:
swap                   4.2G   312K   4.2G     1%    /tmp
swap                   4.2G    48K   4.2G     1%    /var/run
mysystem:/root>cat /etc/vfstab
#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/md/dsk/d1  -       -       swap    -       no      -
/dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      logging
/devices        -       /devices        devfs   -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -
As you can see, I'm defining swap at the d1 partition (c0t0d0s1). Later, I'm mounting it up as /tmp.
 
Hi Spamly,

Here's a copy of the vfstab.

#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /export/home ufs 2 yes -
/dev/dsk/c0t1d0s5 /dev/rdsk/c0t1d0s5 /space ufs 2 yes -
/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /tmp ufs 2 yes -

Thanks.

Cheers,
71
 
That's something. I'm assuming that your swap space is just composed of your physical memory then (well, that and the swap files that you just added).

What this means for you is that adding swap files will not increase the size of your /tmp filesystem. It is treated just like any other ufs partition.

You may want to consider moving the existing swap file from this filesystem to a different one. Be sure your system is not using it and remember to deconfigure the swap file first before moving it or you'll be in trouble.
 
Problem solved Spamly,

It was using the new swap file on /space so I deleted the old one.

Thanks again for all your advice.


Cheers,
71
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top