简体   繁体   English

并非所有存储都可用于Amazon EBS

[英]Not all storage is available for Amazon EBS

I'm sure the problem appears because of my misunderstanding of Ec2+EBS configuring, so answer might be very simple. 我确定问题是由于我对Ec2 + EBS配置的误解而出现的,因此答案可能非常简单。

I've created RedHat ec2 instance on the Amazon WS with 30GB EBS storage. 我已经在具有30GB EBS存储的Amazon WS上创建了RedHat ec2实例。 But lsblk shows me, that only 6GB of total 30 is available for me: 但是lsblk显示给我,总共30个中只有6GB可供我使用:

xvda    202:0    0  30G  0 disk
└─xvda1 202:1    0   6G  0 part /

How can I mount all remaining storage space to my instance? 如何将所有剩余的存储空间安装到实例上?

[UPDATE] commands output: [UPDATE]命令输出:

mount : mount

/dev/xvda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

sudo fdisk -l /dev/xvda : sudo fdisk -l /dev/xvda

WARNING: GPT (GUID Partition Table) detected on '/dev/xvda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/xvda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 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: 0x00000000

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1               1        1306    10485759+  ee  GPT

resize2fs /dev/xvda1 : resize2fs /dev/xvda1

resize2fs 1.41.12 (17-May-2010)
The filesystem is already 1572864 blocks long.  Nothing to do!

I believe you are experiencing an issue that seems specific to EC2 and RHEL* where the partition won't extend using the standard tools. 我相信您遇到的问题似乎是EC2和RHEL *特有的,该分区无法使用标准工具进行扩展。

If you follow the instructions of this previous answer you should be able to extend the partition to use the full space. 如果您遵循此先前答案的说明,则应该能够扩展分区以使用全部空间。 Follow the instructions particularly carefully if expanding the root partition! 如果扩展根分区,请特别小心地遵循指示!

unable to resize root partition on EC2 centos 无法在EC2 centos上调整根分区的大小

If you update your question with the output of fdisk -l /dev/xvda and mount it should help provide any extra information if the following isnt suitable: 如果使用fdisk -l /dev/xvda的输出更新问题并进行mount ,则在以下情况不适合时,它应该有助于提供任何其他信息:

I would assume that you could either re-partition xvda to provision the space for another mount point (/var or /home for example) or grow your current root partition into the extra space available - you can follow this guide here to do this 我假设您可以重新分区xvda以便为另一个安装点(例如/ var或/ home)提供空间,或者将当前的根分区扩展到可用的额外空间-您可以按照此指南进行操作

Obviously be sure to back up any data you have on there, this is potentially destructive! 显然,一定要备份那里的所有数据,这可能会造成破坏!

[Update - how to use parted] [更新-如何使用parted]

The following link will talk you through using GNU Parted to create a partition, you will essentially just need to create a new partition, then I would temporarily mount this to a directory such as /mnt/newhome, copy across all of the current contents of /home (recursively as root keeping permissions with cp -rp /home/* /mnt/newhome ), then I would rename the current /home to /homeold, then make sure you have set up Fstab to have the correct entry: (assuming your new partition is /dev/xvda2) 以下链接将指导您使用GNU Parted创建分区,您基本上只需要创建一个新分区,然后将其临时挂载到/ mnt / newhome之类的目录中,并在其中复制所有当前内容。 / home(使用cp -rp /home/* /mnt/newhome递归作为root保留权限),然后将当前的/ home重命名为/ homeold,然后确保已将Fstab设置为具有正确的条目:(假设您的新分区是/ dev / xvda2)

/dev/xvda2    /home    /ext4     noatime,errors=remount-ro 0     1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM