lvm
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lvm [2011/03/07 11:02] – [FDISK] paulsmith | lvm [2020/03/08 22:59] (current) – paulsmith | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== LVM2 ====== | ||
| + | |||
| + | |||
| + | ===== FDISK ===== | ||
| + | if you are not doing a raid: | ||
| + | create partition with type 8e | ||
| + | |||
| + | |||
| + | ===== Create a volume group ===== | ||
| + | vgscan | ||
| + | vgchange -a y | ||
| + | pvcreate /dev/md1 | ||
| + | vgcreate vx /dev/md1 | ||
| + | |||
| + | |||
| + | ===== Unmount a volume group ===== | ||
| + | vgchange -a n vx | ||
| + | |||
| + | |||
| + | ===== Display volume group ===== | ||
| + | vgdisplay vx | ||
| + | |||
| + | |||
| + | ===== Display Logical Volume ===== | ||
| + | lvdisplay / | ||
| + | |||
| + | |||
| + | ===== Create new virtual ===== | ||
| + | lvcreate -L20G -nusr vx | ||
| + | lvcreate -L10G -nvar vx | ||
| + | lvcreate -L5G | ||
| + | lvcreate -L20G -nhome | ||
| + | lvcreate -L5G | ||
| + | lvcreate -L10G -nwww vx | ||
| + | lvcreate -L20G -nmail | ||
| + | lvcreate -L5G | ||
| + | lvcreate -L10G -ndistfiles | ||
| + | lvcreate -L20G -ndistfilescache vx | ||
| + | lvcreate -L50G -nsamba | ||
| + | lvcreate -L10G -nsrc vx | ||
| + | lvcreate -L50G -nbackup | ||
| + | lvcreate -L50G -ntrash | ||
| + | lvcreate -L100G -nvmware | ||
| + | lvcreate -L300G -nvideo | ||
| + | lvcreate -L50G -ntorrent | ||
| + | |||
| + | |||
| + | mkfs.ext4 / | ||
| + | |||
| + | |||
| + | |||
| + | ===== Rename virtual ===== | ||
| + | lvrename vx src dst | ||
| + | |||
| + | ===== Resize virtual ===== | ||
| + | lvextend -L +xxG / | ||
| + | resize_reiserfs -f / | ||
| + | |||
| + | |||
| + | ===== Resize virtual - ext4 ===== | ||
| + | umount / | ||
| + | e2fsck -f / | ||
| + | resize2fs / | ||
| + | e2fsck -f / | ||
| + | lvextend -L +50G / | ||
| + | resize2fs / | ||
| + | fsck -n / | ||
| + | e2fsck -f / | ||
| + | |||
| + | ===== Ext3 Resize ===== | ||
| + | umount / | ||
| + | "not needed now" tune2fs -O ^has_journal / | ||
| + | e2fsck -f / | ||
| + | resize2fs / | ||
| + | lvresize -L 50G / | ||
| + | resize2fs / | ||
| + | fsck -n / | ||
| + | "not needed now" tune2fs -j / | ||
| + | |||
| + | ===== Remove a virtual ===== | ||
| + | lvremove / | ||
| + | |||
| + | ===== Force a cache rebuild if not all of the vg groups appear ===== | ||
| + | | ||
