[Xfce-bugs] [Bug 4369] New: XFCE, flash filesystems, and read only mounts

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Tue Sep 9 21:09:26 CEST 2008


http://bugzilla.xfce.org/show_bug.cgi?id=4369

           Summary: XFCE, flash filesystems, and read only mounts
           Product: Xfce
           Version: 4.4.2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: Medium
         Component: general
        AssignedTo: xfce-bugs at xfce.org
        ReportedBy: thekevinday at gmail.com


This is a bug and it is serious, but there is a lot to discuss and explain
here.
I am breaking this report into three segments, the first will be the
immediately fixable problem, the second will be a more detailed explanation of
why, how, and possible solutions, and the third is a summary.


-------
The Bug
-------
Problem:
Starting xfce on a read only system will result in xfce failing and/or taking a
_very_ long time to initialize the desktop.

Cause:
Xfce (and perhaps xorg) try to write to a particular users home directory to
place files, such as session data.
Xfce wants to depend on these files.
On a read-only system, these files do not get created and so a user cannot
"startxfce4".

Hack:
I had written a hack that allowed me to continue despite this problem.
(xfce4-session-4.4.2/xfce4-session/main.c, line 100), remove the exit.
But it's a hack and not a fix.
With the hack, I am able to continue into xfce, but the initialization is slow.

I need to be able to get into xfce under a read only home directory.


-----------
The Details
-----------
Problem:
XFCE is very handy to have for small (embedded) systems.
In particular, this leads into running a system of a USB stick or other NAND,
MMC, etc.. type devices.
All of these have a flaw: limited number of writes, even with wear-leveling.

The Flaw:
Xfce seems to have a design flaw in this regard.
There are places where Xfce performs write operations to the users home
directories.
As far as I can glance, this seems to be all over the place.
On a magnetic disk that does not have limited writes, this is not a problem.
Therefore, a quick solution or work around would be to boot a usb stick with
read-only on and only mount r/w when explicitly needed.
And so the said problem gets triggered.

Possible Solutions:
Compile in support for handling sessions when the session data cannot be
written to the effective disk.

Redesign how Xfce works in general to avoid writing to the effective disk as
much as possible.
- This can be implemented with a home directory config file option and/or a
compile time option if avoiding these writes is not ideal for seemingly
unlimited write systems.

Allow for xfce to store the session data elsewhere (ie:
/tmp/xfce4/username/session) which can be mounted as a tmpfs and will therefore
_not_ be on the flash disk.
- This also can be implemented with a home directory config and/or compile time
option
- I would prefer this last method as a user can then point this location back
to their home directory and still use the default/current approach
- Furthermore, a /home/username/xfcedata could be copied to
/tmp/xfce4/username/data for startup and then on logout/shutdown/reboot have
the files written back to the users home directory to preserve all changes made
while reducing writes to a minimum.


-------
Summary
-------
Xfce is not safe to run on flash filesystems which are common in embedded
environments.

Allow for read-only home directories would result in a quick fix/workaround.

The real problem can be fixed by implementing a hopefully end-user controlled
option of defining where and how the home directory data is to be stored so
that a single directory can be mounted tmpfs, allowing for a reduction of
writes to the flash device.

-- 
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Xfce-bugs mailing list