我在EC2实例上安装了cPanel和WHm。

EC2 EBS容量为100GB
CentOS 6 x86_64(2014_09_29)EBS pv-1-adc4348e-1dc3-41df-b833-e86ba57a33d6-ami-809020e8.2(ami-bc8131d4)

这是df -h显示的内容:

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvde1      7.8G  6.6G  834M  89% /
tmpfs           3.7G     0  3.7G   0% /dev/shm
/usr/tmpDSK     485M   11M  449M   3% /tmp


EBS安装在/dev/sda

我正在尝试增加xvde1的大小以几乎填满100GB

当我运行resize2fs /dev/xvde1我得到这个:

root@vs1 [~]# resize2fs /dev/xvde1
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 2096896 blocks long.  Nothing to do!


我已经尝试过此处所述的解决方案:EC2 Can't resize volume after increasing size

但是当我重新启动实例时,它卡在1/2 Status Checks

我看到一些说明可以在16上启动分区,也可以使用与原始配置中相同的启动。这没有用。

这是一些我尝试过的其他信息:

root@vs1 [~]# resize2fs /dev/xvde1
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 2096896 blocks long.  Nothing to do!

root@vs1 [~]# resize2fs /dev/xvde
resize2fs 1.41.12 (17-May-2010)
resize2fs: Device or resource busy while trying to open /dev/xvde
Couldn't find valid filesystem superblock.
root@vs1 [~]# resize2fs /dev/xvde1
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 2096896 blocks long.  Nothing to do!

root@vs1 [~]# resize2fs /dev/xvde1 +25G
resize2fs 1.41.12 (17-May-2010)
The containing partition (or device) is only 2096896 (4k) blocks.
You requested a new size of 6553600 blocks.

root@vs1 [~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvde1      7.8G  6.6G  834M  89% /
tmpfs           3.7G     0  3.7G   0% /dev/shm
/usr/tmpDSK     485M   11M  449M   3% /tmp
root@vs1 [~]# resize2fs /dev/xvde1 +15g
resize2fs 1.41.12 (17-May-2010)
The containing partition (or device) is only 2096896 (4k) blocks.
You requested a new size of 3932160 blocks.

root@vs1 [~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvde1      7.8G  6.6G  834M  89% /
tmpfs           3.7G     0  3.7G   0% /dev/shm
/usr/tmpDSK     485M   11M  449M   3% /tmp

root@vs1 [~]# resize2fs /dev/xvde1
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 2096896 blocks long.  Nothing to do!

root@vs1 [~]# fdisk -l

Disk /dev/xvde: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00098461

    Device Boot      Start         End      Blocks   Id  System
/dev/xvde1   *           1        1045     8387584   83  Linux
root@vs1 [~]# Write failed: Broken pipe


这是耗时18个小时的完整构建的最后一步。

我可能只是精神错乱。任何和所有帮助将不胜感激!

编辑:

服务器上的系统日志显示了此信息,不确定是否有帮助:

Thread "main": pointer: 0x21e0003760, stack: 0x3740000
"main" "root=/dev/sda" "ro" "4"
vbd 2048 is hd0
******************* BLKFRONT for device/vbd/2048 **********


backend at /local/domain/0/backend/vbd/60/2048
209715200 sectors of 512 bytes
**************************
[H[J

    GNU GRUB  version 0.97  (7864320K lower / 0K upper memory)



[m[4;2H+-------------------------------------------------------------------------+[5;2H|[5;76H|[6;2H|[6;76H|[7;2H|[7;76H|[8;2H|[8;76H|[9;2H|[9;76H|[10;2H|[10;76H|[11;2H|[11;76H|[12;2H|[12;76H|[13;2H|[13;76H|[14;2H|[14;76H|[15;2H|[15;76H|[16;2H|[16;76H|[17;2H+-------------------------------------------------------------------------+[m

    Use the ^ and v keys to select which entry is highlighted.

    Press enter to boot the selected OS, 'e' to edit the

    commands before booting, or 'c' for a command-line.[5;78H [m[7m[5;3H CentOS (2.6.32-504.el6.x86_64)                                          [5;75H[m[m[6;3H CentOS (2.6.32-431.29.2.el6.x86_64)                                     [6;75H[m[m[7;3H                                                                         [7;75H[m[m[8;3H                                                                         [8;75H[m[m[9;3H                                                                         [9;75H[m[m[10;3H                                                                         [10;75H[m[m[11;3H                                                                         [11;75H[m[m[12;3H                                                                         [12;75H[m[m[13;3H                                                                         [13;75H[m[m[14;3H                                                                         [14;75H[m[m[15;3H                                                                         [15;75H[m[m[16;3H                                                                         [16;75H[m[16;78H [5;75H[23;4H The highlighted entry will be booted automatically in 1 seconds.   [5;75H[H[J  Booting 'CentOS (2.6.32-504.el6.x86_64)'



root (hd0,0)

 Filesystem type is ext2fs, partition type 0x83

kernel /boot/vmlinuz-2.6.32-504.el6.x86_64 ro root=LABEL=_ console=ttyS0,115200

 crashkernel=no SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=us

initrd /boot/initramfs-2.6.32-504.el6.x86_64.img



============= Init TPM Front ================
Tpmfront:Error Unable to read device/vtpm/0/backend-id during tpmfront initialization! error = ENOENT
Tpmfront:Info Shutting down tpmfront

最佳答案

要扩展JD的答案,请按照以下步骤操作:

df -h#打印启动分区的名称

lsblk#在所有块设备上显示信息

您将从输出中看到根分区的磁盘名称。例如,您可能会看到以下内容:
xvde 202:64 0 32G 0 disk└─xvde1 202:65 0 8G 0 part /

我们的目标是使xvde1使用xvde中的全部可用空间。
调整分区大小的方法如下:

fdisk /dev/xvda(磁盘名称,而不是您的分区)
这进入fdisk实用程序。


u#将显示更改为扇区
p#打印信息
d#删除分区
n#新分区
p#主分区
1#分区号
2048#第一部门
按Enter接受默认值
p#打印信息
a#切换可启动标志
1#选择分区1
w#将表写入磁盘并退出


现在,重新启动实例:
reboot

回来后,请执行以下操作:

resize2fs /dev/xvde1(您分区的名称,而不是块设备)

最后验证新磁盘的大小:
df -h

07-24 05:55