| 1 | == LVM Resize == |
| 2 | |
| 3 | (20210423: Artemis storage was full) |
| 4 | |
| 5 | * Artemis (ssh root@artemis) is in virtual. Stop the following jobs before umounting the fs |
| 6 | |
| 7 | {{{ |
| 8 | root@artemis:~# /etc/init.d/tomcat8 status (start/stop) |
| 9 | root@artemis:~# /etc/init.d/postgresql status (start/stop) |
| 10 | }}} |
| 11 | |
| 12 | 1. extend volume |
| 13 | 2. resize filesystem |
| 14 | |
| 15 | {{{ |
| 16 | root@artemis:~# lvs # logical volume |
| 17 | root@artemis:~# vgs # volume group: says that we have x TB free space. Allocate to an lv by lvextend |
| 18 | root@artemis:~# pvs # physical volume |
| 19 | root@artemis:~# lvextend -L +100G /dev/RAID1_ISLANDS/artemis_data |
| 20 | root@artemis:~# fdisk -l /dev/RAID1_ISLANDS/artemis_data |
| 21 | root@artemis:~# cat /etc/fstab |
| 22 | root@artemis:~# mount /store/artemis_data/ |
| 23 | root@artemis:~# df -h /store/artemis_data/ |
| 24 | root@artemis:~# umount /store/artemis_data |
| 25 | root@artemis:~# resize2fs /dev/mapper/RAID1_ISLANDS-artemis_data |
| 26 | root@artemis:~# e2fsck -f /dev/mapper/RAID1_ISLANDS-artemis_data # checks for errors |
| 27 | root@artemis:~# resize2fs /dev/mapper/RAID1_ISLANDS-artemis_data |
| 28 | root@artemis:~# mount /store/artemis_data/ |
| 29 | }}} |
| 30 | |
| 31 | More info [https://www.tecmint.com/extend-and-reduce-lvms-in-linux/ here] |