LoginSignup
13
9

More than 5 years have passed since last update.

CentOS7なインスタンスのルートボリューム拡張

Last updated at Posted at 2017-10-03

まったく覚えられないからめも。

CentOS7からデフォルトのファイルシステムはxfsになってた

# df -T
ファイルシス   タイプ   1K-ブロック    使用   使用可 使用% マウント位置
/dev/xvda1     xfs         52417516 3562912 48854604    7% /

(省略)

例に漏れずそのままだとルートボリュームは何Gのせても8Gなのである

# df -h
ファイルシス   サイズ  使用  残り 使用% マウント位置
/dev/xvda1       8.0G  3.6G  4.5G   44% /

(省略)

拡張手順

growpartいるかな

# rpm -qa | grep growpart
cloud-utils-growpart-0.29-2.el7.noarch

growpartする

# growpart /dev/xvda 1
CHANGED: partition=1 start=2048 old: size=16775168 end=16777216 new: size=104855519,end=104857567

xfs_growfsする

# xfs_growfs -d /
meta-data=/dev/xvda1             isize=512    agcount=4, agsize=524224 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=2096896, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 2096896 to 13106939

拡張されました

# df -h
ファイルシス   サイズ  使用  残り 使用% マウント位置
/dev/xvda1        50G  3.6G   47G    8% /

(省略)

ぐぐってたら、いきなりxfs_growfs して「data size unchanged, skipping」って言われる!って
言ってる人がいたけどgrowpartすれば大丈夫。
でももしかしてgrowpartってfdiskとかで終点変えるのと同じなんですかね。

13
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
9