HowTo add new diskspace to Linux without rebooting
Add new diskspace to Linux server using VMWare
Find the newly added harddisks
ls /sys/class/scsi_host/ | while read host ; do echo "- - -" > /sys/class/scsi_host/$host/scan ; done
List Partitions/Disks
[root@localhost ~]# fdisk -l Disk /dev/sda: 27.9 GB, 27917287424 bytes 255 heads, 63 sectors/track, 3394 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00045afe Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 2089 16264192 8e Linux LVM ... Disk /dev/sdb: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
Create New primary partition and change the partition type to 8e (Linux LVM):
fdisk /dev/sdb
Extend the VolumeGroup:
Get the volume group name:
[root@localhost ~]# vgdisplay | grep "VG Name"
VG Name vg_dns3
Extend the volume group with /dev/sdb1
vgextend vg_dns3 /dev/sdb1
Add the free space to the logical volume:
Get the volume group name:
[root@localhost ~]# lvdisplay | grep "LV Path" LV Path /dev/vg_dns3/lv_root LV Path /dev/vg_dns3/lv_swap
Extend the volume group:
lvextend -r -l +100%FREE /dev/vg_dns3/lv_root
Check the final result:
df -h