(Linux)How to expanding the size of disk

We can use the following steps:
  1. Shutdown the VPS and add disk. Then restart it.
  2. Login, use this command: fdisk /dev/sda
  3. Type  ‘ n ’  after the Bluefocus.
  4. Type      p
  5. Partition number (1-4):    (The number must have not exist before, and you can chose default)
  6. Click double Enter.
  7. Type      p     ( you will see the new paetition)
  8. Type  t->   Type     Partition number you have chose-> Type  8e ->Type w   to save
  9. reboot server
  10. use this command :  pvcreate  /dev/sda(1-4, the number you chose)
  11. use this command:  lvdisplay    (to remember the VG name(the disk what you want to expand))
  12. use this command :  vgextend VGname /dev/sda(1-4, the number you chose)
  13. Still execute command  :   lvresize -l +100%FREE /dev/VG name
  14. command:   resize2fs /dev/VG name
  15. If the 14th steps failed, use this command :  xfs_growfs /dev/VG name      Congratulation, completed. Then,    you can use     df –lh      to check.

Add Feedback