Introduction
When attempting to restart a service or write to the system, you encounter a read-only filesystem error. After reviewing the server, you determine "/tmp" is read-only.
Description
When attempting to start or restart a service that requires access to "/tmp" you see the service fail to start or restart, causing a service failure. Other issues such as WHM access or PHP sessions may also encounter errors.
Procedure
Please Note that working with file systems can be a dangerous task. An experienced System Administrator should perform the steps below to minimize risk of damage to your server or file systems.
- Start by disabling "/tmp" from your "fstab". As root, open the following file with a command line text editor:
/etc/fstab
- Search for the entries that match "/tmp" and "/var/tmp", which should look something like this:
/usr/tmpDSK /tmp ext4 defaults 0 0
/tmp /var/tmp ext4 defaults,bind 0 0 - Edit the entries for "/tmp" and "/var/tmp" to add the "noauto" flag alongside the other flags, in the column with "defaults:"
/usr/tmpDSK /tmp ext4 defaults,noauto 0 0
/tmp /var/tmp ext4 defaults,bind,noauto 0 0 - Disable the securetmp service:
systemctl disable securetmp
- Reboot the server.
- Once the server comes back up, remove the old tmpDSK file:
mv -v /usr/tmpDSK{,.$( date +%Y%m%d )}
- Run securetmp to regenerate the tmpDSK file. Enter "y" at the prompts to confirm, enable and configure the boot option:
/scripts/securetmp
- Reboot the server once more to remount the /tmp partition
Comments
0 comments
Article is closed for comments.