OpenWrt Overlay空间不足,U盘挂载

  • Post author:
  • Post category:其他


Overlay空间不足,解决办法:U盘挂载


前序步骤

opkg update
opkg install block-mount e2fsprogs kmod-fs-ext4 kmod-usb-storage kmod-usb2 kmod-usb3
opkg install luci luci-i18n-base-zh-cn

格式化U盘/SD卡,假设U盘设备节点为/dev/sda1:

root@OpenWrt:~# mkfs.ext4 /dev/sda1 << EOF
> Y
> EOF
#mke2fs 1.44.1 (24-Mar-2018)
#Creating filesystem with 3839992 4k blocks and 960992 inodes
#Filesystem UUID: ccb794c1-4ac4-401a-a5bf-f49344043014
#Superblock backups stored on blocks: 
#	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

#Allocating group tables: done                            
#Writing inode tables: done                            
#Creating journal (16384 blocks): done
#Writing superblocks and filesystem accounting information: done  

给U盘/SD卡制作根文件系统:

mount /dev/sda1 /mnt
mkdir /tmp/root
mount -o bind / /tmp/root
cp /tmp/root/* /mnt -a
umount /tmp/root
umount /mnt



配置自动挂载并重启路由

block detect > /etc/config/fstab
uci set fstab.@mount[0].target='/overlay'
uci set fstab.@mount[0].enabled='1'
uci commit fstab
reboot


致此Overlay分区扩容完毕:



版权声明:本文为qq_38339669原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。