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.
- Introduction
- Prerequisites
- Download OpenWrt
- Setting Up Your Environment
- Expanding the Root Partition
- Verifying Changes
- Troubleshooting
- Contributing
- License
- Links
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.
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.
- Visit the OpenWrt Downloads page.
- Locate the Ext4 version for your Raspberry Pi model.
- Download the image file to your computer.
Make sure to check the Releases section for any additional files you may need.
If you haven't installed VirtualBox yet, you can do so using the following command:
sudo apt update
sudo apt install virtualbox
- Open VirtualBox.
- Click on "New" to create a new VM.
- Set the name to "OpenWrt VM".
- Choose "Linux" as the type and "Ubuntu (64-bit)" as the version.
- Allocate at least 1 GB of RAM.
- Create a virtual hard disk (VDI) and allocate at least 8 GB of space.
- Go to the settings of your VM.
- Click on "USB".
- Enable USB Controller and add a USB device filter for your SD card reader.
- Start your OpenWrt VM.
- Open a terminal in Ubuntu.
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.
- Open
fdisk
to modify the partition table:
sudo fdisk /dev/sdX
- Press
p
to print the partition table. - Note the start sector of the root partition (usually the first partition).
- Delete the existing partition by pressing
d
and selecting the partition number. - Create a new partition by pressing
n
, selectingp
for primary, and entering the same start sector. Use the default end sector to utilize the full space. - Press
w
to write changes and exit.
Run the following command to format the new partition as Ext4:
sudo mkfs.ext4 /dev/sdX1
To expand the file system to fill the partition, use:
sudo resize2fs /dev/sdX1
After resizing, verify that the changes took effect:
- Run
df -h
to check the available space. - Use
e2fsck
to check the file system:
sudo e2fsck -f /dev/sdX1
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.
Contributions are welcome! If you have suggestions or improvements, please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
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.