Skip to content

Commit 0da4ea9

Browse files
committed
fix: 添加webvirtcloud扩展硬盘大小的方法
1 parent c68fa31 commit 0da4ea9

File tree

4 files changed

+87
-5
lines changed

4 files changed

+87
-5
lines changed

docs/en/incomplete/images/resize.jpg

36 KB
Loading

docs/en/incomplete/webvirtcloud_retspen.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,56 @@ The default login for the image is:
103103
- **Username**: `root`
104104
- **Password**: `password` or `oneclickvirt`
105105

106+
107+
After booting, you will find that the hard disk is only the size of the original image, at this time you need to adjust the size of the hard disk, you need to shut down the computer again, at this time, you can see the buttons on the following page is available and the size of the hard disk is also recognized.
108+
109+
Without the first boot, the size of the hard disk is not recognized, recognition can not be modified, so the first switch is necessary.
110+
111+
![resize](images/resize.jpg)
112+
113+
After the modification and restart the virtual machine, you will find that there is new disk space unallocated, at this time you need to follow the following method broad disk.
114+
115+
Check the disk path and remaining blank space unallocated:
116+
117+
```shell
118+
lsblk
119+
```
120+
121+
Then use the following command to broaden the disk
122+
123+
```shell
124+
fdisk /dev/vda
125+
```
126+
127+
Do this in the following order:
128+
129+
Type ```d``` to delete the old partition (yes, you need to delete the old vda1, no data will be lost as it will not be formatted later).
130+
131+
Type ```n``` and enter to create a new partition.
132+
133+
Select primary for type (default p) and just enter.
134+
135+
Partition number is also ```1```.
136+
137+
The start position must be the same as the old partition (default is right), just press enter.
138+
139+
Show if you want to erase fingerprints, type ```Y``` and enter.
140+
141+
Press enter at the end position to use all the remaining space.
142+
143+
Type ```w``` to save and exit.
144+
145+
At this point, use ```lsblk``` to confirm that the new free disk has been successfully allocated.
146+
106147
## Disadvantages
107148

108149
Networking is not auto-configured — not as smart as the previous project — you still need to configure it manually.
109150

110-
111151
You need to be in the VNC of the opened VM, logged in and execute
112152

113153
```shell
114-
systemctl start cloud-init
154+
systemctl enable cloud-init
155+
reboot
115156
```
116157

117-
Enable the configuration manually.
158+
Manually enable the configuration to self-start after reboot, then reboot the server and you have internet.

docs/incomplete/images/resize.jpg

36 KB
Loading

docs/incomplete/webvirtcloud_retspen.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,55 @@ chmod 777 debian12.qcow2
110110

111111
镜像的默认登录的用户名是```root```,密码是```password```或者是 ```oneclickvirt```
112112

113+
开机后,你会发现硬盘只有原始镜像的大小,此时需要调整硬盘大小,需要再次关机,此时能见到下图页面的按钮可用且硬盘大小也识别出来了。
114+
115+
没有经过首次开机,硬盘的大小是识别不出来的,识别不出来就不能进行修改,所以首次开关机是必须的。
116+
117+
![resize](images/resize.jpg)
118+
119+
修改后重启虚拟机,会发现有新的盘空间未分配,此时需要按照下面的方法阔盘。
120+
121+
查看盘路径和剩余空白空间未分配的:
122+
123+
```shell
124+
lsblk
125+
```
126+
127+
然后使用下述命令阔盘
128+
129+
```shell
130+
fdisk /dev/vda
131+
```
132+
133+
按以下顺序操作:
134+
135+
输入```d```删除旧的分区(是的,需要删除旧的 vda1,数据不会丢失,因为后面不会格式化)。
136+
137+
输入```n```后回车新建一个分区。
138+
139+
类型选 primary(默认 p),直接回车就行
140+
141+
分区号同样选```1```
142+
143+
起始位置必须和旧分区一样(默认是对的)按回车就行
144+
145+
显示是否需要擦除指纹,输入```Y```回车
146+
147+
结束位置直接按回车,使用全部剩余空间
148+
149+
输入```w```保存并退出。
150+
151+
此时再使用```lsblk```可确认新的空闲硬盘被分配成功了。
152+
113153
## 缺点
114154

115155
网络还是没有自动配置,不如上一个项目智能,还得手动配置一下。
116156

117157
需要在已经开好的虚拟机的VNC中,登录后执行
118158

119159
```shell
120-
systemctl start cloud-init
160+
systemctl enable cloud-init
161+
reboot
121162
```
122163

123-
手动启用配置
164+
手动启用配置为重启后自启动,然后重启服务器,就有网了

0 commit comments

Comments
 (0)