10

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
6
  • Welcome to Ask Ubuntu. Please take a screenshot of the app Gparted (use a desktop installation USB in the Try Ubuntu mode). Before taking the screenshot select the 1TB disk in question. Add the screenshot to this question. In this site we prefer that you copy and paste the text from the terminal rather than use screenshots for plain text of the terminal or console.
    – user68186
    May 10, 2021 at 20:03
  • 1
    Does this answer your question? How to resize partitions?
    – user535733
    May 10, 2021 at 20:28
  • Was LVM setup during install? (easiest way to find out is to run lsblk and see if you have something like ubuntu--vg-ubuntu--lv anywhere in the output) May 11, 2021 at 0:22
  • Output of fdisk -l. May 11, 2021 at 3:11
  • @easthighNerd @Stephen Boston I added the information. When I find time to make a backup of my system, I am planning to try vgextend. Would you recommend that? And could you show methe right syntax for my case? May 11, 2021 at 9:54

1 Answer 1

24

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

7
  • I should make a backup right? And I have a simulation running (without a defined endpoint) and I would prefer to not stop it. Is this possible? The Testmode was successful May 11, 2021 at 10:01
  • @KooniWilke 1. Yes, I would recommend making a backup first, just in case. 2. You should be fine leaving your simulation running. May 11, 2021 at 10:04
  • A backup before any partitioning / filesystem changes is always well-advised, but in this case you won't need to stop your running jobs: Both operations can be done online while they keep running.
    – HuHa
    May 11, 2021 at 10:04
  • 2
    It worked perfect. Thank you! May 14, 2021 at 11:17
  • 1
    Thank you, perfect answer. I thought during install that this was what it was doing but I just left everything as default just to see. Mine actually only used a default of 100GB of 500. I ran your commands and it resized to max of the drive. Nov 23, 2022 at 7:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .