Applies to: RamNode KVM VPS (all plans) running Linux (Ubuntu, Debian, CentOS, AlmaLinux, Rocky Linux). Use when SSH login fails due to disk-full conditions and you must use the RamNode Client Area console tools.
1. Understanding the Problem
When the root filesystem on a Linux VPS reaches 100% disk usage, the system enters a failure cascade that blocks most normal recovery paths:
- SSH connections are refused or immediately drop because
sshdcannot write to/var/runor/tmp - New processes cannot fork because the kernel has no room to write PID files
- Log rotation fails, making the problem compound silently
- Package managers lock up mid-operation, leaving broken state
- Databases (MySQL, PostgreSQL, Redis) crash or refuse writes
The result is a server that appears online from outside (ping responds, port 22 may even accept the TCP connection) but immediately terminates every session attempt.
Why this happens: The most common causes on RamNode KVM VPS instances: unrotated application logs filling /var/log, Docker overlay2 layer accumulation, large core dump files in /var/crash or /tmp, runaway database binary logs, and leftover package manager caches from abandoned apt/yum operations.
The RamNode client area provides two out-of-band access methods that bypass the broken SSH stack entirely: the VNC Console and Rescue Mode. This guide covers both, in order of speed and simplicity.
2. Accessing RamNode Out-of-Band Tools
Log in to the RamNode client area at my.ramnode.com. Navigate to Services → My Services and click the VPS that is down. From the VPS management page you have two tools available.
2.1 VNC Console (Fastest First Response)
The VNC console connects directly to the virtual machine's video output and keyboard, bypassing the network stack completely. The server does not need a working SSH daemon, open firewall ports, or even a healthy network configuration.
- In the RamNode client area, open your VPS management page.
- Click the Console button. A browser-based noVNC window opens.
- If the screen is black, press Enter or a letter key to wake the display.
- You will see either a login prompt, a kernel panic screen, or a frozen shell.
- Log in with your root credentials.
Console tips: The noVNC clipboard integration varies by browser. For pasting long commands, type them directly or use the noVNC clipboard panel (the left-edge pull tab). If the VNC console shows a kernel panic, proceed to Rescue Mode in Section 2.2 instead. VNC console sessions do not time out but the browser tab may lose focus and disconnect — keep the tab active.
2.2 Rescue Mode (When VNC Login Also Fails)
Rescue Mode boots a minimal, self-contained Linux environment that mounts your VPS disk as a secondary device. Your root partition is not the active OS, so you can delete files, run fsck, or resize the filesystem without lock contention.
- From the VPS management page, click Rescue Mode (or Boot into Rescue).
- Choose a rescue distribution if prompted. Debian or Ubuntu minimal are recommended.
- A temporary root password will be displayed. Copy it immediately — it is only shown once.
- Wait 60–90 seconds for the rescue kernel to boot.
- Connect via the VNC console using the temporary password.
- Your production disk will be visible as a block device, typically
/dev/vda1or/dev/sda1.
# Inside rescue mode -- find your production partition
lsblk
# Mount it (adjust device path from lsblk output)
mkdir -p /mnt/recovery
mount /dev/vda1 /mnt/recovery
# Verify the mount and check disk usage
df -h /mnt/recovery
du -sh /mnt/recovery/* | sort -rh | head -20Important: Do not mount the partition with write access if you suspect filesystem corruption. If df shows errors or mount complains about journal recovery, run fsck /dev/vda1 before mounting.
3. Emergency: Freeing Space via VNC Console
If you can log in via the VNC console (your OS is still running, just SSH is broken), work directly in the live system. The goal is to free enough space to restore SSH access, then do a full cleanup after.
# Confirm the partition is full
df -h /
# Find the top space consumers in /var (most common culprit)
du -sh /var/* 2>/dev/null | sort -rh | head -20
# Find the top space consumers across the entire filesystem
du -sh /* 2>/dev/null | sort -rh | head -20
# Find individual large files over 100MB
find / -xdev -type f -size +100M -printf '%s %p
' 2>/dev/null | sort -rn | head -203.1 Safe Emergency Deletions (Live System)
The following file categories are safe to delete without rebooting or affecting running services. Focus on these first.
| Category | Command | Notes |
|---|---|---|
| APT package cache | apt-get clean | Recoverable by re-running apt update |
| yum / dnf cache | dnf clean all | Packages re-downloaded on next install |
| Journal logs (keep 100MB) | journalctl --vacuum-size=100M | Does not affect syslog files |
| Old compressed logs | find /var/log -name '*.gz' -delete | Current .log files untouched |
| Temp files | find /tmp -type f -atime +1 -delete | Files not accessed in 1+ days |
| Cache files | find /root/.cache -type f -delete | Does not affect running processes |
| Core dump files | find /var/crash -type f -delete | Often gigabytes in size |
3.2 Truncating Runaway Log Files
Some processes hold an open file handle on a log file. Deleting the file removes the directory entry but does not release the disk space until the process closes its handle. Instead, truncate the file in place:
# Truncate a specific log file to zero bytes without deleting it
# (the process holding it open will continue writing from byte 0)
> /var/log/apache2/access.log
> /var/log/nginx/access.log
> /var/log/mysql/mysql-slow.log
# Find all log files over 500MB and list them before truncating
find /var/log -type f -size +500M
# Truncate all log files over 500MB in /var/log
find /var/log -type f -size +500M -exec truncate -s 0 {} ;3.3 Docker and Container Storage
Docker is one of the most aggressive disk consumers on VPS instances. If Docker is installed, its overlay2 storage can consume tens of gigabytes silently.
# Check total Docker disk usage
docker system df
# Remove stopped containers, dangling images, unused networks, build cache
docker system prune -f
# Also remove unused volumes (more aggressive -- confirm first)
docker system prune --volumes -f
# Remove all unused images, not just dangling ones
docker image prune -a -f
# Check containerd separately (used by some stacks without docker CLI)
du -sh /var/lib/containerdCaution: docker system prune -f is safe for stopped containers and dangling images. docker image prune -a will remove ALL images not currently used by a running container. Running containers are not affected, but you will need to pull images again to restart stopped services.
4. Emergency: Freeing Space via Rescue Mode
Use this path if the VNC console login also fails, the system is in a kernel panic, or you need to perform changes that require the filesystem to be unmounted. All paths below use /mnt/recovery as the mount point.
# Mount the production partition read-write
mount /dev/vda1 /mnt/recovery
# Navigate into it
cd /mnt/recovery
# Confirm space
df -h /mnt/recoverySafe Deletions from Rescue Mode
All paths are relative to /mnt/recovery (your production disk mount). Use full paths so you do not accidentally delete files in the rescue system:
# APT cache
rm -rf /mnt/recovery/var/cache/apt/archives/*.deb
# yum / dnf cache
rm -rf /mnt/recovery/var/cache/yum/*
rm -rf /mnt/recovery/var/cache/dnf/*
# Old compressed logs
find /mnt/recovery/var/log -name '*.gz' -delete
find /mnt/recovery/var/log -name '*.1' -delete
find /mnt/recovery/var/log -name '*.2' -delete
# Tmp files
find /mnt/recovery/tmp -type f -delete
find /mnt/recovery/var/tmp -type f -delete
# Core dumps
find /mnt/recovery/var/crash -type f -delete
find /mnt/recovery -name 'core.*' -type f -delete
# systemd journal
rm -rf /mnt/recovery/var/log/journal/*/
# Docker (if installed) -- removes all images and overlay data
# WARNING: requires Docker to be re-initialized on next boot
du -sh /mnt/recovery/var/lib/docker
rm -rf /mnt/recovery/var/lib/docker/overlay2/*
rm -rf /mnt/recovery/var/lib/docker/image/*Unmounting and Rebooting
# Confirm you now have free space
df -h /mnt/recovery
# Unmount cleanly
cd /
umount /mnt/recovery
# Reboot back to normal (from RamNode client area)
# Services > My Services > VPS > Boot / Reboot
# Or in rescue console:
rebootAfter the reboot, return to the RamNode client area and exit rescue mode if the panel does not do so automatically.
5. Restoring SSH Access After Freeing Space
With disk space freed and the server rebooted into its normal OS, SSH should resume accepting connections. If it does not, connect via the VNC console to check the SSH daemon:
# Check if sshd is running
systemctl status sshd
# If it failed, restart it
systemctl restart sshd
# Check for configuration errors from the disk-full incident
sshd -t
# Review sshd logs for clues
journalctl -u sshd --since '30 min ago'Common post-recovery issue: If sshd starts but SSH connections still hang, check whether /var/run/sshd exists as a directory. A full disk during boot may have prevented sshd from creating its runtime directory.
mkdir -p /var/run/sshd && chmod 755 /var/run/sshd && systemctl restart sshd6. Files Safe to Delete — Reference Table
✓ Safe to Delete
| Path / Pattern | What It Is | Safe? |
|---|---|---|
/var/cache/apt/archives/*.deb | Downloaded .deb packages | Yes |
/var/cache/yum/* or /var/cache/dnf/* | RPM package cache | Yes |
/var/log/**/*.gz | Compressed rotated log archives | Yes |
/var/log/**/*.1, *.2, *.3 | Numbered rotated log files | Yes |
/tmp/* | Temporary files | Yes |
/var/tmp/* (age >7 days) | Semi-persistent temp files | Yes |
/var/crash/* | Kernel and app crash dumps | Yes |
/root/.cache/* | Root user application cache | Yes |
/var/lib/docker/overlay2/* (prune) | Docker layer storage | Yes |
/var/log/journal/* (vacuum) | systemd journal binary logs | Yes |
/var/lib/snapd/cache/* | Snap package download cache | Yes |
✗ Files You Should NOT Delete
| Path | Why Not to Delete |
|---|---|
/etc/* | System configuration — deleting is catastrophic |
/var/lib/mysql/* or /var/lib/postgresql/* | Live database files — deletion destroys your data |
/var/lib/docker/volumes/* | Docker named volumes — may contain application data |
/home/* | User home directories and application files |
/var/log/auth.log (current) | Active security log — needed for sshd and PAM |
/var/lib/dpkg/* or /var/lib/rpm/* | Package manager state — breaks apt/yum permanently |
/boot/* | Kernel and bootloader — makes VPS unbootable |
7. Prevention: Keeping Your Root Partition Healthy
7.1 Monitor Disk Usage with Alerts
# Add to crontab (crontab -e) to alert at 80% usage
DISK_USAGE=$(df / | awk 'NR==2 {print $5}' | tr -d '%')
if [ "$DISK_USAGE" -gt 80 ]; then
echo "Disk at ${DISK_USAGE}% on $(hostname)" | mail -s "Disk Warning" you@example.com
fi7.2 Automate Log Rotation
Ensure logrotate is installed and running daily on your VPS:
# Verify logrotate is installed
which logrotate
# Run it manually to test
logrotate -d /etc/logrotate.conf
# Confirm the daily cron job exists
ls -la /etc/cron.daily/logrotate7.3 Automate Docker Cleanup
# Add to root crontab for weekly cleanup (Sundays at 3am)
0 3 * * 0 docker system prune -f >> /var/log/docker-prune.log 2>&17.4 RamNode Upgrade Options
If disk usage is consistently above 75% after cleanup, consider upgrading your RamNode plan. VPS disk upgrades are available without data loss through the RamNode client area under Services → Upgrade/Downgrade. Storage-only upgrades are available if you need more disk without additional CPU or RAM. Resizes complete within minutes and do not require a reinstall.
8. Quick Checklist
- Confirm the problem: run
df -h /from any available console. - Try VNC console login first via the RamNode client area.
- If VNC login works, run:
apt-get clean,journalctl --vacuum-size=100M,find /var/log -name '*.gz' -delete. - Check for runaway logs:
find /var/log -type f -size +100M. - Check Docker:
docker system df, thendocker system prune -f. - If VNC login fails, boot into Rescue Mode from the RamNode client area.
- In rescue mode, mount
/dev/vda1to/mnt/recoveryand repeat the deletions with full paths. - Unmount cleanly (
umount /mnt/recovery) and reboot back to normal mode. - Verify SSH access is restored; restart
sshdif needed. - Set up disk usage monitoring to prevent recurrence.
Need help?: If your VPS remains inaccessible after following this guide, open a support ticket at my.ramnode.com → Support → Submit Ticket. Include your VPS hostname, the rescue mode boot time, and the df output you collected.
