当前位置:网站首页>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 .
边栏推荐
- Interpreting Tencent cloud product experience through user experience elements
- Does the user need a code signing certificate? What is the use of a code signing certificate
- Grp: how to add Prometheus monitoring in GRP service?
- What does the cloud desktop server do? What are the cloud desktop functions
- What is the price of the elastic public network IP bandwidth
- How to design a hybrid system
- How to check the progress of trademark registration? Where can I find it?
- How do I check the trademark registration number? Where do I need to check?
- What are the configuration requirements for cloud desktop servers? What are the main characteristics of the three points?
- What is the maximum bandwidth of EIP? Mbps how to modify the bandwidth of EIP
猜你喜欢

Ar 3D map technology

QT creator tips

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

Get to know MySQL database

Simple and beautiful weather code

On Sunday, I rolled up the uni app "uview excellent UI framework"
![[summary of interview questions] zj6 redis](/img/4b/eadf66ca8d834f049f3546d348fa32.jpg)
[summary of interview questions] zj6 redis
![[summary of interview questions] zj5](/img/d8/ece82f8b2479adb948ba706f6f5039.jpg)
[summary of interview questions] zj5

Community pycharm installation visual database
![[51nod] 3216 Awards](/img/94/fdb32434d1343040d711c76568b281.jpg)
[51nod] 3216 Awards
随机推荐
What does the cloud desktop server do? What are the cloud desktop functions
What does elastic scaling of cloud computing mean? What are the application scenarios for elastic scaling of cloud computing?
Windowsvpn client is coveted by vulnerabilities, 53% of companies face supply chain attacks | global network security hotspot
Tencent Mu Lei: real scene 3D linking industrial Internet and consumer Internet
Dry goods how to build a data visualization project from scratch?
How does the fortress machine connect to the server? Which is easy to use, fortress machine or firewall?
Go program lifecycle
Does the user need a code signing certificate? What is the use of a code signing certificate
Understanding Devops from the perspective of decision makers
What is distributed configuration center Nacos? What are the functions of distributed configuration center Nacos?
What is the principle of intelligent image recognition? What are the applications of intelligent image recognition?
Principle of efficient animation Implementation-A preliminary exploration of jetpack compose
Actual battle case | refuse information disclosure, Tencent cloud helps e-commerce fight against web crawlers
Micro build low code enterprise exchange day · Shenzhen station opens registration
JD Logistics: from giant baby to mainstay
[Tencent cloud] how can the MySQL database on the cloud fully back up the data base script?
Cloud development RMB 1 purchase activity is in progress
Grpc: how do I start multiple ports?
Coding Ci of Devops
No monitoring information seen in kibana