附加在sda的EC2存储为/ dev / xvde1无法调整大小 [英] EC2 Storage attached at sda is /dev/xvde1 cannot resize

查看:1823
本文介绍了附加在sda的EC2存储为/ dev / xvde1无法调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有cPanel&



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显示的内容:

 文件系统大小使用可用性%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 / p>

  root @ vs1 [〜]#resize2fs / dev / xvde1 
resize2fs 1.41.12(2010年5月17日)
文件系统已经是2096896块长。没事做!

我试过这里说的解决方案: EC2在增加大小后无法调整卷大小



重新启动它遇到的实例 1/2状态检查



我看到一些声明要启动分区 16 ,并使用与原始配置中相同的开头。这不行。



这里是我尝试过的一些更多的信息和其他事情:

  root @ vs1 [〜]#resize2fs / dev / xvde1 
resize2fs 1.41.12(2010年5月17日)
文件系统已经是2096896块长。没事做!

root @ vs1 [〜]#resize2fs / dev / xvde
resize2fs 1.41.12(2010年5月17日)
resize2fs:设备或资源在尝试打开/ dev / xvde
找不到有效的文件系统超级块。
root @ vs1 [〜]#resize2fs / dev / xvde1
resize2fs 1.41.12(2010年5月17日)
文件系统已经是2096896块长。没事做!

root @ vs1 [〜]#resize2fs / dev / xvde1 + 25G
resize2fs 1.41.12(2010年5月17日)
包含的分区2096896(4k)块。
您请求了一个新的大小为6553600块。

root @ vs1 [〜]#df -h
文件系统大小已用可用性%已安装在
/ 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(2010年5月17日)
包含的分区(或设备)只有2096896(4k)个块。
您请求了一个新的大小3932160块。

root @ vs1 [〜]#df -h
文件系统大小已用可用性%已安装在
/ 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(2010年5月17日)
文件系统已经是2096896块长。没事做!

root @ vs1 [〜]#fdisk -l

磁盘/ dev / xvde:107.4 GB,107374182400字节
255磁头,63扇区/磁道,13054气缸
单位= 16065 * 512 = 8225280字节的气缸
扇区大小(逻辑/物理):512字节/ 512字节
I / O大小(最小/最佳):512字节/ 512字节
磁盘标识符:0x00098461

设备引导开始结束块标识系统
/ dev / xvde1 * 1 1045 8387584 83 Linux
root @ vs1 [〜]#Write失败:管道损坏

这是完成构建的最后一步,已经用了18个小时。 / p>

我可能只是妄想。



服务器上的系统日志显示了这一点,不确定是否有任何帮助:

 线程main:指针:0x21e0003760,stack:0x3740000 
main root = / dev / sdaro4
vbd 2048是hd0
******************* BLKFRONT用于设备/ vbd / 2048 **********


后端在/ local / domain / 0 / backend / vbd / 60/2048
209715200扇区的512字节
**************************
[H [J

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



[m [4; 2H + -------------------- -------------------------------------------------- --- [5; 2H | [5; 76H] - [6; 2H | [6; 76H] - [7,2H] 9; 76H | [10; 2H | [10; 76H] [11; 2H | [11; 76H] 14; 76H | [15; 2H | [15; 76H] [16; 2H | [16; 76H] -------------------------------------------------- - + [m

使用^和v键选择突出显示的条目。

按Enter键引导所选的操作系统,'e'在引导前编辑

命令,或者对命令行编辑'c'[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; 3 H] [7; 75H [m] [8 [3 H] [8; 75H [m [ [11; 3 H [11; 75H [m [12 [3H] - [12; 75H [m [13 C] ; 3H [15; 75H [m [m] [16; 3H [16; 75H [m] [16; 78H [5; 75H [23; 4H]高亮条目将在1秒内自动启动。 [5; 75H [H [J Booting'CentOS(2.6.32-504.el6.x86_64)'



root(hd0,0)

文件系统类型为ext2fs,分区类型为0x83

内核/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:错误在tpmfront初始化期间无法读取设备/ vtpm / 0 / backend-id! error = ENOENT
Tpmfront:Info关闭tpmfront


解决方案

p>要扩展JD的答案,这里就是做什么:



df -h #print您的引导分区



lsblk #s显示所有块设备的信息



您将从该输出看到您的根分区的磁盘名称。例如,你可能看到这样的:

xvde 202:64 0 32G 0磁盘
└─xvde1202:65 0 8G 0部分/



我们的目标是让 xvde1 c $ c> xvde 。
以下是调整分区大小的方法:



fdisk / dev / xvda 您的分区)
这进入 fdisk 实用程序。


  1. code> u #将显示更改为部门

  2. p #打印信息

  3. d #删除分区

  4. n #New partition


  5. p #Primary partition
  6. #Partition number
  7. 2048 #第一部门


  8. 输入以接受默认值
  9. a #Toggle the bootable flag
  10. 1 #Select partition 1

  11. w #将表格写入磁碟并退出

您的实例:
重新启动



返回后:



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



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


I have cPanel & WHm installed on an EC2 instance.

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)

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

The EBS is mounted at /dev/sda

I am trying to increase the size of the xvde1 to almost fill the 100GB

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!

I have tried the solution stated here: EC2 Can't resize volume after increasing size

But when i reboot the instance it gets stuck on 1/2 Status Checks

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

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!

EDIT:

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

解决方案

To expand on JD's answer, here's exactly what to do:

df -h #print the name of your boot partition

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 /

Our goal is to make xvde1 use the whole available space from xvde. Here's how to resize your partition:

fdisk /dev/xvda (the disk name, not your partition) This enters into the fdisk utility.

  1. u #Change the display to sectors
  2. p #Print info
  3. d #Delete the partition
  4. n #New partition
  5. p #Primary partition
  6. 1 #Partition number
  7. 2048 #First sector
  8. Press Enter to accept the default
  9. p #Print info
  10. a #Toggle the bootable flag
  11. 1 #Select partition 1
  12. w #Write table to disk and exit

Now, reboot your instance: reboot

After it comes back do:

resize2fs /dev/xvde1 (the name of your partition, not the block device)

And finally verify the new disk size: df -h

这篇关于附加在sda的EC2存储为/ dev / xvde1无法调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆