sasha2002 Blog's

Just another blog from admin's

How to extend disk \ partition on Hyper-V —

1. Stop VM and edit disk.
2. Start VM and login.
3. Enter :
cfdisk /dev/hda
or
cfdisk /dev/sda
You should see the space that you just added.
3.1. Now create a new Logical Partition on this free space.
3.2. After that change Type of partition to (Linux LVM ) enter :
8e
3.3. Write changes to disk.
4. Take a look if new /dev/hda? or /dev/sda? appear, if no restart VM.
5. Initialize the new Physical Volume for use with LVM :
pvcreate /dev/hda?
(? is whatever number you created using the CFDISK tool) or
pvcreate /dev/sda?
6. Next run this to see LVM partition names :
lvdisplay
7. Add the new partition to the Volume Group (Name of LVM see before)
vgextend LVM_Name /dev/sda?
8. Resize the entire LVM :
lvresize -l +100%FREE /dev/LVM_Name/root (where /dev/LVM_Name/root is the LV Name of the volume you want to increase)
9. Expanding the Linux File System to make use of the new free space we just added :
resize2fs /dev/LVM_Name/root (where /dev/LVM_Name/root is your LV Name from the previous section)
10. Verify if partition increased :
df -h


Categorised as: Linux

Comments are disabled on this post


Comments are closed.