我创建了t2。来自rhel7 ami-f7f03d80 ami的微型实例,具有39gb gp2 xfs_ebs存储空间,并具有6gb/XFS文件系统和24gb的可用空间。我试着用xfs_growfs -d /
来调整分区大小,它说data size unchanged, skipping
。当我将-D 2572864
指定给xfs_growfs时,它显示为data size 2572864 too large, maximum is 1572864
。看起来我需要先调整分区的大小,然后再调整文件系统的大小,但是我不能在挂载的fs上这样做。我可以将fdisk和xfs_growfs打包到initrd,然后从它启动,但似乎太难了)似乎我错过了一些东西,可以用其他方式完成。谢谢。
感觉有点吓人(先拍个快照),但是:
fdisk /dev/YOURDEVICE
删除你的分区,创建一个新的分区占用整个磁盘,写入更改,重新启动。
我已经在RHEL 7上增加了gdisk的根分区空间
yum -y install gdisk sudo gdisk/dev/xvda删除所有分区
3)
Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): Y
4)使用n命令为设备上的每个分区创建一个新的分区条目。
Command (? for help): n
Partition number (1-128, default 1): 1
First sector (34-209715166, default = 2048) or {+-}size{KMGTP}: 2048
Last sector (2048-209715166, default = 209715166) or {+-}size{KMGTP}: 4095
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): EF02
Changed type of partition to 'BIOS boot partition'
Command (? for help): n
Partition number (2-128, default 2): 2
First sector (34-209715166, default = 4096) or {+-}size{KMGTP}: 4096
Last sector (4096-209715166, default = 209715166) or {+-}size{KMGTP}: 209715166
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 0700
Changed type of partition to 'Microsoft basic data'
5)使用w命令将更改写入设备并退出。
Expert command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!
Do you want to proceed? (Y/N): Y OK; writing new GUID partition table (GPT) to /dev/xvda. The operation has completed successfully.
6)重启系统7)重新启动后,您可以看到您的/root分区大小增加