惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
有赞技术团队
有赞技术团队
V
Visual Studio Blog
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
Vercel News
Vercel News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
D
DataBreaches.Net
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
The Cloudflare Blog
宝玉的分享
宝玉的分享
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog

Gary' Blog

Migrate pip to uv - Gary' Blog Terminal autocomplete (only macOS and Linux) Authentication FastAPI with Keycloak - Gary' Blog Keycloak configuration problems and solutions Careers and LinkedIn Jobs Page of Fortune 500 American Companies How to connect Windows desktop remotely using RDP and cloudflare ZeroTrust tunnel ESXi 8 issue solved: This PC can’t run Windows 11 How to download and license ESXi 8? Get clicked word using pure Javascript
How to expand the hard disk capacity of Debian/Ubuntu in ...
Gary · 2025-03-06 · via Gary' Blog

1 Go to ESXi dashboard, expand the hard disk to expected size. Here I will resize my disk from 203G to 1100G.

2 show current disk capacity

➜  ~ df -h
Filesystem             Size  Used Avail Use% Mounted on
...
/dev/sda1              203G  161G   32G  84% /
...

3 use parted to show and resize disk. You may need to install parted if it was not installed.

➜  ~ sudo parted
GNU Parted 3.5
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 1100GB <------------- LOOK HERE
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  222GB  222GB   primary   ext4            boot
 2      222GB   223GB  1022MB  extended
 5      222GB   223GB  1022MB  logical   linux-swap(v1)  swap

 (parted) resizepart  1                                                    
Warning: Partition /dev/sda1 is being used. Are you sure you want to continue?
Yes/No? Yes
End?  [222GB]? 1100GB
Error: Can't have overlapping partitions.
(parted)  

Here we can see Disk of /dev/sda is totally: 1100GB.

And I want to resize part 1 with command resizepart <part number>. But failed because there are 2 partition after it.

4 Backup your data and remove the following partition.

 # delete swap partition
sudo swapoff -a
sudo parted /dev/sda rm 5

# delete the extended partition
sudo parted /dev/sda rm 2

5 Resize

 # Resize /dev/sda1
 sudo parted /dev/sda resizepart 1 1100GB

 # Resize the Filesystem
 sudo resize2fs /dev/sda1

6 Then you can see:

➜  ~ df -h
Filesystem             Size  Used Avail Use% Mounted on
...
/dev/sda1             1007G  194G  771G  21% /
...