Ubuntu使用未分割的硬碟區域

因為 growpart 是用來擴展分割區(partition)的,但從你的 lsblk 輸出來看:

1
sdb       8:16   0    1T  0 disk /home

sdb 是整顆磁碟直接掛載/home,底下沒有任何分割區(沒有 sdb1 之類的)。所以 growpart 在這裡不適用。

如果你的目的是擴展 /home 的檔案系統(例如雲端供應商幫你把 sdb 從小容量擴大到 1T),你應該直接對整顆磁碟做 resize2fs(假設是 ext4):

1
2
3
4
5
# 先確認檔案系統類型
df -Th /home

# 如果是 ext4
sudo resize2fs /dev/sdb

這樣就能讓檔案系統擴展到磁碟的完整大小。

如果硬碟沒有分割區,可以用以下指令擴大硬碟區域:
https://unix.stackexchange.com/questions/643026/how-to-resize-a-disk-without-partition

首先查看系統是否已經辨識到新空間

1
fdisk -l /dev/<device>
1
2
# resize2fs /dev/[DISK_ID][PARTITION_NUMBER]
resize2fs /dev/sdc

https://tech.sars.tw/posts/gcp-linux-enlarge-disk-size/

https://www.tecmint.com/parted-command-create-linux-partitions/

https://godleon.github.io/blog/Linux/Linux-extend-lvm-from-unused-space/

LVM說明
https://linux.vbird.org/linux_basic_train/centos8/unit14.php

Author

Steven

Posted on

2024-10-07

Updated on

2026-03-20

Licensed under

Comments