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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
罗磊的独立博客
Last Week in AI
Last Week in AI
爱范儿
爱范儿
The Cloudflare Blog
有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
IT之家
IT之家
博客园 - 【当耐特】
雷峰网
雷峰网
博客园_首页
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
阮一峰的网络日志
阮一峰的网络日志
量子位
V
V2EX

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% /
...