diff --git a/docs/expand_hard_disk.md b/docs/expand_hard_disk.md new file mode 100644 index 000000000000..9d2f9a11528f --- /dev/null +++ b/docs/expand_hard_disk.md @@ -0,0 +1,101 @@ +# Expand the Hard Disk of Virtual Appliance + +If you install Harbor with OVA, the persistent data(such as images and database) is stored in a hard disk which is mounted on directory "/data", and the default size is 50GB. As more and more images are pushed into it, the capacity may not meet your requirements. + +You can check the space on Harbor web UI by clicking on the admin's name at the upper left corner and selecting "About" from the drop-down menu if you log in with an admin user: + +![lvm](img/lvm/check_on_ui_01.png) + +If your free space almost runs out, you can refer to this guide to expand the size of the hard disk. + +1. Add New Hard Disk to VM + + (1) Log in vSphere web client. Power off Harbor's virtual appliance. + (2) Right click on the VM and select "Edit Settings". + (3) Select "New Hard Disk", and click "OK". + +![lvm](img/lvm/add_new_hard_disk.png) + + We add a 10GB new hard disk to show the operations. + (4) Power on the VM. + +2. Expand Hard Disk using LVM + + Login from the console of the virtual appliance and run the following commands: + + (1) Check the current size of "/data": + ```sh + df -h /data + ``` + + ![lvm](img/lvm/size_of_data_01.png) + + (2) Find the new hard disk, e.g. "/dev/sdc". Replace all "/dev/sdc" with your disk in the following commands. + ```sh + fdisk -l + ``` + + ![lvm](img/lvm/find_the_new_harddisk.png) + + (3) Create new physical volume: + ```sh + pvcreate /dev/sdc + ``` + + (4) Check the volume group: + ```sh + vgdisplay + ``` + + ![lvm](img/lvm/vg_01.png) + + (5) Expand the volume group: + ```sh + vgextend data1_vg /dev/sdc + ``` + + (6) Check the volume group again: + ```sh + vgdisplay + ``` + + ![lvm](img/lvm/vg_02.png) + + (7) Check the logical volume: + ```sh + lvdisplay + ``` + + ![lvm](img/lvm/lv_01.png) + + (8) Resize the logical volume: + ```sh + lvresize -l +100%FREE /dev/data1_vg/data + ``` + + ![lvm](img/lvm/resize_lv.png) + + (9) Check the logical volume again, note the change of "LV Size": + ```sh + lvdisplay + ``` + + ![lvm](img/lvm/lv_02.png) + + (10) Resize the file system: + ```sh + resize2fs /dev/data1_vg/data + ``` + + (11) Check the size "/data" again: + ```sh + df -h /data + ``` + + ![lvm](img/lvm/size_of_data_02.png) + + You can also check the size on Harbor web UI: + + ![lvm](img/lvm/check_on_ui.png) + +After that, your disk should be expanded successfully. If you want to add more hard disks, do the steps again. \ No newline at end of file diff --git a/docs/img/lvm/add_new_hard_disk.png b/docs/img/lvm/add_new_hard_disk.png new file mode 100644 index 000000000000..9f768674f8e3 Binary files /dev/null and b/docs/img/lvm/add_new_hard_disk.png differ diff --git a/docs/img/lvm/check_on_ui.png b/docs/img/lvm/check_on_ui.png new file mode 100644 index 000000000000..2ccd0788be7c Binary files /dev/null and b/docs/img/lvm/check_on_ui.png differ diff --git a/docs/img/lvm/check_on_ui_01.png b/docs/img/lvm/check_on_ui_01.png new file mode 100644 index 000000000000..6c18d58124f2 Binary files /dev/null and b/docs/img/lvm/check_on_ui_01.png differ diff --git a/docs/img/lvm/find_the_new_harddisk.png b/docs/img/lvm/find_the_new_harddisk.png new file mode 100644 index 000000000000..8c71098ce302 Binary files /dev/null and b/docs/img/lvm/find_the_new_harddisk.png differ diff --git a/docs/img/lvm/lv_01.png b/docs/img/lvm/lv_01.png new file mode 100644 index 000000000000..9d7d3d66a931 Binary files /dev/null and b/docs/img/lvm/lv_01.png differ diff --git a/docs/img/lvm/lv_02.png b/docs/img/lvm/lv_02.png new file mode 100644 index 000000000000..fc881ab7da97 Binary files /dev/null and b/docs/img/lvm/lv_02.png differ diff --git a/docs/img/lvm/resize_lv.png b/docs/img/lvm/resize_lv.png new file mode 100644 index 000000000000..8762f726819d Binary files /dev/null and b/docs/img/lvm/resize_lv.png differ diff --git a/docs/img/lvm/size_of_data_01.png b/docs/img/lvm/size_of_data_01.png new file mode 100644 index 000000000000..e3cb1a2b7185 Binary files /dev/null and b/docs/img/lvm/size_of_data_01.png differ diff --git a/docs/img/lvm/size_of_data_02.png b/docs/img/lvm/size_of_data_02.png new file mode 100644 index 000000000000..148a71bca843 Binary files /dev/null and b/docs/img/lvm/size_of_data_02.png differ diff --git a/docs/img/lvm/vg_01.png b/docs/img/lvm/vg_01.png new file mode 100644 index 000000000000..7957cd3d6d97 Binary files /dev/null and b/docs/img/lvm/vg_01.png differ diff --git a/docs/img/lvm/vg_02.png b/docs/img/lvm/vg_02.png new file mode 100644 index 000000000000..42c3872a55ad Binary files /dev/null and b/docs/img/lvm/vg_02.png differ