0

I am trying to install Ubuntu 20.04 on a NVMe disk.

The installation wizard shows below disk info:

enter image description here

I don't quite understand it. My questions are:

  1. Why the /dev/mapper/vgubuntu-root and /dev/mapper/vgubuntu-swap_1 are listed twice, respectively?

  2. The /dev/mapper parts are for LVM, which is the logical view. Why /dev/nvme0n1 also needs to be listed, which is the physical view for the same disk?

  3. Why I can do nothing when right clicking the /dev/nvme0n1p2? But I can change/delete the dev/nvme0n1p1?

  4. I see the size of dev/nvme0n1p2 - two free space = /dev/mapper/vgubuntu-swap_1 + /dev/mapper/vgubuntu-root. Is this some coincidence?

ADD 1 - 9:25 PM 9/18/2021

Some more info.

I did clicked the Advanced features and choose the Use LVM for once as below. But I didn't click the Install Now button because I am not so sure about the LVM. I am not sure if the /dev/mapper paths are caused by this. If it is caused by this, is there way to revert the effect?

enter image description here

ADD 2 - 12:11 PM 9/18/2021

I dug a bit about the Linux LVM.

As I understand now, below diagram just gives me 2 different views of my block device.

In the yellow box, it is the LVM logical volume view.

In the red box, it is the traditional PC partition view.

LVM is the Linux native way of disk partitioning, which has some advantages and complexities.

Current questions:

1 - Where are the info of these 2 different views stored?

2 - If both of them are stored on the disk, is it kind of redundant?

enter image description here

1
  • 1
    Did you already install using LVM or full drive encryption which uses LVM? Installer/gparted do not work or work well with Logical Volumes, just the partition the LVM is installed into? You typically need to use LVM tools. Do you want LVM or standard partitions? UEFI or BIOS install? MBR or gpt partitions. The only place MBR is now required is Windows in old BIOS boot mode, so gpt normally suggested. superuser.com/questions/1536669/… Why ext3, ext4 has been standard for 10 years.
    – oldfred
    Sep 17, 2021 at 16:34

1 Answer 1

1

I think most of your questions can be answered with: "Displaying LVM devices is not easy and the Ubuntu installer isn't doing great job here".

tl;dr description of LVM: LVM adds a second "logical" layer of storage that allows you to do things like joining multiple disks to a one device, you can setup RAIDs, cached devices etc. You have three types of device in LVM:

  • Physical volumes (PVs): these are existing block devices, like partitions or disks.
  • Volume groups (VGs): one or more PVs form a volume group. This is the part where two disks can be joined to a one device: a new VG can consist of two PVs on sda1 and sdb1.
  • Logical volumes (LVs): these are block devices allocated from a VG, you can picture these as partitions but created on a VG instead of a disk.

lsblk does a better job when displaying this structure and you see the devices are actually stacked on top of each other:

└─nvme0n1p3                                   259:3    0 892,7G  0 part  
  └─luks-dfcda59b-1322-4705-bb04-e09a72b2d678 253:0    0 892,7G  0 crypt 
    ├─fedora_aida-root                        253:1    0    70G  0 lvm   /
    └─fedora_aida-home                        253:2    0 822,7G  0 lvm   /home

(This is my setup with one encrypted PV, VG called fedora and two LVs root and home.)

In your case you have one PV on the second partition of your NVMe drive: /dev/nvme0n1p2. This PV is used by your VG called vgubuntu. And you have two logical volumes: root mounted on / and swap used as swap. (And you also have second swap on your first partition /dev/nvme0n1p1, I have no idea why).

To answer your questions:

Why the /dev/mapper/vgubuntu-root and /dev/mapper/vgubuntu-swap_1 are listed twice, respectively?

No idea. It's either a bug or weird UI decision.

The /dev/mapper parts are for LVM, which is the logical view. Why /dev/nvme0n1 also needs to be listed, which is the physical view for the same disk?

This is decision of whoever did the UI design of the installer. You can hide the PVs and show only the LVs or show both. In this case showing the PVs makes it a little bit confusing IMHO. But as I said, visualization of complex storage setups is not easy.

Why I can do nothing when right clicking the /dev/nvme0n1p2? But I can change/delete the /dev/nvme0n1p1?

/dev/nvme0n1p1 is a partition that is not part of the LVM setup so the installer allows you to change it. /dev/nvme0n1p2 is a PV and it has already the full LVM setup stacked on top of it so it makes sense the installer won't allow to delete it.

I see the size of dev/nvme0n1p2 - two free space = /dev/mapper/vgubuntu-swap_1 + /dev/mapper/vgubuntu-root. Is this some coincidence?

No, that's correct and this is how LVM works -- the LVs are allocated on the PV so the sum of all LVs (plus free space plus some LVM metadata) will be equal to the VG size which will be sum of the sizes of the PVs (so in your case of /dev/nvme0n1p2).

1
  • Thanks for the great answer! Finally, I boot with the USB live session and removed all the logical volumes with the lvremove command. Now the partition display in the `Installation type" window is in the good old way and less confusing now. Sep 18, 2021 at 6:11

You must log in to answer this question.

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