usb.sh:
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"
nohup sh usb.sh > log_out.txt 2>&1 &
查看执行日志:
tail -f log_out.txt
/etc/fstab 只读无法修改的解决办法
重新挂载为读写文件系统
mount -o remount,rw /
修改/etc/config/fstab文件
删除默认的mount信息
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'
设置显示从哪里启动的:
echo Booted from internal rom >> /etc/banner
docker根目录设置