Openwrt掛載U盤或者TF卡擴容Overlay(Cudy-TR3000)
Openwrt掛載U盤或者TF卡擴容Overlay(Cudy-TR3000)

Openwrt掛載U盤或者TF卡擴容Overlay(Cudy-TR3000)

Openwrt掛載U盤或者TF卡擴容Overlay
機器使用的是Cudy的TR-3000
硬件配置為MT7981+128M_ROM+512M_RAM USB3.0掛載64G Sandisk給Overlay+Swap+FTP
1、要擴容的盤插入Openwrt
2、格式化EXT4格式並且在了路由器掛載
3、拷貝overlay目錄文件
ls /overlay 查看overlay的文件
cp -r /overlay/* /mnt/擴容盤的位置/ 拷貝overlay系統文件
ls /mnt/擴容盤的位置/ 檢查文件是否拷貝

4、去到Web界面網頁管理界面,點“掛載點”選項卡
5、啓用掛載點
6、在uuid直接選中自己剛剛新建的分區
7、掛載點選項卡,選“作為外部 overlay 使用”
8、此時點擊系統-啓動項-滑倒最底下
默認是
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
exit 0

請在exit 0前面修改成
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

mount /dev/sda1 /overlay
/etc/init.d/fstab reload

exit 0

mount /dev/sda1 /overlay
意思是使用mount掛載命令將設備sda1掛載到overlay分區
/etc/init.d/fstab reload
/etc/init.d/是系統啓動腳本存放的目錄包含了管理系統服務的腳本
fstab是存儲系統掛載的設備及其掛載點信息在系統啓動時自動掛載設備
reload表示重新加載配置
9、保存然後reboot
10、重啓後
ssh root@10.0.0.1

11、然後df -h

Filesystem Size Used Available Use% Mounted on
/dev/root 32.0M 32.0M 0 100% /rom
tmpfs 243.4M 3.6M 239.8M 1% /tmp
/dev/ubi0_2 28.4G 3.2M 26.9G 0% /overlay
overlayfs:/overlay 63.4M 892.0K 59.2M 1% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda1 28.4G 3.2M 26.9G 0% /overlay

可以看到成功自動掛載
❗️如果發現不會自啓動應該是系統啓動腳本忘記添加❗️

发表回复