LoginSignup
17
17

More than 5 years have passed since last update.

CentOS7 minimalインストール後、自動作成の/homeを削除して/(ルート)に統合

Last updated at Posted at 2014-09-28

CentOSでテキストモードでインストールした時、パーティションが勝手に切られて/(ルート)が50Gで、それ以外はhomeに振られてしまう。これを後から変更する。ちなみに、GUIモードではインストール時に設定できる。

流れは以下の通り。インストール直後で、userを作る前に実行することが望ましい。

1.homeディレクトリをアンマウント
2.論理ボリュームを削除
3.論理ボリュームサイズを拡張する
4.起動ファイルシステム設定を変更
5.再起動
6.LVファイルシステムサイズ拡大(LVサイズに合わせる)

bash
# umount -l /home
# lvremove -f /dev/centos/home
# lvextend -l +100%FREE /dev/mapper/centos-root
bash
# vi /etc/fstab
  • 右記をコメントに。 #/dev/mapper/centos-home /home
bash
# reboot
# xfs_growfs /
  • CentOS7からデフォルトのファイルシステムはxfs。
  • CentOS6とかはresize2fsを使ってた。
17
17
1

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
17
17