我之前有一个分区/dev/sdb
只有 100 GB(只有 1 个虚拟分区:)/dev/sdb1
。现在,/dev/sdb
已经增加到480GB但我也不知道如何增加到/dev/sdb1
480 GB。
我尝试分开:
sudo umount /dev/sdb1
sudo parted /dev/sdb resizepart 1 483000M
然后再次检查:
$ sudo parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) select /dev/sdb1
Using /dev/sdb1
(parted) print
Model: Unknown (unknown)
Disk /dev/sdb1: 483GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 483GB 483GB ext4
然而,随着df-hP 它仍然显示 /dev/sdb1 为 100 GB。
Filesystem Size Used Avail Use% Mounted on
udev 2.0G 8.0K 2.0G 1% /dev
tmpfs 396M 936K 395M 1% /run
/dev/sda1 59G 5.7G 51G 11% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 2.0G 144K 2.0G 1% /run/shm
none 100M 32K 100M 1% /run/user
auto_in_data 8.2T 7.3T 939G 89% /media/sf_auto_in_data
/dev/sdb1 99G 70G 25G 75% /rasdata
那么我还缺少什么才能用 480GB来df -hP
显示呢?/dev/sdb1
答案1
您更改了分区大小,但没有调整其上文件系统的大小。要执行此操作,请使用:
sudo resize2fs /dev/sdb1
答案2
答案是我需要在分手后运行这个命令:)
sudo resize2fs /dev/sdb1
resize2fs 1.42.9 (4-Feb-2014)
Filesystem at /dev/sdb1 is mounted on /rasdata; on-line resizing required
old_desc_blocks = 7, new_desc_blocks = 29
The filesystem on /dev/sdb1 is now 117919666 blocks long.
然后,使用 df -hP 检查
/dev/sdb1 443G 70G 355G 17% /rasdata