2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vagrant/CentOS7でのディスク拡張

Last updated at Posted at 2017-02-15

Vagrant上のCentOS7のディスク容量の際、一手間かかったのでメモ。

参考。
http://qiita.com/koitaro/items/c8bf8eb1e67e78890a5c

Vagrantから起動してログイン、確認。

[root@localhost vagrant]# df -h
ファイルシス            サイズ  使用  残り 使用% マウント位置
/dev/mapper/centos-root   8.3G  2.0G  6.4G   24% /
devtmpfs                  911M     0  911M    0% /dev
tmpfs                     921M     0  921M    0% /dev/shm
tmpfs                     921M  8.3M  912M    1% /run
tmpfs                     921M     0  921M    0% /sys/fs/cgroup
/dev/sda1                 497M  164M  334M   33% /boot
none                      931G  212G  719G   23% /vagrant
tmpfs                     185M     0  185M    0% /run/user/1000
[root@localhost vagrant]# lvextend -l +100%FREE /dev/mapper/centos-root
  Size of logical volume centos/root changed from 8.26 GiB (2114 extents) to 18.53 GiB (4744 extents).
  Logical volume root successfully resized.
[root@localhost vagrant]# xfs_growfs /dev/mapper/centos-root
meta-data=/dev/mapper/centos-root isize=256    agcount=4, agsize=541184 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=2164736, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
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 2164736 to 4857856

無事に拡がりました。

[root@localhost vagrant]# df -h
ファイルシス            サイズ  使用  残り 使用% マウント位置
/dev/mapper/centos-root    19G  2.0G   17G   11% /
devtmpfs                  911M     0  911M    0% /dev
tmpfs                     921M     0  921M    0% /dev/shm
tmpfs                     921M  8.3M  912M    1% /run
tmpfs                     921M     0  921M    0% /sys/fs/cgroup
/dev/sda1                 497M  164M  334M   33% /boot
none                      931G  212G  719G   23% /vagrant
tmpfs                     185M     0  185M    0% /run/user/1000

参考:
http://qiita.com/fetaro/items/d7dc74262633ba474bc8

2
5
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
2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?