You are not logged in.

#1 2014-03-26 23:19:28

kruuth
Member
Registered: 2014-03-23
Posts: 15

Xorg and r/o file systems

I'm building a small video player for my kids, and it's got a hard on/off switch.  Since the whole thing is booting off a small CF card, and since the device isn't doing anything but executing a single program in xorg, I'd like to just keep everything read only so it won't do a FS check every time it's flipped on.  Unfortunately I haven't done much with X like this.  When I do it now, I get errors about locking the .Xauthority file, and also for moving the log around.  Does anyone have suggestions on how to run xorg in a read only setup like this?

Offline

#2 2014-03-30 03:32:42

kruuth
Member
Registered: 2014-03-23
Posts: 15

Re: Xorg and r/o file systems

Well, I figured this out.  I'm mounting /var as tmpfs type and this fixed it.  THanks for the help?

Offline

#3 2014-03-30 09:28:50

Blµb
Member
Registered: 2008-02-10
Posts: 224

Re: Xorg and r/o file systems

Mounting the entire /var as tmpfs might be a bit overkill as /var contains a bunch of other files as well. You could change your xserverrc to pass the `-logfile` option to X to have it put its logfiles in /tmp instead.
(Also you could try setting the XAUTHORITY env var if you want to actually use xauth, and have the Xauthority file created in /tmp as well. But I don't think you need to bother with that at all in your setup.)

Last edited by Blµb (2014-03-30 09:30:27)


You know you're paranoid when you start thinking random letters while typing a password.
A good post about vim
Python has no multithreading.

Offline

#4 2014-05-14 19:51:19

kruuth
Member
Registered: 2014-03-23
Posts: 15

Re: Xorg and r/o file systems

Not done much with X before Blµb.  Is there some documentation on how to do that?

Offline

#5 2014-05-15 13:03:08

kruuth
Member
Registered: 2014-03-23
Posts: 15

Re: Xorg and r/o file systems

So far no luck.  I mapped /var/log to a tmpfs but modifying .xinitrc to write to /tmp doesn't seem to work.  When I use the tmpfs option X will start but all I get is a black screen without mouse.

Offline

#6 2014-05-15 13:15:44

Kartious
Member
From: UK
Registered: 2013-03-23
Posts: 311

Re: Xorg and r/o file systems

can you post your:

uname -a
xorg.log
fstab
lsblk -f
xorg.conf

Offline

#7 2014-05-15 13:44:39

kruuth
Member
Registered: 2014-03-23
Posts: 15

Re: Xorg and r/o file systems

Sure:

uname -a:

Linux localhost 3.14.1-1-ARCH #1 SMP PREEMPT Mon Apr 14 21:01:08 CEST 2014 i686 GNU/Linux

xorg: http://pastebin.com/B4P0dhfu

fstab:

/dev/sda1               /             ext2          ro,relatime    0 1
tempfs             /var/log    tmpfs        nodev,nosuid,size=4M 0 0
tempfs            /arcade        tmpfs        nodev,nosuid,size=1M 0 0

lsblk:

NAME   FSTYPE  LABEL  UUID                                 MOUNTPOINT
sda                                                        
|-sda1 ext2           6b134659-ca83-4572-bb59-35dfa9d6b1a5 /
`-sda2 vfat           FE7A-5F5B

I don't think there's an xorg.conf.

Last edited by kruuth (2014-05-15 17:43:04)

Offline

#8 2014-05-15 14:38:16

Kartious
Member
From: UK
Registered: 2013-03-23
Posts: 311

Re: Xorg and r/o file systems

Could you put that in code tags as per the Etiquette

Offline

#9 2014-05-15 17:43:23

kruuth
Member
Registered: 2014-03-23
Posts: 15

Re: Xorg and r/o file systems

Fixed.  Sorry.  Been a loooong day.

Offline

#10 2014-05-16 07:33:48

Kartious
Member
From: UK
Registered: 2013-03-23
Posts: 311

Re: Xorg and r/o file systems

Okay, what sort of device are you using ? Is it a Raspberry Pi sort of system or is it a PC? Just curious really. Also if you would like to stop the fsck then all you need to do is to edit your Fstab like this.

/dev/sda1               /             ext2          ro,relatime    0 0

I also would change the labelling of /dev/sda1 to a UUID which you can find out with lsblk -f so it would be like


 UUID=<partition root UUID number>            /             ext2          ro,relatime    0 0 

Also I would update your system 3.14.4-1 is out in the repos now as well.

finally for now your Xorg.log says the server has terminated successfully which means that It has done the job it needs to do. If there is an error or problem you would get an error message at the end.

[   433.051] (EE) Server terminated successfully (0). Closing log file. 

So the question is, what exactly you want xorg to do, I know you said to run a simple program as a media player but is that a straight executed program ? or do you wanted to load a WM like openbox which then loads the program ? You should post your ~/.xinitrc

Edit :: Also any reason why the mounts on your tmpfs is so small ?

tempfs             /var/log    tmpfs        nodev,nosuid,size=4M 0 0
tempfs            /arcade        tmpfs        nodev,nosuid,size=1M 0 0

Last edited by Kartious (2014-05-16 07:58:10)

Offline

#11 2014-10-22 05:50:12

mhtrinh
Member
Registered: 2010-10-06
Posts: 19

Re: Xorg and r/o file systems

(hope this is not considered as necro post ...)

I have the same problem. I am using : Cubieboard2. I am trying to make the filesystem (that sit on a USB flash drive) read only.
When the root fs is read-only, somehow the Xserver and stop. I can only do a ssh to it. I don't know what stop/kill the Xserver. Failed to create some file somewhere ???
When the root fs is read/write, everything work fine, it boot to Xserver and stay there.

Is it related to Xauthority file ? In my user account .bashrc and .profile, I put :
export XAUTHORITY="/tmp/.Xauthority"

(/tmp is mounted as tmpfs)

PS: I use cubian distro, which is a bit different than Arch but the basic still the same ... Anybody have an idea why Xserver die ?

Offline

#12 2014-10-22 05:54:20

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Xorg and r/o file systems


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB