Merge two ubuntu partitions

PeterMarcusH.

Member
Apr 5, 2019
99
3
13
28
Hey all. I tried to extend my ubuntu vm, but cant seem to get it to work :/. My "root" folder is /dev/mapper/ubuntu--vg-ubuntu--lv, where as i can see Disk /dev/vda: has all the disk space. How can i merge these two?
 

Attachments

  • 2.PNG
    2.PNG
    31.5 KB · Views: 11
  • 1.PNG
    1.PNG
    49.8 KB · Views: 10
hi,

you don't need to merge them.

why don't you mount /dev/vda3 and just use the disk space?
 
you can try to just mount it like this:
Code:
mkdir /mnt/newdisk
mount /dev/vda3 /mnt/newdisk

and then check the output of df -h to see if it's listed there.

you can also add it to your /etc/fstab for persistence if the mounting worked.
 
Hmm im getting the following error
Code:
ubuntuserver@ubuntuserver:~$ sudo mount /dev/vda3 /mnt/newdisk/
mount: /mnt/newdisk: unknown filesystem type 'LVM2_member'.
 
oh weird, i thought /dev/vda3 would be a linux partition.

i guess your goal is to get more space out of this. can you post the output of following commands (copy/paste here into [code] tags)
Code:
df -h
lsblk -f
fdisk -l
pvs -a
lvs -a
vgs -a
lvdisplay
 
Code:
ubuntuserver@ubuntuserver:~$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                                35G     0   35G   0% /dev
tmpfs                              6.9G  4.4M  6.9G   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  147G   36G  104G  26% /
tmpfs                               35G     0   35G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                               35G     0   35G   0% /sys/fs/cgroup
/dev/vda2                          976M  198M  712M  22% /boot
/dev/sda1                          7.3T  2.2T  4.8T  32% /home/ubuntuserver/mnt/sdb
/dev/loop0                          56M   56M     0 100% /snap/core18/1885
/dev/loop1                          56M   56M     0 100% /snap/core18/1932
/dev/loop3                          70M   70M     0 100% /snap/lxd/18251
/dev/loop2                          31M   31M     0 100% /snap/snapd/9607
/dev/loop4                          70M   70M     0 100% /snap/lxd/18324
/dev/loop5                          31M   31M     0 100% /snap/snapd/9721
tmpfs

Code:
ubuntuserver@ubuntuserver:~$ lsblk -f
NAME                  FSTYPE      LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINT
loop0                 squashfs                                                       0   100% /snap/core18/1885
loop1                 squashfs                                                       0   100% /snap/core18/1932
loop2                 squashfs                                                       0   100% /snap/snapd/9607
loop3                 squashfs                                                       0   100% /snap/lxd/18251
loop4                 squashfs                                                       0   100% /snap/lxd/18324
loop5                 squashfs                                                       0   100% /snap/snapd/9721
sda
└─sda1                ext4              9f263420-23c8-4a62-95a6-e8235664b8dc      4.7T    30% /home/ubuntuserver/mnt/sdb
vda
├─vda1
├─vda2                ext4              91fef7ad-1082-4e80-a1f1-9eb2aed37931    711.3M    20% /boot
└─vda3                LVM2_member       xMeVnL-LZw7-HcZO-yMp8-oKaY-msPh-okdoz6
  └─ubuntu--vg-ubuntu--lv
                      ext4              264e7379-2ac5-43c2-93f0-7bb660d16c21    103.5G    25% /

Code:
ubuntuserver@ubuntuserver:~$ sudo fdisk -l
Disk /dev/loop0: 55.33 MiB, 58007552 bytes, 113296 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/loop1: 55.37 MiB, 58052608 bytes, 113384 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/loop2: 30.95 MiB, 32432128 bytes, 63344 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/loop3: 69.37 MiB, 72732672 bytes, 142056 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/loop4: 69.37 MiB, 72728576 bytes, 142048 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/loop5: 30.96 MiB, 32440320 bytes, 63360 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/vda: 350 GiB, 375809638400 bytes, 734003200 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
Disklabel type: gpt
Disk identifier: 2B604EF1-D5A1-42F0-8BD8-5A2FDA4B7B67

Device       Start       End   Sectors  Size Type
/dev/vda1     2048      4095      2048    1M BIOS boot
/dev/vda2     4096   2101247   2097152    1G Linux filesystem
/dev/vda3  2101248 734003166 731901919  349G Linux filesystem


Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 148.102 GiB, 159983337472 bytes, 312467456 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: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: EF701E96-0851-6F43-AECC-C9955481E2FA

Device     Start         End     Sectors  Size Type
/dev/sda1   2048 15628053134 15628051087  7.3T Linux filesystem

Code:
ubuntuserver@ubuntuserver:~$ sudo pvs -a
  PV         VG        Fmt  Attr PSize    PFree
  /dev/loop0                ---        0     0
  /dev/loop1                ---        0     0
  /dev/loop2                ---        0     0
  /dev/loop3                ---        0     0
  /dev/loop4                ---        0     0
  /dev/loop5                ---        0     0
  /dev/sda1                 ---        0     0
  /dev/vda2                 ---        0     0
  /dev/vda3  ubuntu-vg lvm2 a--  <149.00g    0

Code:
ubuntuserver@ubuntuserver:~$ sudo lvs -a
  LV        VG        Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  ubuntu-lv ubuntu-vg -wi-ao---- <149.00g

Code:
ubuntuserver@ubuntuserver:~$ sudo vgs -a
  VG        #PV #LV #SN Attr   VSize    VFree
  ubuntu-vg   1   1   0 wz--n- <149.00g    0


Code:
ubuntuserver@ubuntuserver:~$ sudo lvdisplay
  --- Logical volume ---
  LV Path                /dev/ubuntu-vg/ubuntu-lv
  LV Name                ubuntu-lv
  VG Name                ubuntu-vg
  LV UUID                FFUQwi-57Se-n28F-UYmR-t5nE-C3mE-MJ8Ywg
  LV Write Access        read/write
  LV Creation host, time ubuntu-server, 2020-09-20 00:23:20 +0000
  LV Status              available
  # open                 1
  LV Size                <149.00 GiB
  Current LE             38143
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0
 
so /dev/vda3 is actually your ubuntu--vg-ubuntu--lv (as can be seen on lsblk output you posted)

you seem to be doing fine in space for now (you also have your extra disk) so maybe don't worry about it yet.

but if you see it running out then you can try adding another disk to the VM for example, and adding extra LV in it
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!