
🛠️ Single USB x86 OpenWrt Installation & Disk Partitioning Guide
📝 Summary
This guide explains how to install OpenWrt on x86 systems (Mini PC / Desktop, etc.) Offline (without requiring an internet connection during installation) using a single USB drive. It also covers partitioning the disk as 8GB System + 400GB Data Storage(I specified it as 400GB+ because my device has 500GB of storage; however, this depends on the total storage capacity of your own device.) and getting the system fully operational.
⚠️ Requirement: A USB flash drive with a capacity of at least 4GB is required for this process.
⚠️ Internet Access Setup: For this section of the setup, you will need your ISP Subscriber Username, ISP Subscriber Password, and the MAC address of the modem/router provided by your ISP (not required for every ISP/situation). This guide does not cover how to obtain this information; however, you can usually get your subscriber credentials by calling your ISP's customer service, and the MAC address can often be found on the label located at the back or bottom of the provided modem/router.
🎥This Guide's Video
🔗 Required Links and Tools
- Ventoy: (To create a Multiboot USB)
- SystemRescue: (Recovery and Installation ISO)
- OpenWrt Firmware Selector: (Custom Image Builder)
📦 Packages to Add to OpenWrt Image
After selecting your device (Generic x86/64) in the Firmware Selector, paste the following list into the "Customize" section. Download the image as "Ext4 Combined".
libmount1 mount-utils lsblk block-mount kmod-fs-ext4 kmod-fs-ntfs3 kmod-fs-exfat kmod-usb-storage kmod-usb-storage-uas usbutils pciutils nano-full parted irqbalance
🧐 What Do These Packages Do?
| Package | Description |
|---|---|
| nano-full | An easy-to-use text editor (much easier than vi). |
| parted | Essential tool for creating and resizing disk partitions. |
| block-mount | Infrastructure required to auto-mount drives via fstab. |
| lsblk / mount-utils | Basic commands to list and mount drives. |
| kmod-fs-* | Filesystem drivers: ext4 (Linux), ntfs3 (Windows), exfat (USB/Ventoy). |
| kmod-usb-* | Kernel modules required to recognize USB storage devices. |
| irqbalance | Improves performance on multi-core CPUs (like N100) by balancing interrupts. |
🚀 Step 1: USB Preparation and Ventoy Installation
- Install Ventoy: Open the downloaded zip file, run
Ventoy2Disk.exe, select your USB drive, and click Install. (Warning: Everything on the USB will be erased!) - Copy Files:
- Copy the
systemrescue-x.x.x.isofile to the USB drive. - Copy the
openwrt-xxx-x86-64-generic-ext4-combined.img.gzfile to a folder (e.g.,openwrt) on the USB drive.
- Copy the
🔐 Step 2: BIOS and "Enroll Keys" (Secure Boot)
If you boot from USB and get a blue "Verification failed: (0x1A) Security Violation" screen:
- Select Enroll Key -> Enroll Key from Disk -> VTOYEFI.
- Select ENROLL_THIS_KEY_IN_MOKMANAGER.cer.
- Select Continue -> Yes -> Reboot.
🛠️ Step 3: Booting with SystemRescue (RAM Mode)
- In the Ventoy menu, highlight SystemRescue ISO and press Enter.
- In the small pop-up menu, select Boot in normal mode.
- When the SystemRescue menu appears, select the 2nd option and press Enter: 👉 Boot SystemRescue and Copy to RAM (copytoram) (This copies the system to RAM, allowing us to unmount/remount the USB drive freely.)
Once the terminal loads, enter these commands:
dmsetup remove_all # Removes Ventoy's virtual disk lock (Crucial step!). lsblk # Lists disks (Identify your USB name, e.g., sdb1).
💾 Step 4: Installation and Partitioning
We will mount the USB, write the image to the disk, and adjust the partitions without rebooting.
1. Mount USB and Write Image
(Replace sdb1 below with your actual USB drive name)
mkdir -p /mnt/usb mount /dev/sdb1 /mnt/usb # (If you get an error: mount -t exfat /dev/sdb1 /mnt/usb) cd /mnt/usb/openwrt/ zcat openwrt-image-name.img.gz | dd of=/dev/sda bs=1M status=progress conv=fsync
2. Expand Disk Structure with Parted (sda)
parted /dev/sda # --- Parted Interface --- (parted) unit GiB (parted) print # View current status. (parted) fix # If it asks to fix "GPT Header", type Fix. (parted) resizepart 2 8GiB # Resize System partition (Root) to 8GB. (parted) mkpart primary ext4 8GiB 100% # Use the rest as Data partition. (parted) print # Final check: sda1(boot), sda2(root), sda3(data). (parted) quit # --- Exit ---
3. Format Filesystems
# 1. Expand the OpenWrt system filesystem into the resized partition e2fsck -f /dev/sda2 resize2fs /dev/sda2 # 2. Format the new massive data partition mkfs.ext4 /dev/sda3
Now remove the USB drive and type reboot.
⚙️ Step 5: Persistent Mounting in OpenWrt (Using Nano)
After OpenWrt boots, connect to the terminal and make the sda3 drive persistent.
# 1. Create the directory mkdir -p /mnt/data # 2. Scan disks and generate a clean config block detect > /etc/config/fstab # 3. Open the config file with Nano nano /etc/config/fstab
Using nano Editor:
- Use arrow keys to go to the bottom, to the
sda3block. - Edit the lines by typing directly:
- Change
option target-> to'/mnt/data'. - Change
option enabled-> to'1'.
- Change
- To Save: Press
CTRL+O, thenEnter. - To Exit: Press
CTRL+X.
Final Touch (Permissions):
service fstab boot # Mount the drive immediately. chmod 755 /mnt/data # Enable read/write permissions for Docker. df -h # Verify (Is /mnt/data visible?).
🎉 Congratulations! You now have a rock-solid OpenWrt server with an 8GB system area and 400GB+ storage ready for Docker.
