Friday 8 March 2013

Change /tmp file system from ext3 to ext4


Change /tmp file system from ext3 to ext4

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvde1             48G  7.3G   38G  17% /
/securetmp            962M   18M  896M   2% /tmp

Check /securetmp file type to make sure whether its ext3 or not.
# file /securetmp
/securetmp: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)

Then unmount /tmp
# umount /tmp

Next format /securetmp to use ext4 file system
# mkfs.ext4 /securetmp

You can verify it by running file command.
# file /securetmp
/securetmp: Linux rev 1.0 ext4 filesystem data (extents) (large files) (huge files)

Edit ext3 to ext4 for /securetmp in /etc/fstab:
# /securetmp  /tmp ext3 loop,noexec,nosuid,rw 0 0 ====>  /securetmp  /tmp ext4 loop,noexec,nosuid,rw 0 0

Run mount -a to get fstab updated
# mount -a

Thats it. We're done.