Pages

Monday, September 21, 2015

How to increase  the space of /tmp of unix

Purpose : Some times /tmp of unix will be full and it stops installation and working of some application
This will help you to increase the space of it

Steps :
1.unmount the current /tmp
2.Create new virtual drive
3.Mount it

Detailed Steps :

1. Check the current Status and mount point



[oracle@myserver ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda2            9.4G  3.1G  6.3G  33% /
/dev/xvda1             99M   13M   82M  13% /boot
tmpfs                 1.0G     0  1.0G   0% /dev/shm
/dev/xvdb              49G   33G   13G  72% /data



Here /tmp is tmpfs

2. unmount it



[root@myserver ~]# umount tmpfs



3. create new virtual drive of 2 GB



[root@myserver ~]#  dd if=/dev/zero of=/data/tmpDSK bs=1024k count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 23.1019 seconds, 93.0 MB/s




4.Format new drive



[root@myserver ~]#  mkfs -t ext3  /data/tmpDSK
mke2fs 1.39 (29-May-2006)
/data/tmpDSK is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
262144 inodes, 524288 blocks
26214 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
          32768, 98304, 163840, 229376, 294912

Writing inode tables: done                           
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.



5. Verify the drive



[root@myserver ~]# file /data/tmpDSK
/data/tmpDSK: Linux rev 1.0 ext3 filesystem data (large files)



6. Mount it



[root@myserver ~]# mount -o loop,noexec,nosuid,rw /data/tmpDSK /tmp



7.Provide the permission



[root@myserver ~]# chmod 1777 /tmp


No comments:

Post a Comment