Monday, June 23, 2014

Extending a Linux LVM Partition By Increasing An Existing Virtual Disk Size In Vmware

1. A Ubuntu Machine With HDD Size = 50 GB
2. Check the HDD Size
3. root@ubuntu:~# df -h
4. Power Off And Expand the Size.Here i increased 20 GB Additional
5. root@ubuntu:~# fdisk -l
6. root@ubuntu:~# fdisk -l /dev/sda
7. root@ubuntu:~# fdisk /dev/sda
Command (m for help): p
Command (m for help): n
Partition type:
  p   primary (2 primary, 1 extended, 1 free)
  l   logical (numbered from 5)
Select (default p):
Using default response p
Selected partition 4
First sector (104855552-146800639, default 104855552):
Using default value 104855552
Last sector, +sectors or +size{K,M,G} (104855552-146800639, default 146800639): +10G

Command (m for help): p
Command (m for help): t
Partition number (1-5): 4
Hex code (type L to list codes): L
Hex code (type L to list codes): 8e
Command (m for help): p
Command (m for help): w
8. root@ubuntu:~# reboot
9. root@ubuntu:~# pvcreate ubuntu /dev/sda4
10. root@ubuntu:~# vgs
11. root@ubuntu:~# vgextend ubuntu /dev/sda4
12. root@ubuntu:~# vgs
13. root@ubuntu:~# lvextend -L+10.00G /dev/ubuntu/root
14. root@ubuntu:~# lvdisplay
15. root@ubuntu:~# df -h
16. root@ubuntu:~# resize2fs -p /dev/mapper/ubuntu-root
17. root@ubuntu:~# df -h

No comments:

Post a Comment

bloggerwidgets