Saturday, December 1, 2012

How to increase the temp partition in linux?

First kill the process which using the tmp directory and backup the tmp directroy.

# cp -prf /tmp /tmp.bak

Unmount the temp:

#umount /tmp

Create an 2GB filesize:


# dd if=/dev/zero of=/usr/tmpDSK bs=1024k count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 73.6908 seconds, 29.1 MB/s

# du -sch /usr/tmpDSK
2.1G /usr/tmpDSK
2.1G total

Make the file as ext3:

# mkfs.ext3 /usr/tmpDSK
mke2fs 1.39 (29-May-2006)
/usr/tmpDSK is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
262144 inodes, 524288 blocks
26214 blocks (5.00%) reserved for the super user
First data block=0
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

Check filesystem type:

# file /usr/tmpDSK

/usr/tmpDSK: Linux rev 1.0 ext3 filesystem data (large files)

Mount the new /tmp filesystem with noexec:

# mount -o loop,noexec,nosuid,rw /usr/tmpDSK /tmp

Set the permission for /tmp:


# install -d –mode=1777 /tmp
# ls -ld /tmp

No comments:

Post a Comment