Labels

lego (12) Linux (39) pi (20) Thinkpads (4)

Tuesday, 14 August 2012

SSD Efficiency: Moving .xsession-errors

The .xsession-errors file normally resides in your home directory and it gets written to very often.  There is very little purpose to this file, unless you are troubleshooting a particular X application.

For the sake of reducing writes to the hard drive (prevent waking a spinning disk, prolong the life of a SSD), I have tried to relocate the file to /tmp, which is a ramdisk.  I located the entry, ERRFILE, responsible for the file within /etc/X11/Xsession, and tried changing it,

from:

ERRFILE=$HOME/.xsession-errors
to:
ERRFILE=/tmp/.xsession-errors

However, the system keeps writing to a .xession-error file in the home directory (regardless if I delete this file or not, it gets regenerated).  The issue has persisted for weeks including after many reboots.

I came across this post http://ubuntuforums.org/showthread.php?t=1946716 which suggested making the file immutable by:


rm ~/.xsession-errors
touch ~/.xsession-errors
sudo chattr +i ~/.xsession-errors


I've done this, and now at least the file is not being written to, but likewise, there is no file generated in /tmp/.

I'll have to keep this for the time being and then remove the flag if I ever need to make use of the .xsession-errors file.

No comments:

Post a Comment