Operating System - Linux
1819804 Members
3268 Online
109607 Solutions
New Discussion юеВ

Not able to write in /tmp file system in Redhat Linux

 
Gaby1110
Frequent Advisor

Not able to write in /tmp file system in Redhat Linux

Hi,

I am not able to write anything on /tmp file system . Please find below the details and pls help me to resolve this issue.

[root@/]# touch /tmp/test1
touch: cannot touch `/tmp/test1': Read-only file system
[root@/]# cd /
[root@ /]# su oracle
$ touch /tmp/test
touch: cannot touch `/tmp/test': Read-only file system
$
-----------
Permissions on /tmp
drwxrwxrwt 8 root root 4096 Sep 7 04:02 tmp
------------

[root@/]# mount |grep -i /tmp
/dev/mapper/vg00-tmp on /tmp type ext3 (rw)
[root@/]#
---
[root@tmp]# pwd
/tmp
[root@ tmp]# ls -ltr
total 24
drwx------ 2 root root 16384 Jul 20 2007 lost+found
drwx------ 2 root root 4096 Jan 15 2008 keyring-F0dxnI
srwxr-xr-x 1 root root 0 Jan 15 2008 mapping-root
drwxr----- 2 oragrid dba 4096 Aug 29 14:53 hsperfdata_oragrid
[root@ tmp]#

Thanks in advance
Gaby
2 REPLIES 2
Hakki Aydin Ucar
Honored Contributor

Re: Not able to write in /tmp file system in Redhat Linux

issue
df -k /tmp

check system logs for /tmp file system error

grep -i -E "/tmp|file system error" /var/adm/syslog
Matti_Kurkela
Honored Contributor

Re: Not able to write in /tmp file system in Redhat Linux

Your "mount | grep -i /tmp" is essentially the same as "grep -i /tmp /etc/mtab". Its output reflects the options used when the filesystem was mounted (or remounted).

To get up-to-the-second current data, look into /proc/mounts. I'll bet you find the /tmp filesystem now has the "ro" option.

If there is an error accessing the filesystem, the default action of Linux is to set the filesystem to read-only mode. With the proper mount options, you can change this action.

The alternatives are causing a system panic (if you absolutely, positively must be sure that the data in your filesystem is correct and are willing to suffer the downtime to fix it ASAP if it isn't) or to ignore the error (if you're more concerned about uptime than the correctness of your data, e.g. real-time video playback).

You will probably find that you have experienced a disk error on the /tmp filesystem, which caused Linux to mark it read-only. The only way to mount the filesystem normally again is to unmount the filesystem, run a filesystem check on it and then mount it again. If you reboot the system, this will happen automatically.

Now is a good time to make extra sure your backups are up to date. Your disk is probably about to fail. It was lucky that the error happened on the /tmp filesystem and not on anything more critical: count your blessings.
Check the kernel message buffer with "dmesg": you will probably see some disk errors. You might also use the "smartctl" command to check the disk's internal diagnostics, if your LVM PV is an ordinary IDE or SCSI disk.

If your LVM PV is supposed to be a RAID1 mirror set, you've probably already missed the total failure of the first disk. The fact that the error became visible to the OS indicates that the second disk of the set is about to fail too. Lesson learned: mirroring is good, but you should monitor the health of your mirrors!

MK
MK