Exsi 安装OpenWRT并使用gparted扩容
Exsi 安装OpenWRT并使用gparted扩容
- 所有操作均基于MAC OS
- 参考资料
下载OpenWRT镜像
镜像库地址:
https://mirror.sjtu.edu.cn/openwrt/releases/[VERSION_ID]/targets/x86/64/
cd ~\Downloads
wget https://mirror.sjtu.edu.cn/openwrt/releases/22.03.5/targets/x86/64/openwrt-22.03.5-x86-64-generic-ext4-combined-efi.img.gz
转化并上传镜像
Brew安装qemu-img
- MAC操作
brew install qemu
gunzip ./openwrt-22.03.5-x86-64-generic-ext4-combined-efi.img.gz
qemu-img convert -f raw -O vmdk openwrt-22.03.5-x86-64-generic-ext4-combined-efi.img openWRT.vmdk
Qemu-img说明:https://docs.openstack.org/image-guide/convert-images.html
登录Exsi
-
上传VMDK文件
上传openWRT.vmdk到Exsi
openwrt_v22
文件夹下 -
启动Exsi SSH并连接
ssh root@[exsi ip] [root@localhost:~] cd /vmfs/volumes/4effa38a-c996bb36-3e5f-000c29113d64 [root@localhost:/vmfs/volumes/4effa38a-c996bb36-3e5f-000c29113d64] [root@localhost:/vmfs/volumes/4effa38a-c996bb36-3e5f-000c29113d64] ll total 1489920 drwxr-xr-t 1 root root 77824 Jul 30 13:06 . drwxr-xr-x 1 root root 512 Jul 30 13:08 .. drwxr-xr-x 1 root root 73728 Jul 30 13:06 openwrt_v22 [root@localhost:/vmfs/volumes/4effa38a-c996bb36-3e5f-000c29113d64]cd openwrt_v22 [root@localhost:/vmfs/volumes/4effa38a-c996bb36-3e5f-000c29113d64/openwrt_v22] vmkfstools -i openWRT.vmdk -d thin openWRT_thin.vmdk Destination disk format: VMFS thin-provisioned Cloning disk 'openWRT.vmdk'... Clone: 100% done. [root@localhost:/vmfs/volumes/4effa38a-c996bb36-3e5f-000c29113d64/openwrt_v22] ll total 60544 drwxr-xr-x 1 root root 73728 Jul 30 13:12 . drwxr-xr-t 1 root root 77824 Jul 30 13:06 .. -rw-r--r-- 1 root root 26476544 Jul 30 13:06 openWRT.vmdk -rw------- 1 root root 126123520 Jul 30 13:12 openWRT_thin-flat.vmkd -rw------- 1 root root 534 Jul 30 13:12 openWRT_thin.vmkd [root@localhost:/vmfs/volumes/4effa38a-c996bb36-3e5f-000c29113d64/openwrt_v22] rm openWRT.vmdk rm: remove 'openWRT.vmdk'? y
创建虚拟机
创建虚拟机时,先创建虚拟机,接着再把之前转换好的vmdk磁盘移动至此虚拟机的目录,最后编辑虚拟机设置添加此vmdk磁盘。


此处先行创建硬盘
移动硬盘文件



编辑虚拟机,将原有硬盘删除,并调整转化后的硬盘尺寸为10G
调整OpenWRT硬盘
-
将iso上传至Exsi,并挂载到OpenWRT虚拟机CD-ROM




输入
startx
启动桌面环境

将/dev/sda2分配所有剩余空间
保存并重启

空间已完成调整
OpenWRT 配置
IP配置
vim /etc/config/network

重启网络
./etc/init.d/network restart
汉化包
https://downloads.openwrt.org/releases/[VERSION]/packages/x86_64/luci/
搜索luci-i18n-base-zh-cn
,下载并上传


Plan B
opkg update
opkg install losetup resize2fs parted
parted -s /dev/sda resizepart 2 100%
losetup /dev/loop1 /dev/sda2
resize2fs -f /dev/loop1
reboot
· 全网最简单!3分钟用满血DeepSeek R1开发一款AI智能客服,零代码轻松接入微信、公众号、小程
· .NET 10 首个预览版发布,跨平台开发与性能全面提升
· 《HelloGitHub》第 107 期
· 从文本到图像:SSE 如何助力 AI 内容实时呈现?(Typescript篇)
· 全程使用 AI 从 0 到 1 写了个小工具
2022-07-31 VSCode Remote-SSH插件使用证书登陆远程服务器
2022-07-31 FAST-API 调取expect控制黑群晖开关机