I split my time on Unraid between two tools. VS Code for writing compose stacks, and the Unraid web UI for everything else: system settings, and poking around to see what it can do.
One day in August I was doing exactly that, editing compose stacks and switching in and out of the UI, when the UI stopped working. That was weird, because nothing else had. My dashboard still loaded and Beszel was still reporting, so the services were fine. What Beszel did show was unusually high RAM usage, which made no sense: I only had a few compose stacks running and barely any Community Applications installed.
This is the first server I’ve properly run, and it’s had more problems than joys so far. This was one of them.
/ lives in RAM
I put Claude Code on the diagnosis, and it found the cause in how Unraid is built. I knew Unraid boots from a USB stick into RAM. What I hadn’t put together is what that means for the root filesystem: / is rootfs, a RAM disk. So:
- anything written under
/rootuses RAM, not disk - all of it disappears on reboot
And my VS Code server was sitting right there.
What filled it
VS Code’s Remote-SSH installs a server into ~/.vscode-server. With extensions it’s about 2 GB, and it never cleans up old versions. On Unraid ~ is /root, so all of that was in RAM.
It had filled rootfs to 86%. To make room, Linux pushed out the cached copies of Unraid’s own system files, which live compressed on the USB stick. From then on, nginx and php-fpm (what serves the web UI) had to read from the stick every time they needed something. USB is slow, they piled up waiting, load hit 125, and the UI stopped responding.
I’d SSHed in from a terminal plenty of times before without any of this, which is why it caught me off guard. A plain SSH session doesn’t install anything. VS Code does.
I get why people stick to a terminal and vim for this kind of thing. But I like taking the easy route where I can, and I was still getting used to working on a remote machine, so losing the UI was a big deal.
Keeping state on a real disk
The fix Claude proposed: keep the files on the cache drive, and leave a symlink in /root pointing at them. I knew vaguely what symlinks were. This is what showed me how useful they are, and now I use them in nearly every config I build.
Unraid runs /boot/config/go on every boot, and /boot is the USB stick, so the script survives reboots:
# ~2 GB of server and extensions, and stale versions are never pruned
if [ ! -L /root/.vscode-server ]; then
rm -rf /root/.vscode-server
ln -s /mnt/cache/system/vscode-server /root/.vscode-server
fi
I did the same for Claude Code. Its settings and transcripts had already been wiped by a reboot once, back in July, and the CLI itself is 323 MB per version. Moving those freed up a good chunk of RAM too.
Linked from /root |
Lives on the cache at |
|---|---|
.vscode-server |
system/vscode-server/ |
.claude, .claude.json |
system/claude/ |
.local/bin, .local/share/claude |
system/claude/local/ |
Things that tripped me up
- The installer’s PATH line doesn’t survive. The Claude CLI installer adds itself to
~/.bashrc, but that file is on rootfs too. The boot script links the binary into/usr/local/bininstead, which is on the defaultPATHfor SSH, cron and User Scripts. - Link the folder the updater manages, not the version inside it.
~/.local/bin/claudeis a pointer the updater moves to each new version. Linking a specificversions/folder freezes you on that version. - Symlinks don’t need their target to exist yet.
goruns before the cache drive mounts, andln -sdoesn’t mind. - Everything on
/bootshows as600. It’s a FAT drive with fixed permissions. Unraid copiesgoelsewhere and makes it executable before running it, so that’s expected.
The rule
Anything on the Unraid host that keeps state, like an editor server, a CLI with a login, or a cache, needs this treatment. Otherwise it either fills your RAM or disappears on the next reboot.
RAM is still my bottleneck: most of my compose stacks are limited by how little I have. But at least it’s going to the stacks now, not to a VS Code server I forgot existed.