下载img.gz,使用gunzip解压为img。
基础准备
网络配置
扩展分区(Ext4)
OpenWrt 23.05磁盘扩容教程:从工具安装到分区挂载的完整指南
执行fdisk -l看到
GPT PMBR size mismatch (680479 != 125045423) will be corrected by write.
The backup GPT table is not on the end of the device.
Disk /dev/sda: 59.63 GiB, 64023257088 bytes, 125045424 sectors
Disk model: ONDA S-12 64GB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 484C7FC2-AE74-A97D-23DA-C3B75CF79600
Device Start End Sectors Size Type
/dev/sda1 512 66047 65536 32M Linux filesystem
/dev/sda2 66048 680447 614400 300M Linux filesystem
/dev/sda128 34 511 478 239K BIOS boot
Partition table entries are not in disk order.
因此需要先修复分区
修复分区表
安装parted工具
opkg install parted
执行parted -l
Warning: Not all of the space available to /dev/sda appears to be used, you can
fix the GPT to use all of the space (an extra 124364943 blocks) or continue with
the current setting?
Fix/Ignore? fix
Model: ATA ONDA S-12 64GB (scsi)
Disk /dev/sda: 64.0GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
128 17.4kB 262kB 245kB bios_grub
1 262kB 33.8MB 33.6MB fat16 legacy_boot
2 33.8MB 348MB 315MB ext4
分配剩余空间
opkg install cfdisk
cfdisk /dev/sda
挂载点
界面中找到挂载点界面,生成配置,点击新分区编辑,启用+ 作为根分区使用+复制下面的命令并改动为对应分区的。
mkdir -p /tmp/introot
mkdir -p /tmp/extroot
mount --bind / /tmp/introot
mount /dev/sda4 /tmp/extroot
tar -C /tmp/introot -cvf - . | tar -C /tmp/extroot -xf -
umount /tmp/introot
umount /tmp/extroot
扩展分区(SquashFS)
在线扩容(已安装系统,不丢数据)
# 安装必要工具
opkg update
opkg install lsblk fdisk losetup f2fs-tools
# 1. 查看当前分区(记录 sda2 的 Start 扇区,如 66048)
fdisk -l /dev/sda
# 2. 删除并重建更大的 sda2(保持起始扇区不变)
fdisk /dev/sda
# 输入: d → 2 → n → 2 → 66048 (原起始扇区) → 回车(使用全部剩余空间) → N(保留签名) → w
# 3. 扩容 F2FS 文件系统
# 66048 扇区 × 512 字节/扇区 = 33,816,576 字节 ≈ 32.2MB
# 是sda2分区在磁盘上的物理起始位置
losetup -f -o $((66048*512)) /dev/sda2 # 使用原偏移量挂载
resize.f2fs /dev/loop1
# 4. 更新 UUID(如变更过)到 /boot/grub/grub.cfg
blkid /dev/sda2 # 查看新 UUID
vim /boot/grub/grub.cfg # 替换 rootfs_data 的 UUID
reboot
软件安装
Argon主题
opkg update
opkg install luci-compat
opkg install luci-lib-ipkg
wget --no-check-certificate -O luci-theme-argon_2.3.2-r20250207_all.ipk https://github.com/jerrykuku/luci-theme-argon/releases/download/v2.3.2/luci-t
heme-argon_2.3.2-r20250207_all.ipk
opkg install luci-theme-argon*.ipk
或者直接搜luci-theme-argon安装。
常用软件
可以opkg install或者直接系统-软件包图形化安装。软件有本地化可以直接选择安装zh-cn,会连带依赖下载本体。
- luci-i18n-argon-config-zh-cn 基本主题
- luci-i18n-attendedsysupgrade-zh-cn 在线升级
- luci-i18n-ddns-go-zh-cn DDNS
- luci-app-snmpd 旁路由需要安装
- luci-i18n-passwall-zh-cn
- luci-app-vnstat2 流量统计
- luci-app-zerotier 内网穿透
- luci-app-vsftpd 支持使用FTP
- openssh-server
- openssh-sftp-server 进路由器看文件
- pciutils 用lspci查看硬件
- adguardhome 官方不做luci界面,目前还在持续更新的有sirpdboy版本,安装完之后需要重启。
- luci-app-upnp 批量自动端口映射,对于ps remote play这种请求十几个端口的服务很有用,但是会增加网络风险。
配置迁移
/etc/init.d/passwall restart
/etc/init.d/firewall restart