1

First off, my intention is to create a portable, bootable USB drive containing a GNU/Linux distribution. Specifically, I want to use Arch Linux with a squashfs read-only root filesystem.

The squashfs image is based on a snapshot of a working VM. The base system with it's services like ssh work out of the box as expected. But when trying to launch gnome via systemd (systemctl start gdm), all I see is a black screen (supposedly the X-Server started but gdm fails to load). I already tried to figure out whats happening, but failed to identify the exact problem.

  • Home directories are writeable
  • /tmp is writeable
  • /var/log is writeable
  • /var/run & /run are writeable anyway

/var/log/gdm gets created but stays empty. Which modules may require write access to any other files? Is there any documentation? What would make sense to strace or similar?

My desire is to know the root of the problem and fix it, instead of using workarounds like unionfs. Thanks for any help or hints!

Although it's not relevant, for those who might wonder why I want to do this, here are some points to consider:

  • Stability - as you cannot modify system files, you cannot mess up the system (unless you write bogus directly to the drive of course)
  • Storage - as files are compressed, more data fits on the drive
  • Performance - as I/O on most USB drives is slow, compression gives you higher I/O speed
  • Portability - no special treatment for read-only storage, you might copy it on a CD or any other read-only technology and it will still work the same way as it would on a writeable disk

Update

I figured out that the problem was actually at /var/lib/gdm. GDM tried to access files in there an (silently) failed doing so giving me a black screen.

s1kam4n
  • 144
  • 8
  • I've been working on something similar in CentOS 7. I set `ro` for the root file system in `/etc/fstab` and `READONLY=yes` in `/etc/systemctl/readonly-root`. This works great for a minimalist, headless system, but logging in using GDM results in a black screen followed by the GDM log-in prompt again. I wish I could get a log of what file access was attempted so I could add it to `/etc/rwtab`. Does Arch Linux have the equivalent of `/etc/systemctl/readonly-root` ? – James Marble Dec 31 '14 at 21:13
  • This question appears to be off-topic and it is most suited for `unix.stackexchange.com`... – Am_I_Helpful Jan 05 '15 at 22:05
  • @MidoriKid I don't know weather Arch has an /etc/systemctl/readonly-root equivalent. But, as stated in the answer, I found a solution to the problem. You might want to have a look at journalctl(1) as this shows you the systemd log. Probably you need to connect via SSH to the box as I needed, because GDM seemed to freeze up the whole X-Server and I couldn't get back on a TTY. 'journalctl -f' gives you a live preview on the systemd log. One last thing to mention is if you are going to use NetworkManager, make sure /etc/NetworkManager/system-connections is also writable. – s1kam4n Jan 05 '15 at 22:16

1 Answers1

3

I figured out that the problem was actually at /var/lib/gdm. GDM tried to access files in there an (silently) failed doing so giving me a black screen.

journalctl was the debugging command i was missing in the first place.

s1kam4n
  • 144
  • 8