107 lines
2.4 KiB
Plaintext
107 lines
2.4 KiB
Plaintext
OpenWrt 24.x Extroot on XE300
|
|
|
|
Goal: Use a 512 GB microSD card as the router's writable storage (overlay),
|
|
single ext4 partition, no data copied from internal flash.
|
|
|
|
Assumptions (based on your box):
|
|
|
|
Device: GL-iNet XE300, OpenWRT 24.10.4
|
|
|
|
Detected as: /dev/sda with one partition /dev/sda1
|
|
|
|
1. Insert card & install required packages
|
|
|
|
opkg update
|
|
opkg install block-mount kmod-fs-ext4 kmod-usb-storage e2fsprogs
|
|
|
|
block-mount - block info, fstab handling, extroot logic
|
|
kmod-fs-ext4 - kernel driver for ext4 filesystem
|
|
kmod-usb-storage - makes the SD slot show up as /dev/sda
|
|
e2fsprogs - provides mkfs.ext4
|
|
|
|
2. Confirm the SD card is /dev/sda and /dev/sda1
|
|
|
|
Check dmesg:
|
|
|
|
dmesg | grep -i sd
|
|
|
|
|
|
Sample Output:
|
|
sd 0:0:0:0: [sda] 1000005632 512-byte logical blocks: (512 GB/477 GiB)
|
|
sda: sda1
|
|
sd 0:0:0:0: [sda] Attached SCSI removable disk
|
|
|
|
|
|
3. Format /dev/sda1 as ext4 for extroot
|
|
mkfs.ext4 -L extroot /dev/sda1
|
|
|
|
You should see output ending with success and a UUID.
|
|
|
|
4. Grab the UUID and create the extroot fstab entry
|
|
UUID=$(block info | awk -F\" '/sda1/ {print $2}')
|
|
echo $UUID
|
|
|
|
Sample UUID output:
|
|
|
|
4851f00e-696b-47d3-a529-82c2aca292db
|
|
|
|
Now write the minimal extroot config using uci:
|
|
|
|
uci set fstab.extroot="mount"
|
|
uci set fstab.extroot.uuid="$UUID"
|
|
uci set fstab.extroot.target="/overlay"
|
|
uci set fstab.extroot.fstype="ext4"
|
|
uci set fstab.extroot.enabled="1"
|
|
uci commit fstab
|
|
|
|
Sanity-check the file:
|
|
|
|
cat /etc/config/fstab
|
|
|
|
|
|
Expected output:
|
|
|
|
config global
|
|
option anon_swap '0'
|
|
option anon_mount '0'
|
|
option auto_swap '1'
|
|
option auto_mount '1'
|
|
option delay_root '5'
|
|
option check_fs '0'
|
|
|
|
config mount 'extroot'
|
|
option uuid '4851f00e-696b-47d3-a529-82c2aca292db'
|
|
option target '/overlay'
|
|
option fstype 'ext4'
|
|
option enabled '1'
|
|
|
|
|
|
5. Reboot into extroot
|
|
|
|
reboot
|
|
|
|
Wait for the router to come back up, then SSH in again.
|
|
|
|
6. Verify that the SD card is now your root overlay
|
|
|
|
df -h
|
|
|
|
Expected output:
|
|
|
|
Filesystem Size Used Available Use% Mounted on
|
|
/dev/root 4.0M 4.0M 0 100% /rom
|
|
tmpfs 58.7M 200.0K 58.5M 0% /tmp
|
|
/dev/sda1 468.3G 2.1M 444.4G 0% /overlay
|
|
overlayfs:/overlay 468.3G 2.1M 444.4G 0% /
|
|
|
|
|
|
Explanation:
|
|
|
|
/dev/root at /rom → read-only squashfs from flash
|
|
/dev/sda1 at /overlay → SD card is the writable layer
|
|
overlayfs:/overlay on / → full rootfs = ROM + SD overlay
|
|
You now have a 468 GB OpenWrt box.
|
|
|
|
No /rwm mount
|
|
No copy of internal overlay
|
|
This is a clean, SD-only overlay setup. |