openwrt扩容导出根目录到u盘 Published on Jul 5, 2023 in 随笔 with 0 comment usb.sh: ```shell mkdir -p /tmp/introot && mkdir -p /tmp/extroot && mount --bind / /tmp/introot && mount /dev/sda1 /tmp/extroot && tar -C /tmp/introot -cvf - . | tar -C /tmp/extroot -xf - && umount /tmp/introot && umount /tmp/extroot && echo "success" ``` ```shell nohup sh usb.sh > log_out.txt 2>&1 & ``` 查看执行日志: ```shell tail -f log_out.txt ``` /etc/fstab 只读无法修改的解决办法 ## 重新挂载为读写文件系统 ```shell mount -o remount,rw / ``` 修改/etc/config/fstab文件 删除默认的mount信息  ```shell config global option anon_swap '0' option anon_mount '1' option auto_swap '1' option auto_mount '1' option delay_root '5' option check_fs '0' config mount option target '/rom' option uuid '1f045de8-469f-4786-9614-85ebdf19b519' option enabled '0' config mount option target '/mnt/mmcblk2p3' option uuid '7df14b19-6e49-4532-bda7-8901e5388e36' option enabled '1' config mount option target '/mnt/mmcblk2p4' option uuid 'c48f430a-443e-4992-9424-e575f1e1f159' option enabled '1' config mount option target '/' option uuid 'e5e198c0-53ee-407a-b2a2-a0fc98d68715' option enabled '1' config mount option enabled '1' option uuid 'e5e198c0-53ee-407a-b2a2-a0fc98d68715' option target '/opt' config mount option enabled '1' option uuid 'e5e198c0-53ee-407a-b2a2-a0fc98d68715' option target '/overlay' ``` 设置显示从哪里启动的: ```shell echo Booted from internal rom >> /etc/banner ``` docker根目录设置  本文由 admin 创作,采用 知识共享署名4.0 国际许可协议进行许可。本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。