13

Recently; I did my first steps concerning Ubuntu and Ubuntu Server. For other Problems, there were good ways of trobleshooting but in this case I found nothing.

I installed Ubuntu Server on an old PC with a 1TB HDD. Previously, there was MINT installed but during the installation I wanted to overwrite this. Now I just have a 200 GB Partition. When I search for the disk, it is displayed correctly lsblk shows following:

sda                         8:0    0 931.5G  0 disk
├─sda1                      8:1    0     1M  0 part
├─sda2                      8:2    0     1G  0 part /boot
└─sda3                      8:3    0 930.5G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0   200G  0 lvm  /

When I tryfdisk -l it shows following (I left outloop1-loop4):

Disk /dev/loop5: 32.28 MiB, 33841152 bytes, 66096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors Disk model: ST1000LM024 HN-M 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: 166EB4EB-E368-4D03-B844-654566C409B9

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 1953521663 1951420416 930.5G Linux filesystem

Kooni Wilke
  • 131
  • 1
  • 1
  • 4

1 Answers1

29

By default, for whatever reason, when setting up a new Ubuntu Server install, it only allocates around 200GB of storage to the ubuntu--vg-ubuntu--lv logical volume by default, unless noticed and altered during install.

Here's how you can resize it to full capacity of the disk:

  1. See the current size of the logical volume before df -hT /dev/mapper/ubuntu--vg-ubuntu--lv

  2. Run a test first sudo lvresize -tvl +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

  3. Resize the logical volume sudo lvresize -vl +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

  4. Resize the filesystem sudo resize2fs -p /dev/mapper/ubuntu--vg-ubuntu--lv

  5. Check the size of the logical volume to see if everything went smooth df -hT /dev/mapper/ubuntu--vg-ubuntu--lv