Mozilla Skin

Logical Volumes

From YourSupportStoreWiki

Re-sizing Logical Volumes

If its a new drive no reboot is required.. in this case its the same drive

parted /dev/sda
mkpart p ext3 21.5GB 161GB
set 3 lvm on

reboot because its the hdd the root partition is on.

pvcreate /dev/sda3
vgextend rhel6web /dev/sda3
lvextend -L 40GB /dev/rhel6web/root /dev/sda3
lvextend -L 10GB /dev/rhel6web/var /dev/sda3
lvextend -L 10GB /dev/rhel6web/home /dev/sda3
lvcreate -L 10GB rhel6web -n mysql /dev/sda3
lvextend /dev/rhel6web/www /dev/sda3
mkfs.ext4 /dev/rhel6web/mysql
mkdir /var/lib/mysql2
service mysqld stop
mv /var/lib/mysql/* /var/lib/mysql2/
mount /dev/rhel6web/mysql /var/lib/mysql/
mv /var/lib/mysql2/* /var/lib/mysql/
echo "/dev/mapper/rhel6web-mysql   /var/lib/mysql  ext4  defaults  1 2" >>/etc/fstab
resize2fs /dev/mapper/rhel6web-root
resize2fs /dev/mapper/rhel6web-var
resize2fs /dev/mapper/rhel6web-home
resize2fs /dev/mapper/rhel6web-www
restorecon -v 'mysql'