Friday, March 26, 2010

/tmp read only

You can fix it without rebooting the server.

Here's how:

root@orchard [~]# umount /tmp
umount: /tmp: device is busy
umount: /tmp: device is busy
root@orchard [~]# umount -l /tmp (umount -l forces an umount, even if
it's busy)
root@orchard [~]# df -
root@orchard [~]# fsck -yf /dev/sda2 (y = answer yes to everything)
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/tmp1: recovering journal
Clearing orphaned inode 64 (uid=100, gid=101, mode=0100600, size=0)
Clearing orphaned inode 37 (uid=100, gid=101, mode=0100600, size=0)
Clearing orphaned inode 36 (uid=100, gid=101, mode=0100600, size=0)
Clearing orphaned inode 35 (uid=100, gid=101, mode=0100600, size=0)
Clearing orphaned inode 34 (uid=100, gid=101, mode=0100600, size=0)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Entry 'eaccelerator-3502.67023312' in /eaccelerator/6/0 (131177) has
deleted/unused inode 133882. Clear? yes

Pass 3: Checking directory connectivity
/lost+found not found. Create? yes

Pass 4: Checking reference counts
Pass 5: Checking group summary information

/tmp1: ***** FILE SYSTEM WAS MODIFIED *****
/tmp1: 3183/524288 files (1.8% non-contiguous), 75363/524120 blocks
root@orchard [~]# fsck -yf /dev/sda2 (run it a second time to double check)
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/tmp1: ***** FILE SYSTEM WAS MODIFIED *****
/tmp1: 3183/524288 files (1.8% non-contiguous), 75335/524120 blocks
root@orchard [~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 223G 35G 176G 17% /
/dev/sda1 190M 22M 159M 13% /boot
/dev/sdb1 231G 116G 104G 53% /backup
tmpfs 1014M 0 1014M 0% /dev/shm
root@orchard [~]# mount /dev/sda2 /tmp
root@orchard [~]# touch /tmp/hello
root@orchard [~]# all fine!

No comments:

Post a Comment