4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
948
29
178
Hi guys, I wonder if you could possibly give me some advice here...

On one of our servers there have been problems writing to /tmp - errors saving session data coming up with "read-only" file system. No such errors on other parts of the drive.

So I forced a fsck on reboot - it checked everything and the server booted fine. I worked ok for 30 minutes then suddenly it happend again.

I repeated the process - same problem.

Obviously there is a bad sector on this drive or something. I will move all the accounts off the server to another one tomorrow - but in the interim, is there any way of removing the partition and recreating it so customers can get some functionality ?

Ive tried un-mounting it but as I expected its in use.

I can switch to single user mode on the server if someone could possibly give me some pointers?

Edit.... as a workaround I've just created a directory named /tmp2 and set the session save path in the php.ini to use that directory. Hopefully this will buy me some time until I can replace the drive.

The remaining problem still causes issues with webmail and other things so I'd be very grateful for any suggestions.
 
Last edited:

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
948
29
178
no, it isnt.

Before I take more drastic action, could someone possibly advise on how to remove and re-create /tmp and /var/tmp ? I'm not 100% sure on how to do it. I think it might just be some corruption with /usr/tmpDSK and I'd like to simply remove it and run /scripts/securetmp again to recreate it.
 
Last edited:

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
948
29
178
Extensive searching of the forums revealed this....

lsof /tmp

Then umount /tmp and /var/tmp:

umount -l /tmp
umount -l /var/tmp

Then remove the corrupt partition file:

rm -fv /usr/tmpDSK

Then create a nice new one:

/scripts/securetmp

Chirpy saves the day yet again!!! (hopefully)
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
Glad it helped ;)

The file-based disk mounts do seem to be vulnerable to corruption and I've often had the need to recreate them in the way described.
 

jols

Well-Known Member
Mar 13, 2004
1,107
3
168
Is is safe to do this with the /var partition? I believe my /var is starting to go.

Thanks for any help.