附加在 sda 的 EC2 存储是/dev/xvde1 无法调整大小 [英] EC2 Storage attached at sda is /dev/xvde1 cannot resize
问题描述
我有 cPanel &WHm 安装在 EC2 实例上.
I have cPanel & WHm installed on an EC2 instance.
EC2 EBS 卷为 100GBCentOS 6 x86_64 (2014_09_29) EBS pv-1-adc4348e-1dc3-41df-b833-e86ba57a33d6-ami-809020e8.2 (ami-bc8131d4)
The EC2 EBS volume is 100GB CentOS 6 x86_64 (2014_09_29) EBS pv-1-adc4348e-1dc3-41df-b833-e86ba57a33d6-ami-809020e8.2 (ami-bc8131d4)
这是 df -h 显示的内容:
This is what df -h shows:
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
I am trying to increase the size of the xvde1
to almost fill the 100GB
当我运行 resize2fs/dev/xvde1
我得到这个:
When I run resize2fs /dev/xvde1
i get this:
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增大尺寸
I have tried the solution stated here: EC2 Can't resize volume after increasing size
但是当我重新启动实例时,它会卡在 1/2 状态检查
But when i reboot the instance it gets stuck on 1/2 Status Checks
我看到了一些说明要在 16
上启动分区并使用与原始配置中相同的启动方式.这不起作用.
I saw something that stated to start the partition on 16
and also to use the same start as it is in the original configuration. This did not work.
这是我尝试过的更多信息和其他内容:
Here is some more information and other things that i have tried:
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 小时.
This is the last step in a complete build that has taken over 18 hours.
我可能只是精神错乱.任何和所有的帮助将不胜感激!
I may just be delirious. Any and all help will be greatly appreciated!
服务器上的系统日志显示这个,不确定是否有帮助:
The system log on the server shows this, not sure if it is any help:
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
推荐答案
此答案很危险,自 2016 年以来尚未经过验证,如果您不知道发生了什么,则可能会删除您的分区.谨慎使用,也请参考下面@Dmitry 的回答.
This answer is dangerous, hasn't been verified since 2016, and has the potential to delete your partition if you're not aware of what's happening. Use with caution, and please reference @Dmitry's answer below as well.
为了扩展 JD 的答案,这正是要做的事情:
To expand on JD's answer, here's exactly what to do:
df -h
#打印你的启动分区的名字
df -h
#print the name of your boot partition
lsblk
#显示所有块设备上的信息
lsblk
#show info on all your block devices
您将从该输出中看到您的根分区的磁盘名称.例如,您可能会看到如下内容:
You'll see from that output what the name of the disk is of your root partition. For example, you probably see something like this:
xvde 202:64 0 32G 0 disk
└─xvde1 202:65 0 8G 0 part /
我们的目标是让 xvde1
使用 xvde
的全部可用空间.以下是调整分区大小的方法:
Our goal is to make xvde1
use the whole available space from xvde
.
Here's how to resize your partition:
fdisk/dev/xvda
(磁盘名,不是你的分区)这将进入 fdisk
实用程序.
fdisk /dev/xvda
(the disk name, not your partition)
This enters into the fdisk
utility.
u
#将显示改为扇区p
#打印信息d
#删除分区n
#新建分区p
#主分区1
#分区号2048
#第一扇区- 按 Enter 接受默认值
p
#打印信息a
#切换可启动标志1
#选择分区1w
#将表写入磁盘并退出
u
#Change the display to sectorsp
#Print infod
#Delete the partitionn
#New partitionp
#Primary partition1
#Partition number2048
#First sector- Press Enter to accept the default
p
#Print infoa
#Toggle the bootable flag1
#Select partition 1w
#Write table to disk and exit
现在,重新启动您的实例:重启
Now, reboot your instance:
reboot
回来后做:
resize2fs/dev/xvde1
(你的分区名称,不是块设备)
resize2fs /dev/xvde1
(the name of your partition, not the block device)
最后验证新的磁盘大小:df -h
And finally verify the new disk size:
df -h
这篇关于附加在 sda 的 EC2 存储是/dev/xvde1 无法调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!