linux xfs调整inode大小,redhat – 如何增加XFS文件系统的大小?

有趣的是,我在EC2上找到我的RHEL实例之后的另一天就完成了这一点,只有6GB左右的10GB空间分配给它…

[root@ip-172-31-20-177 ~]# xfs_info /

Meta-data=/dev/xvda1 isize=256 agcount=4,rtextents=0

这里的问题是你创建了第二个分区.

相反,您应该调整第一个分区的大小.

因此,您将使用fdisk删除第二个分区,然后同时删除并重新创建第一个分区. fdisk默认值将使其填充磁盘(并正确对齐).

启动fdisk并删除分区:

[root@ip-172-31-20-177 ~]# fdisk /dev/xvda

Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only,until you decide to write them.

Be careful before using the write command.

Command (m for help): p

Disk /dev/xvda: 10.7 GB,20971520 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 label type: dos

Disk identifier: 0x0000b85c

Device Boot Start End Blocks Id System

/dev/xvda1 * 2048 12584959 6291456 83 Linux

Command (m for help): d

Selected partition 1

Partition 1 is deleted

现在使用所有默认值重新创建分区,这将最大化其大小:

Command (m for help): n

Partition type:

p primary (0 primary,0 extended,4 free)

e extended

Select (default p): p

Partition number (1-4,default 1):

First sector (2048-20971519,default 2048):

Using default value 2048

Last sector,+sectors or +size{K,M,G} (2048-20971519,default 20971519):

Using default value 20971519

Partition 1 of type Linux and of size 10 GiB is set

Command (m for help): p

Disk /dev/xvda: 10.7 GB,20971520 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 label type: dos

Disk identifier: 0x0000b85c

Device Boot Start End Blocks Id System

/dev/xvda1 2048 20971519 10484736 83 Linux

保存新分区表:

Command (m for help): w

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.

重新启动时,应该通过cloud-init自动为您调整文件系统的大小.如果没有,您可以使用xfs_growfs /手动扩展文件系统.

[root@ip-172-31-20-177 ~]# xfs_info /

Meta-data=/dev/xvda1 isize=256 agcount=7,projid32bit=1

= crc=0

data = bsize=4096 blocks=2621184,rtextents=0

[root@ip-172-31-20-177 ~]# df

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/xvda1 10474496 818560 9655936 8% /

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值