The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

problem with tmp partition

Discussion in 'General Discussion' started by 4u123, Feb 18, 2008.

  1. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    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.
     
    #1 4u123, Feb 18, 2008
    Last edited: Feb 18, 2008
  2. nerbonne

    nerbonne Well-Known Member

    Joined:
    Aug 19, 2007
    Messages:
    52
    Likes Received:
    1
    Trophy Points:
    6
    Maybe the /tmp partition really is mounted as read only?
     
  3. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    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.
     
    #3 4u123, Feb 18, 2008
    Last edited: Feb 19, 2008
  4. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    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)
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    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.
     
  6. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    Is is safe to do this with the /var partition? I believe my /var is starting to go.

    Thanks for any help.
     
Loading...

Share This Page