Last active
December 28, 2018 13:35
-
-
Save onokatio/15f729fc6f68c770a585dfbe1966aaff to your computer and use it in GitHub Desktop.
LVMチートシート ref: https://qiita.com/onokatio/items/6af256524397ae8ddc79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 物理ボリュームの作成(パーティションをLVM管理下に置く) | |
pvcreate /dev/sda1 | |
pvcreate /dev/sda2 | |
… | |
## 物理ボリュームの解除(パーティションをLVM管理下に置かない) | |
pvremove /dev/sda1 | |
… |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ボリュームグループの作成 | |
vgcreate Vol1 /dev/sda1 /dev/sda2 | |
## ボリュームグループに論理ボリュームを追加 | |
vgextend Vol1 /dev/sdb1 | |
## ボリュームグループの削除(無効化) | |
vgchange -a n Vol1 | |
## ボリュームグループから論理ボリュームを取り除く(先に上記の無効化をしなければならない) | |
vgreduce Vol1 /dev/sdb1 | |
vgremove Vol1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 論理ボリューム(パーティション)の作成 | |
lvcreate -L 10G Vol1 -n lvolroot | |
lvcreate -l 100%FREE Vol1 -n lvolhome | |
… | |
## 論理ボリュームの拡張(resize2fsも必要) | |
lvextend -L +10G Vol1/lvolroot | |
## 論理ボリュームの縮小(resize2fsも必要) | |
lvreduce -L -10G Vol1/lvolroot | |
## 論理ボリュームの削除 | |
lvremove Vol1/lvolroot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lvmdiskscan | |
vgscan | |
pvs | |
pvdisplay | |
vgdisplay | |
lvdisplay | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment