[solved?] out of diskspace - which partition to grow?

Discussion in 'Installation/Configuration' started by niemand-glaumy, Feb 3, 2023.

  1. Good day!
    I'm being stupid once again.

    My client just called me, they have a temporary limit on sending their mails.
    Short google said: My disk space is full.

    Now I went to Hyper-V, increased the disk size of the Ubuntu 20.04 VM from 50gb to 200gb.
    But now I need grow the partition in ubuntu and my brain can't figure out which to grow:

    root@web:/home# df -h
    Filesystem                         Size  Used Avail Use% Mounted on
    udev                               405M     0  405M   0% /dev
    tmpfs                               90M  1.3M   89M   2% /run
    /dev/mapper/ubuntu--vg-ubuntu--lv   49G   44G  2.9G  94% /
    tmpfs                              449M  4.0K  449M   1% /dev/shm
    tmpfs                              5.0M     0  5.0M   0% /run/lock
    tmpfs                              449M     0  449M   0% /sys/fs/cgroup
    /dev/sda2                          974M  205M  702M  23% /boot
    /dev/loop0                          92M   92M     0 100% /snap/lxd/23991
    /dev/loop4                          64M   64M     0 100% /snap/core20/1738
    /dev/loop1                          64M   64M     0 100% /snap/core20/1778
    /dev/loop5                         117M  117M     0 100% /snap/core/14399
    /dev/loop3                          92M   92M     0 100% /snap/lxd/24061
    /dev/loop2                         117M  117M     0 100% /snap/core/14447
    tmpfs                               90M     0   90M   0% /run/user/1000
    root@web:/home# fdisk -l /dev/sda
    GPT PMBR size mismatch (104857599 != 419430399) will be corrected by write.
    The backup GPT table is not on the end of the device. This problem will be corrected by write.
    Disk /dev/sda: 200 GiB, 214748364800 bytes, 419430400 sectors
    Disk model: Virtual Disk
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disklabel type: gpt
    Disk identifier: D444AFBC-006C-49F3-8D57-7F6C7B621906
    Device        Start       End  Sectors Size Type
    /dev/sda1      2048      4095     2048   1M BIOS boot
    /dev/sda2      4096   2101247  2097152   1G Linux filesystem
    /dev/sda3   2101248  31455231 29353984  14G Linux filesystem
    /dev/sda4  31455232 104857566 73402335  35G Linux filesystem
    PLZ help quickly! Thanks! <3
  2. pyte

    pyte Active Member HowtoForge Supporter

    On a Ubuntu Installation with LVM these are the usual steps i take:
    1. Extend the disk in the hypervisor
    vgdisplay # checking the volume groups to double check
    growpart /dev/sda 1
    lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
    resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
    And may need to resize the PV
    ahrasis likes this.
  3. @pyte It wasn't an issue how to resize it - but which one. As said, I resized sda4, as it was the largest (35gb) and fullest (94% usage) - and am hoping it was the right one. Otherwise my phone will ring again in a few minutes and I will have to harapukku in shame while my client shouts violence at me.
  4. pyte

    pyte Active Member HowtoForge Supporter

    Oh ok got it. Thats easy, just list all volume groups with "vgdisplay" and then list alls phiscal volumes with "pvdisplay". In the output of the last command you can see which disk(s) e.g. /dev/sda1 are assigned to which volume group.
  5. My phone did in fact not ring, it seems to have worked. :D
    ahrasis and pyte like this.

Share This Page