Website Vidya
DevelopmentStep-by-Step Guide

How to Install Python and Pip on Ubuntu 24.04 LTS

Python is one of the most popular, versatile, and widely-used programming languages today, underpinning everything from web development and automation to data science and artificial intelligence. Pip is Python’s official package manager, al...

RR
Website Vidya TeamLead Systems Educator
Published:
6 min read
How to Install Python and Pip on Ubuntu 24.04 LTS
AI Executive SummaryCORE CIS AI

6 min read

Python is one of the most popular, versatile, and widely-used programming languages today, underpinning everything from web development and automation to data science and artificial intelligence. Pip is Python’s official package manager, al...

Key Highlights
  • Understanding Why Ubuntu Server Not Booting
  • Step-by-Step Boot Recovery Checklist
  • Repairing GRUB Bootloader (GRUB Repair Guide)
Grounded in full engineering runbookCORE CIS Ai Engine

Ubuntu Server Not Booting? It can halt your entire infrastructure—web apps, databases, or business-critical processes. Thankfully, most boot failures are reversible with the right debugging approach. This in-depth guide covers the most common causes and fixes, including GRUB repair, disk check, initramfs shell fixes, and systemd debug logs.

Whether your Ubuntu Server is hosted on bare metal, VMware, Hyper-V, AWS EC2, DigitalOcean, or Proxmox, the recovery steps remain largely the same.


1. Understanding Why Ubuntu Server Not Booting

Before jumping into fixes, identify typical boot failure scenarios:

  • GRUB missing or corrupted
  • Filesystem errors (EXT4 corruption, disk failure, inode issues)
  • Dropping into initramfs busybox shell
  • Kernel panic or missing kernel modules
  • Failed systemd services looping the boot process
  • Misconfigured fstab causing root filesystem not to mount

Each of these scenarios presents different symptoms—let’s fix them one by one.


2. Step-by-Step Boot Recovery Checklist

Step 1: Boot into Recovery Mode or Live CD

To diagnose boot failure, you need access to the server environment.

Option A: Using GRUB Recovery Menu

If GRUB is partially working:

  1. Reboot the server.
  2. Hold Shift (BIOS) or press Esc repeatedly (UEFI).
  3. Select:
    Advanced Options → Recovery Mode → Root Shell
  1. Boot from Ubuntu Server/Desktop ISO
  2. Choose Try Ubuntu (not Install)
  3. Open a terminal
  4. Mount your server disk:
sudo mount /dev/sda1 /mnt   # Replace partition as required

You now have full access to the server filesystem and can run GRUB repair, disk checks, or chroot operations.


3. Repairing GRUB Bootloader (GRUB Repair Guide)

Corrupted GRUB is the most common cause of Ubuntu not booting. Symptoms include:

  • “grub rescue>” prompt
  • “Minimal BASH-like line editing supported”
  • Black screen with blinking cursor
  • Missing operating system

Method 1: Auto-Reinstall GRUB Using Live ISO

Boot into a Live ISO and find the root partition:

sudo fdisk -l

Mount the Linux root partition:

sudo mount /dev/sda1 /mnt
sudo mount /dev/sda2 /mnt/boot # If separate /boot partition exists
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys

Chroot into the installed system:

sudo chroot /mnt

Reinstall GRUB:

grub-install /dev/sda
update-grub

Exit and reboot:

exit
sudo reboot

Method 2: GRUB Rescue Mode Fix

If you see:

grub rescue>

Find your Linux partition:

ls
ls (hd0,msdos1)
ls (hd0,msdos2)

Set boot parameters:

set prefix=(hd0,msdos1)/boot/grub
set root=(hd0,msdos1)
insmod normal
normal

This boots the system temporarily—once inside Ubuntu, reinstall GRUB normally:

sudo grub-install /dev/sda
sudo update-grub

4. Running Disk Checks (fsck) | Fix EXT4 Errors

Many boot failures come from filesystem corruption, visible as:

  • Dropping into initramfs
  • “UNEXPECTED INCONSISTENCY”
  • “You must manually run fsck”
  • “EXT4-fs error: Inode …”

Run fsck from Recovery Mode

  • Choose Root Shell in recovery mode.
  • Check root filesystem:
fsck -fy /

If root is mounted read-only, remount it:

mount -o remount,rw /
fsck -f /dev/sda1

Run fsck from Live ISO (safer)

sudo fsck -f /dev/sda1

It may fix:

  • superblock corruption
  • orphaned inodes
  • journal errors
  • missing file tables

Bad Disk? Test for Disk Health

sudo smartctl -a /dev/sda

Look for:

  • Reallocated sectors
  • Pending sectors
  • Read/write errors

If disk health is failing → replace disk immediately.


5. Fixing Initramfs Shell Errors (BusyBox)

If Ubuntu drops into initramfs, you’ll see:

(initramfs) _

or

ALERT! /dev/sda1 does not exist

or

Cannot find root filesystem

Common causes:

  • Wrong fstab entries
  • Missing disk drivers
  • Disk UUID changed
  • Filesystem corruption
  • NVMe or RAID mapping changed

Fix 1: Check Available Disks

From initramfs:

lsblk
blkid

Check if root partition exists.

Compare against /etc/fstab (mount it manually if needed):

cat /mnt/etc/fstab

Fix 2: Update fstab UUID

If UUID changed, update it:

blkid
nano /etc/fstab

Replace incorrect UUID → Save → Reboot.


Fix 3: Regenerate Initramfs

From Live ISO:

sudo mount /dev/sda1 /mnt
sudo chroot /mnt
update-initramfs -c -k all
exit
sudo reboot

This recreates:

  • drivers
  • hardware modules
  • boot scripts

Fix 4: Reinstall Kernel (if kernel modules missing)

sudo apt-get update
sudo apt-get install --reinstall linux-image-generic linux-headers-generic
update-initramfs -u

Then reboot:

reboot

6. Debugging with Systemd Logs (systemd-analyze, journalctl)

If boot hangs at:

  • “A start job is running…”
  • “Failed to start…”
  • “Dependency failed…”
  • Long wait on network or disk mounting

Systemd debugging gives the root cause.

Boot into Systemd Emergency Shell

At GRUB menu:

  1. Press e
  2. Add systemd.unit=rescue.target after the linux line
  3. Press Ctrl+X to boot

View Boot Errors:

journalctl -xb

Check failed units:

systemctl --failed

Restart specific services:

systemctl restart networking
systemctl restart mysql
systemctl restart nginx

Analyze Boot Performance:

systemd-analyze
systemd-analyze blame
systemd-analyze critical-chain

This helps identify slow boot components.


7. Fixing fstab Errors That Prevent Boot

A single wrong line in /etc/fstab can prevent Ubuntu from booting.

Typical error:

A start job is running for /mnt/data

Boot into Recovery Mode → Root Shell

Open fstab:

nano /etc/fstab

Comment out problematic mounts

Add # to disable:

# /dev/sdb1 /mnt/data ext4 defaults 0 2

Safe mount options to prevent future failures

Use nofail:

/dev/sdb1 /mnt/data ext4 defaults,nofail 0 2
  • System will boot even if the disk is missing.

8. Kernel Panic Recovery

If boot shows:

kernel panic - not syncing

or

VFS: Unable to mount root fs

Quick fixes:

A. Reinstall kernel

sudo apt install --reinstall linux-image-generic
sudo update-initramfs -u

B. Update GRUB

sudo update-grub

C. Rollback to older kernel

At GRUB → Advanced options → choose older kernel.


9. Reinstalling Ubuntu Without Losing Data (Last Resort)

If nothing works:

  1. Boot from Ubuntu ISO
  2. Start installer
  3. Choose “Something Else”
  4. Select root partition → Do not format
  5. Install only system files

Home directories and data remain safe.


10. Preventing Future Boot Failures

To ensure Ubuntu Server remains stable:

A. Enable Automatic fsck

sudo tune2fs -c 30 -i 30d /dev/sda1

B. Keep Kernel & GRUB Updated

sudo apt update && sudo apt upgrade -y

C. Monitor disk health

sudo smartctl -H /dev/sda

Set automatic checks with smartd.

D. Avoid manual editing of fstab unless necessary

Always verify UUIDs using:

blkid

Conclusion

When Ubuntu Server not booting, systematic troubleshooting helps avoid unnecessary downtime. This guide covered detailed step-by-step solutions:

By following these methods, you can recover nearly any unbootable Ubuntu Server and restore full functionality without data loss.

Written by

Website Vidya Team

Technology educator and researcher at Website Vidya.

Discussion

0
Share your thoughts, ask a question, or suggest a tip...
Write →

No comments on this guide yet. Be the first to share your thoughts or ask a question!

Recommended Reading10 Guides

Related Technical Guides

Tested runbooks, server administration walkthroughs, and troubleshooting guides

Development•

How to Install Python on Ubuntu 24.04 LTS

Python is one of the most popular programming languages today, widely used in web development, data science, machine learning, automation, and more. Ubuntu 24.04 LTS (Long Term Support) comes with Python pre-installed, but often you might w...

RR
Rajesh Rai
Read More