0

So I've got a problem with a partition in a partition. Disk hierarchy:

Disk hierarchy screenshot

My disk (nvme0n1) is partitioned into 3 parts.

  1. /boot/efi 512M (nvme0n1p1)
  2. /boot 1G (nvme0n1p2)
  3. no name (nvme0n1p3)

nvme0n1p3 has a "subpartition" named ubuntu--vg-ubuntu--lv (200G) which is mounted/used under /. nvme0n1p3 is 930G big, but the Ubuntu partition only 200G. Now my question:

Is there a way to get the remaining 730GB into the ubuntu partition with the terminal, without losing all data?

The Ubuntu partition is ext4, if that's important. I'm using Ubuntu 20.04.

What I tried:

Output of sudo pvs:
/dev/nvme0n1p3 ubuntu-vg lvm2 a-- <930.01g <730.01g

If there are any questions, I'm happy to answer them.
Thanks in advance.

  • 1
    What is the output of sudo pvs show for that partition? You might want to see: https://askubuntu.com/a/1406922/231142 – Terrance May 22 '22 at 23:35
  • You need to extend your LVM volume. There is a very good guide to this here https://www.tecmint.com/extend-and-reduce-lvms-in-linux/ – PonJar May 23 '22 at 09:43
  • @guiverc Thank you, I fixed my question – FGBxRamel May 23 '22 at 11:56
  • @Terrance Thank you very much, that worked! I will add an answer to my question later, according to your comment. – FGBxRamel May 23 '22 at 11:56

1 Answers1

2

The comment of @Terrance worked.
He pointed out an answer from another question, which worked. I did the following steps from the answer:

raziel@hanneserver:~$ sudo lvextend -l+100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv 
  Size of logical volume ubuntu-vg/ubuntu-lv changed from 200.00 GiB (51200 extents) to <930.01 GiB (238082 extents).
  Logical volume ubuntu-vg/ubuntu-lv successfully resized.

raziel@hanneserver:~$ sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv resize2fs 1.45.5 (07-Jan-2020) Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizing required old_desc_blocks = 25, new_desc_blocks = 117 The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 243795968 (4k) blocks long.

raziel@hanneserver:~$ df -hPT / Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/ubuntu--vg-ubuntu--lv ext4 915G 181G 696G 21% /