无法在EC2 centos上调整根分区的大小

阿黛尔·艾哈迈德(Adeel Ahmad)

我使用Centos 6.3 x64的社区映像创建了EC2计算机。我添加了一个35 GB的磁盘。现在当我做#df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            7.9G  1.2G  6.4G  16% /
tmpfs                 7.3G     0  7.3G   0% /dev/shm

我的磁盘是35GB,但它的根目录显示为8 GB,tmpfs显示为7。

我试图使用resize2fs,但是在centos上没有用。磁盘具有ext4分区。

# resize2fs /dev/xvda
resize2fs 1.41.12 (17-May-2010)
resize2fs: Device or resource busy while trying to open /dev/xvda
Couldn't find valid filesystem superblock.

甚至即使我尝试了resize2fs / dev / xvda1,它也表示设备无关。

任何想法或其他方式,都是我的根磁盘(/)。所以不能卸下它。

阿黛尔·艾哈迈德(Adeel Ahmad)

我找到了一种方法,如果不确定原因为何resize2fs无法正常工作,但是它说设备或资源繁忙。我在fdisk上找到了一篇有关resizeisk的很好的文章,我们可以通过删除和创建块并使分区可启动来增加块的大小。它所需要的只是重新启动。如果您使用相同的启动气缸,它将不会影响您的数据。

# df -h  <<1>>

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      6.0G  2.0G  3.7G  35% / 
tmpfs            15G     0   15G   0% /dev/shm

# fdisk -l  <<2>>

Disk /dev/xvda: 21.5 GB, 21474836480 bytes
97 heads, 17 sectors/track, 25435 cylinders
Units = cylinders of 1649 * 512 = 844288 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003b587

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           2        7632     6291456   83  Linux

# fdisk /dev/xvda  <<3>>

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): u  <<4>>
Changing display/entry units to sectors

Command (m for help): p  <<5>>

Disk /dev/xvda: 21.5 GB, 21474836480 bytes
97 heads, 17 sectors/track, 25435 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003b587

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *        2048    12584959     6291456   83  Linux

Command (m for help): d  <<6>>
Selected partition 1

Command (m for help): n  <<7>>
Command action
   e   extended
   p   primary partition (1-4)
p  <<8>>
Partition number (1-4): 1  <<9>>
First sector (17-41943039, default 17): 2048  <<10>>
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): <<11>>
Using default value 41943039

Command (m for help): p <<12>>

Disk /dev/xvda: 21.5 GB, 21474836480 bytes
97 heads, 17 sectors/track, 25435 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003b587

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1            2048    41943039    20970496   83  Linux

Command (m for help): a  <<13>>
Partition number (1-4): 1  <<14>>


Command (m for help): w  <<15>>
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

# reboot  <<16>>

<wait>

# df -h  <<17>>
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       20G  2.0G   17G  11% / 
tmpfs            15G     0   15G   0% /dev/shm

# resize2fs /dev/xvda1  <<18>>
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 5242624 blocks long.  Nothing to do!

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

无法在EC2 centos上调整根分区的大小

来自分类Dev

无法在CentOS 7上调整主分区的大小

来自分类Dev

即使在实时环境中也无法调整根分区的大小!

来自分类Dev

亚马逊EC2上的ncftpget无法正常工作(centos)

来自分类Dev

sda上连接的EC2存储为/ dev / xvde1,无法调整大小

来自分类Dev

调整LVM2 PV CentOS分区的大小

来自分类Dev

如何腾出空间来调整根(/)分区的大小?根目录上没有可用空间,无法卸载软件也无法更新

来自分类Dev

在活动安装的系统上调整根分区大小的解决方案

来自分类Dev

在活动安装的系统上调整根分区大小的解决方案

来自分类Dev

在GParted中调整根分区的大小

来自分类Dev

无法修复“提供的执行角色没有在EC2上调用CreateNetworkInterface的权限”

来自分类Dev

无法卸载或调整分区大小

来自分类Dev

无法调整NTFS分区的大小

来自分类Dev

使用boto3调整EC2实例的大小

来自分类Dev

通过Amazon EC2 .NET API调整实例大小

来自分类Dev

从主分区空间调整根分区大小 ubuntu 18.04

来自分类Dev

Amazon EC2实例上的分区

来自分类Dev

EC2实例磁盘分区

来自分类Dev

Amazon EC2实例卷大小

来自分类Dev

如何在Debian中调整根分区的大小?

来自分类Dev

GParted无法调整逻辑分区的大小

来自分类Dev

调整大小后无法挂载Windows分区

来自分类Dev

Gparted无法调整扩展或LVM分区的大小

来自分类Dev

我无法调整主分区的大小

来自分类Dev

无法在Ubuntu下调整Win分区的大小

来自分类Dev

Ubuntu LVM无法看到分区调整大小

来自分类Dev

无法调整OS X分区的大小

来自分类Dev

df无法识别正在调整大小的分区?

来自分类Dev

调整大小的分区无法识别新空间

Related 相关文章

热门标签

归档