How to Install and Set Up Ubuntu on Raspberry Pi 5 with an NVMe SSD

Introduction

The Raspberry Pi 5 is a powerful mini-computer that now supports NVMe SSDs, providing faster storage speeds and improved performance. In this guide, I’ll walk you through the process of installing Ubuntu on Raspberry Pi 5, setting up an NVMe SSD, configuring the network, and troubleshooting common issues.


Pironman 5


Step 1: Preparing the Installation Media

To install Ubuntu, you need to flash the OS onto a microSD card.

  • Download Raspberry Pi Imager.
  • Insert a microSD card (minimum 16GB recommended) into your computer.
  • Open Raspberry Pi Imager, select Ubuntu Server 24.04 (or latest version), and write it to the microSD card.
  • Once done, insert the microSD card into the Raspberry Pi 5.

Step 2: Booting into Ubuntu and First Login

  • Power on your Raspberry Pi 5.
  • The system will boot into Ubuntu, and you'll be prompted to log in.
  • Use the default credentials:
Username: ubuntu
Password: ubuntu

On first login, you will be asked to change the password.

Step 3: Connecting to the Internet

If you're using Ethernet, Ubuntu should automatically connect.
If you're using Wi-Fi, follow these steps:

Method 1: Using netplan (CLI Method)

Edit the network configuration file:

sudo nano /etc/netplan/50-cloud-init.yaml

Add the following (replace WiFiSSID and WiFiPassword with your actual credentials):

network:
  version: 2
  renderer: networkd
  wifis:
    wlan0:
      dhcp4: true
      access-points:
        "WiFiSSID":
          password: "WiFiPassword"

Apply the changes:

sudo netplan apply

Check if your Wi-Fi is connected:

ip a | grep wlan0

Step 4: Mounting and Using NVMe SSD

If your NVMe SSD is not detected, check with:

lsblk

If it shows up as /dev/nvme0n1, format and mount it:

  1. Format the SSD (Warning: This erases all data!)
  2. sudo mkfs.ext4 /dev/nvme0n1
  3. Create a mount point:
  4. sudo mkdir /mnt/ssd
  5. Mount the SSD:
  6. sudo mount /dev/nvme0n1 /mnt/ssd
  7. Make the mount persistent:
  8. echo "/dev/nvme0n1 /mnt/ssd ext4 defaults 0 0" | sudo tee -a /etc/fstab

Step 5: Common Issues and Troubleshooting

1. NVMe SSD Not Detected

Run lspci to check if the SSD is recognized.

Add boot parameters:

sudo nano /boot/firmware/cmdline.txt

Add this at the end:

nvme_core.default_ps_max_latency_us=0 pcie_aspm=off pcie_port_pm=off

2. Internet Not Working

Check if Ethernet is connected (ip a).
Restart networking:

sudo systemctl restart systemd-networkd

If using Wi-Fi, ensure the credentials are correct in netplan.

Step 6: Safely Shutting Down the Raspberry Pi

Use:

sudo shutdown -h now

Or reboot:

sudo reboot

Conclusion

Setting up Ubuntu on Raspberry Pi 5 with an NVMe SSD can significantly boost performance. By following this guide, you should have a fully functional system with internet connectivity, SSD storage, and troubleshooting tips.

Comments

Popular posts from this blog

Error Handling in Flutter - Gradle issue

Understanding API integration with Getx State management

How to Make a Dynamic and Trending ListView with Flutter Widgets?