当前位置:网站首页>Disk partition extension using graphical interface and PowerShell code
Disk partition extension using graphical interface and PowerShell code
2022-06-24 03:26:00 【shawyang】
Offline , Buy a 1T The mobile hard disk , Divide up 250G The partition , Explorer display 250G, Where is the rest of the disk space ? Empty space displayed in disk manager .
On the cloud , Take a snapshot of the disk 250G, bought 300G Data disk , The explorer must show 250G, Open disk manager to view the remaining space .
For example, I had a piece before 100G The data disk takes a snapshot ( There are 49G、51G 2 Zones ), I bought it with this snapshot today 1 block 110G Data disk of , What you see in the disk manager is the previous 100G Partition , That is, a 49G、 One 51G, remainder 10G Open the disk manager to see , If I want to put the blank 10G Add to 51G Zoning , Then I am 51G Right click in the blank space of the partition " Expand volume "
If you use powershell If you order
# The above figure is an example to specify the disk number and its partition code , The first 2 Block disk (disk 1) Of the 2 Zones (part 2)
# The disk number and partition number here should correspond to your actual situation , Do not copy mechanically
# Corresponding to your actual situation , If your snapshot is 1 Primary partitions , The disk you bought is larger than the disk space you used for snapshots 、 Want to add the blank space to the previous partition , Then change the partition number to 1
$disknum=1
$partnum=2
$datapan = @"
sel disk $disknum
online disk NOERR
attr disk clear readonly NOERR
sel part $partnum
extend
san policy=onlineall
"@
$datapan >> C:\diskpart_log.txt;
"$(get-date -format "[yyyy-MM-dd HH:mm:ss:ffffff]") " >> C:\diskpart_log.txt;
$datapan|diskpart 2>&1 >> C:\diskpart_log.txt;
# Corresponding to your actual situation , If your snapshot is 1 Zones , The disk you bought is larger than the disk space you used for snapshots 、 Want to add the blank space to the previous partition , Then change the partition number to 1, as follows
$disknum=1
$partnum=1
$datapan = @"
sel disk $disknum
online disk NOERR
attr disk clear readonly NOERR
sel part $partnum
extend
san policy=onlineall
"@
$datapan >> C:\diskpart_log.txt;
"$(get-date -format "[yyyy-MM-dd HH:mm:ss:ffffff]") " >> C:\diskpart_log.txt;
$datapan|diskpart 2>&1 >> C:\diskpart_log.txt;
With Administrator Open as Administrator powershell, Copy the above code in powershell Just execute .
If it's multiple machines , Sure Use RDM Batch remote After that, copy and paste it on each machine .
边栏推荐
- Industrial security experts talk about how to build security protection capability for government big data platform?
- RI Geng series: write a simple shell script, but it seems to have technical content
- Elk7.15.1 installation, deployment and construction
- How to access the cloud game management server? Which cloud game management server can I choose?
- US Treasury secretary says extortion software poses a threat to the economy, Google warns 2billion chrome users | global network security hotspot
- What does cloud computing elasticity mean? What are its functions?
- How to choose excellent server hosting or server leasing in Beijing
- RI Geng series: tricks of using function pointers
- Micro build low code enterprise exchange day · Shenzhen station opens registration
- Why can't cloud games connect to the server? What if the cloud game fails to connect to the server?
猜你喜欢
![[summary of interview questions] zj6 redis](/img/4b/eadf66ca8d834f049f3546d348fa32.jpg)
[summary of interview questions] zj6 redis

Get to know MySQL database
![[51nod] 3216 Awards](/img/94/fdb32434d1343040d711c76568b281.jpg)
[51nod] 3216 Awards
![[summary of interview questions] zj5](/img/d8/ece82f8b2479adb948ba706f6f5039.jpg)
[summary of interview questions] zj5

Simple and beautiful weather code

QT creator tips

Sorting out of key vulnerabilities identified by CMS in the peripheral management of red team (I)

Community pycharm installation visual database

On Sunday, I rolled up the uni app "uview excellent UI framework"

Ar 3D map technology
随机推荐
[hot] with a budget of only 100 yuan, how to build a 1-year web site on Tencent cloud??
Get to know MySQL database
Why can't the fortress machine log in? What are the ways to solve the problem
Use Charles to capture the package of the applet through the mobile agent
TRTC audio quality problem
Why should I change my PC to a cloud desktop server? What are the characteristics of this server?
What is the use of cloud desktop security server configuration? What should I do?
Ner's past, present and future Overview - past
Principle of efficient animation Implementation-A preliminary exploration of jetpack compose
Under what circumstances do you need a fortress machine? What are the functions of a fortress machine
Grpc: implement service end flow restriction
Go program lifecycle
What are the functions of Fortress machine equipment
What is the difference between elasticity and scalability of cloud computing? What does elastic scaling of cloud computing mean?
Hunan data security governance Summit Forum was held, and Tencent built the best practice of government enterprise data security
How to design a hybrid system
New Google brain research: how does reinforcement learning learn to observe with sound?
Tke accesses the cluster through kubectl in pod
How to handle the uplink and downlink silence of TRTC
What aspects does the intelligent identification system include? Is the technology of intelligent identification system mature now?