What:
Linux: Red Hat, Centos
Problem:
Your Linux box is running out of space.
Solution:
To extend space on your lvm volume you will need to:
1. Add new disk to your system
2 .My new device has been detected as /dev/sdb
If your new disk is not detected you can reboot the system or send a rescan request using command below:
echo "- - -" > /sys/class/scsi_host/host0/scanYou can use entire disk as a phisical volume in an LVM volume group, but it's recommended in "RHEL6 Logical Volume Manager Administration LVM Administrator Guide" and LVM howto "11.1. Initializing disks or disk partitions" that you create a partition.
3. Create new partition and set type to 8e which is Linux LVM
fdisk /dev/sdbor
cfdisk /dev/sdb4. Create phisical volume
pvcreate /dev/sdb15. Find volume group name, which you want to extend
vgdisplay or pvs or df6. Add your new disk to the volume group
vgextend vg_name /dev/sdb17. Confirm new free size with one of the following commands
pvs or vgdisplay or pvscanYour volume group has now some free space, which you can allocate to logical volume/s
8. List your volumes
lvdisplay9. Extend space on your volume by adding 10GB
lvextend -L +10G /dev/mapper/vg_name-LogVoloptionally allocate all available space
lvextend -l +100%FREE /dev/mapper/vg_name-LogVol10. Resize file system
resize2fs /dev/mapper/vg_name-LogVol
Check your free space with df
No comments:
Post a Comment