This content originally appeared on DEV Community and was authored by Farzan Afringan
How to Rescue a Broken Ubuntu System
When your Ubuntu system fails to boot or gets stuck on a black screen, it can feel like a free fall from a tower. Panic sets in — but don’t worry. Ubuntu almost always has a way back if you know the right steps. This guide provides practical solutions to common boot failures and a ready-made Ubuntu Survival Kit to prepare for the future.
Common Disaster Scenarios
1. Broken fstab
A misconfigured /etc/fstab
file can prevent the system from booting, dropping you into emergency mode.
Symptoms:
- System hangs during boot.
- Error messages referencing
fstab
.
2. NVIDIA Driver / Graphics Issues
NVIDIA drivers are a common cause of black screens or failing to reach the desktop environment.
Symptoms:
- Black screen after GRUB.
- Only TTY (Ctrl+Alt+F3) login works.
3. Forgotten Password
If you forget your login password, Ubuntu will not let you in — but you can reset it from GRUB.
Symptoms:
- Login prompt rejects password.
4. Disk or SSD Errors
Hardware issues can mimic software problems. Checking drive health ensures the problem isn’t physical.
Symptoms:
- Random freezes or crashes.
- Slow boot or I/O errors.
Before You Start: Boot Options
If your Ubuntu doesn’t reach the desktop, you have two main ways to gain access:
-
Try TTY Console: Press
Ctrl + Alt + F3
to switch into a text login. From there you can run commands and start fixing issues. -
Use a Live USB (Recommended if TTY fails): Boot from a USB stick with Ubuntu and choose “Try Ubuntu without installing”. This provides a safe desktop environment to access your files, edit configs (like
/etc/fstab
), or reinstall GPU drivers from outside the broken system.
Think of a Live USB as handing your Ubuntu a fresh pair of eyes — it can “see” and fix things when your installed system is blind.
Step-by-Step Fixes
Fixing fstab Safely
- Boot into recovery or emergency mode.
- Switch to a shell (Ctrl+Alt+F3).
- Edit the fstab file:
sudo nano /etc/fstab
- Comment out suspicious lines (add
#
at the beginning). - Always test changes before reboot:
sudo mount -a
If no errors appear, reboot safely.
Recovering from Black Screen (NVIDIA)
- Switch to TTY:
Ctrl+Alt+F3
. - Restart the display manager:
sudo systemctl restart gdm
- If it fails, remove NVIDIA drivers:
sudo apt purge nvidia* -y
sudo reboot
- Reinstall recommended drivers:
sudo ubuntu-drivers autoinstall
sudo reboot
Resetting Forgotten Password
- At GRUB, press e to edit the boot entry.
- Find the line starting with
linux
and append:
rw init=/bin/bash
- Press Ctrl+X or F10 to boot.
- Remount root as read-write:
mount -o remount,rw /
- Reset your password:
passwd your_username
- Reboot:
reboot -f
Checking SSD/HDD Health
Install smartmontools:
sudo apt update && sudo apt install smartmontools -y
Run health check:
sudo smartctl -a /dev/nvme0n1
Look for:
Critical Warning: 0
Media and Data Integrity Errors: 0
If errors appear, back up immediately.
The Ubuntu Survival Kit
To prevent panic in the future, prepare a small set of tools and notes.
Cheat Sheet & Commands
Command | Purpose | Notes |
---|---|---|
sudo mount -a |
Test fstab before reboot | Prevents boot failure |
sudo systemctl restart gdm |
Restart display manager | Fixes black screen |
sudo apt purge nvidia* -y |
Remove NVIDIA drivers | Use before reinstall |
sudo ubuntu-drivers autoinstall |
Install recommended GPU drivers | Requires internet |
passwd your_username |
Reset forgotten password | Run after remount in GRUB recovery |
sudo smartctl -a /dev/nvme0n1 |
Check SSD health | Look for warnings/errors |
Scripts (Optional)
- fix-fstab.sh → Comments out broken fstab lines automatically.
- fix-graphics.sh → Purges NVIDIA and reinstalls drivers.
- backup-now.sh → Rsyncs Documents and Desktop to external drive.
Backup Strategy
- Use Timeshift for system snapshots.
- Use Clonezilla for full disk cloning.
- Keep rsync backups of project folders on external drives.
Conclusion
A broken Ubuntu system doesn’t have to mean disaster. With the right steps, most issues — from fstab misconfigurations to black screens — are solvable. Preparing an Ubuntu Survival Kit ensures that next time, you’ll fix the problem in minutes instead of hours.
Bookmark this guide, and consider building your own survival kit today.
Author: Farzan Afringan
Date: September 2025
This content originally appeared on DEV Community and was authored by Farzan Afringan