OpenWrt Overlay空间不足,U盘挂载

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分区扩容完毕:

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值