#10:19 2019.09.26
#################
#Increasing-New-LVM-Volume-for-VPS.sh
#OS: "Ubuntu 18.04.3 LTS" / Linux srv150 4.15.0-64-generic GNU/Linux
#################
#fdisk /dev/sdb
n
p
w
#mkfs.ext4 /dev/sdb1
#
root@srv030:/opt/lvm-informations# lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME FSTYPE SIZE MOUNTPOINT LABEL
loop0 squashfs 89M /snap/core/7713
loop1 squashfs 91M /snap/core/6350
sda 100G
├─sda1 1M
├─sda2 ext4 2G /boot
└─sda3 LVM2_member 98G
├─vg0-lv1_os ext4 20G /
└─vg0-lv2_opt ext4 78G /opt
sdb 130G
└─sdb1 ext4 130G
#root@srv030:/opt/lvm-informations# vgdisplay | grep "VG Size"
VG Size <98.00 GiB
#root@srv030:/opt/lvm-informations# vgextend vg0 /dev/sdb1
WARNING: ext4 signature detected on /dev/sdb1 at offset 1080. Wipe it? [y/n]: y
Wiping ext4 signature on /dev/sdb1.
Physical volume "/dev/sdb1" successfully created.
Volume group "vg0" successfully extended
#root@srv030:/opt/lvm-informations# vgdisplay | grep "VG Size"
VG Size 227.99 GiB
#Update dung lượng mới cho volume "/dev/vg0/lv2_opt":
lvresize -L+130gb /dev/vg0/lv2_opt
#xfs_growfs /dev/vg01_hdd/lv03_opt
resize2fs /dev/vg0/lv2_opt
#DONE:
root@srv030:/opt/lvm-informations# vgdisplay | grep "Size"
VG Size 227.99 GiB
PE Size 4.00 MiB
Alloc PE / Size 58111 / <227.00 GiB
Free PE / Size 255 / 1020.00 MiB
#root@srv030:/opt/lvm-informations# df -h;date;
Filesystem Size Used Avail Use% Mounted on
# udev 7.9G 0 7.9G 0% /dev
# tmpfs 1.6G 1.1M 1.6G 1% /run
# /dev/mapper/vg0-lv1_os 20G 6.2G 13G 33% /
# tmpfs 7.9G 0 7.9G 0% /dev/shm
# tmpfs 5.0M 0 5.0M 0% /run/lock
# tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup
# /dev/loop0 90M 90M 0 100% /snap/core/7713
# /dev/loop1 91M 91M 0 100% /snap/core/6350
# /dev/sda2 2.0G 80M 1.8G 5% /boot
/dev/mapper/vg0-lv2_opt 204G 223M 194G 1% /opt
# tmpfs 1.6G 0 1.6G 0% /run/user/0
# Thu Sep 26 10:21:32 +07 2019
# root@srv030:/opt/lvm-informations#
#DONE-DONE-DONE
No comments:
Post a Comment