0

So i want to increase the HDD of my Ubuntu 16.04.7 (where Redmine is running)

What i did was in my vSphere client under Settings -> HDD -> i pumped up the gb from 20 to 100 Hit ok and vSphere started working, now i says that i have 100gb of HDD Space.

I have not restarted Ubuntu yet. Do i have to partition something since my ubuntu doesn't recognize it yet?

Thanks for your help

Output of lvs

lvs
  LV     VG                Attr      LSize  Pool Origin Data%  Move Log Copy%  Convert
  root   redmine-server-vg -wi-ao--- 11,74g                                     
  swap_1 redmine-server-vg -wi-ao---  4,00g   

Output of vgs

vgs
  VG                #PV #LV #SN Attr   VSize  VFree
  redmine-server-vg   1   2   0 wz--n- 15,76g 24,00m

Output of pvs

pvs
  PV         VG                Fmt  Attr PSize  PFree
  /dev/sda5  redmine-server-vg lvm2 a--  15,76g 24,00m

Output of lsblk

lsblk
NAME                                  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                                     8:0    0   100G  0 disk
├─sda1                                  8:1    0   243M  0 part /boot
├─sda2                                  8:2    0     1K  0 part
└─sda5                                  8:5    0  15,8G  0 part
  ├─redmine--server--vg-root (dm-0)   252:0    0  11,8G  0 lvm  /
  └─redmine--server--vg-swap_1 (dm-1) 252:1    0     4G  0 lvm  [SWAP]
sr0                                    11:0    1  1024M  0 rom
OTRAY
  • 15
  • 5
  • Is it ok for you to make a new partition to the newly created disk space or do you need to expand existing partitions? Do you use LVM? – Krackout Apr 30 '21 at 09:32
  • I‘d really like to expand my existing redmine Partition and to LVM Not that i‘m Aware of or Vetter Said i don’t know, haben’s installiert anything but how Could i‘ve found out? – OTRAY Apr 30 '21 at 09:34
  • Since you need to expand the partition, LVM is necessary in order to be done without reboot. Execute `lvs`, `vgs`, `pvs` commands (using sudo or root user). Post the results if you have output. If these commands are not available or return nothing LVM is not used. In that case a reboot cannot be avoided. Also, try `lsblk` command and post the results if possible. – Krackout Apr 30 '21 at 10:56
  • Hi so it seems like i have LVM installed. I edited my post – OTRAY May 03 '21 at 06:55

1 Answers1

0

Using the updated info: First off all, as you see in lsblk output, the disk size increase is visible, sda is 100G. Your goal is to increase redmine--server--vg-root lv and corresponding partition.

To avoid downtime, the safest way is to make a new partition, add this to LVM and then extend VG and LV. The drawback is that the LV will be stretched across 2 partitions; not really a problem in day to day operation, but keep it in mind administrative-wise.
There is a way to increase the partition size instead of creating a new one, but involves unmounting and non-destructive deleting of current partition, which is a bit dangerous if something goes wrong.

If you can afford downtime, another option would be to download gparted iso, restart the VM and boot from it. Using gparted's graphical interface it's very easy to extend partition, VG and LV. It's the easiest way to go.

Steps to manually add partition (no downtime):

  • Make a new partition on the free space:
    execute sudo fdisk /dev/sda
    Press n to make a new partition; most probably choosing the default proposals (primary, partition number, first-last sector) will be fine, but cross check it. A new partition will appear. p prints the part table. Then press t to change type. Select the newly created part and type code 8e Linux LVM (using L lists available types). If you're not familiar with fdisk have a look at the man page, be careful not to do anything destructive! Have in mind that unless w (write) is pressed, no changes are written to disk.
  • Assign the new partition to LVM:
    sudo pvcreate /dev/sdaX (change X with the number from the partition list of fdisk)
    check with pvs
  • Extend Volume Group:
    sudo vgextend redmine-server-vg /dev/sdaX
    check with vgs
  • Extend Logical Volume:
    sudo lvextend -r -l 100%VG redmine-server-vg/root
    check with lvs

lsblk or df -h to check the total and free space of /

Some notes on the lvextend command:

  1. Due to - dashes in naming, perhaps instead of redmine-server-vg/root, something like redmine--server--vg-root is needed. In more recent versions tab completion is also available, so try to press tab to complete the name. It may not work on your old Ubuntu.
  2. One step is missing, which is extending the file system. resize2fs for ext4 or xfs_growfs for xfs for example. Hopefully thanks to -r parametre in lvextend, this step is automatically done. If not, find the file system used and extend it.
Krackout
  • 1,575
  • 7
  • 20