运维问题.解决亚马逊EC2云主机resize2fs /dev/xvde调整分区失败问题?

问题原因:

[root@xm-server-50010 xm-bash]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/xvde1      7.9G  1.7G  5.9G  22% /

tmpfs           1.9G     0  1.9G   0% /dev/shm

/dev/xvdj1      492G  205M  467G   1% /xm-workspace

[root@xm-server-50010 xm-bash]# 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.


解决办法:

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

u #Change the display to sectors

p #Print info

d #Delete the partition

n #New partition

p #Primary partition

1 #Partition number

2048 #First sector

Press Enter to accept the default

p #Print info

a #Toggle the bootable flag

1 #Select partition 1

w #Write table to disk and exit

reboot

[root@xm-server-50010 xm-workspace]# resize2fs /dev/xvde1

resize2fs 1.41.12 (17-May-2010)

Filesystem at /dev/xvde1 is mounted on /; on-line resizing required

old desc_blocks = 1, new_desc_blocks = 4

Performing an on-line resize of /dev/xvde1 to 13106944 (4k) blocks.

The filesystem on /dev/xvde1 is now 13106944 blocks long.

[root@xm-server-50010 xm-workspace]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/xvde1       50G  1.6G   46G   4% /

tmpfs           1.9G     0  1.9G   0% /dev/shm

/dev/xvdj1      492G  205M  467G   1% /xm-workspace


相关文档:

http://stackoverflow.com/questions/26770655/ec2-storage-attached-at-sda-is-dev-xvde1-cannot-resize

转载于:https://my.oschina.net/pydevops/blog/626514

你可能感兴趣的:(运维问题.解决亚马逊EC2云主机resize2fs /dev/xvde调整分区失败问题?)