How to use LVM in SUSE
I believe many inexperienced people don't know what to do about how to use LVM in SUSE. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
First, server partition planning (scalable according to 100 business groups planning)
Myvg volume group capacity-700G (about 80% of hard disk space)
/ boot 100m for the space needed for system enablement
/ 20g is used to place some system user files
/ usr 150G for tomcat: release program and business group file placement
/ swap 16g is used in the swap area. The general size is: 2 * memory size
/ var 20g for the installation of some software
/ home 150G for Qmail mail storage
/ bak 200G data backup, including business group mail, database data backup
Second, create a logical volume mybak for data backup
1. Create a mybak with an assigned size of 200G
Lvcreate-L + 200G-n mybak myvg
2. View mybak information
Lvdisplay / dev/myvg/mybak
3. Create a file system
Mkfs-t ext3 / dev/myvg/mybak
4. Create a mount directory
Mkdir / mybak
5. Write to the automatically loaded file / etc/fstab
6. Load the file system
Mount-a
7. View the file system information after loading
Df-h
III. Expansion of myvg volume group
1. View the hard disk space and create a partition (execute the following command line by line)
Fdisk-l
Fdisk / dev/sdb
P View the current partition situation
N New partition
P main partition
2 build the second primary partition (according to the actual situation)
+ 20g set partition size
T set the partition format
8e is set to linux lvm format
W Save Settings
Q exit partition
2. Create a physical volume to join the volume group myvg
Pvcreate / dev/sdb2
3. Expand the volume group myvg
Vgextend myvg / dev/sdb2
4. View the expanded volume group capacity
Vgdisplay myvg
4. Dynamic expansion of logical volumes. Take var as an example (if there is enough space in the volume group, if there is not enough space in the volume group, you need to expand the volume group first)
1. Expand the capacity of myvar logic volume (it cannot be used directly after expansion here)
Lvextend-L + 10G / dev/myvg/myvar
2. Check the capacity after expansion
Lvdisplay / dev/myvg/myvar
3. Dynamically expand the capacity of myvar
Resize_reiserfs-s + 10G / dev/myvg/myvar
4. View the current available capacity of myvar
Df-h
After reading the above, have you mastered how to use LVM in SUSE? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!