PureOS installation with LVM volume groups

OK,

I tried again to install “LVM on LuKS” with a separate unencrypted /boot-partition, following instructions at

and

https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS

So I prepared the LVM physical volume, the logical volumes and the filesystems on the LuKS-encrypted partition which was “opened” with cryptsetup open /dev/nvme0n1p2

Then I started the Installer, and assigned partitions to mount points. The installation runs smoothly till almost the end, when the following “Error” message appears:

IMG_1244

and the installation process stops. Maybe I did something wrong with the /boot-partition?

I tried also without any encryption, but the result was the same.

I wonder which installer was on PureOS-2.1.iso, it maybe wasn’t as graphical as the current one, but at the time it did the job. Maybe just pack it as an alternative onto the current Live-Image?

1 Like

The installer I believe is the same, called “Calamares”.

The error like requires some research, but it looks like it’s related to EFI. PureOS is not designed to be installed on UEFI systems.

So maybe I didn’t set the partition type to GPT and set the “bios-grup” flag for the /boot-partition. Will retry.

OK<

i retried, taking care that the whole disk had a GPT partition table, and the /boot-partition was flagged as “bios-grub”. Then I did manual partitioning, and essentially assigned mount points, and everything pretty much looked like step 5i of https://tracker.pureos.net/w/installation_guide/live_system_installation/
(with /, /home and swap being LVM logical volumes).

Error message is similar, but ‘grub-install’ has different flags:
Command ‘grub-install --target=i386-pc --force /dev/nvme0n1’ returned non-zero exit status 1.
Installing for i386-pc platform grub-install: error: cannot find a device for /boot/grub (is /dev mounted?).

Errors for line 457 and 429 are like above, modules.bootloader/main.py however has a problem in "line 340, in install_grub bootloader[“installPath”]])

Why target =i386-pc?

I don’t understand why it is i386. PureOS doesn’t build packages for that platform, we’ve moved on to AMD64.

When I try to install onto the existing LVM logical volumes for / and /home, I have a separate (unencrypted, no-LVM) partition of 500 MB for boot on /dev/nvme0n1p1 (LVM is on /dev/nvme0n1p2).

However, the pull down-menu for “Install the boot loader on:” gives me only a choice of the Master Boot Record of the full disk (/dev/nvme0n1), not the 500 MB partition. Maybe that is the reason for the grub-install error (it still persists).

So maybe grub has a problem identifying partition names for /dev/nvme-devices?

https://bugs.launchpad.net/ubuntu/+source/grub-installer/+bug/1507505

Is it possible that this bug is not fixed yet?

So I am still stuck with the grub-install-error. It seems it can not install the bootloader (this happens right at the end of the installation process). And the drop-down-menu only allows to the Master Boot Record of the full disk (/dev/nvme0n1), while the actual boot-partition would be /dev/nvme0n1p1 with mountpoint /boot

There is also the possibility to instal the boot-loader into /boot, but it may be that this tried to install to teh /boot-partition of the LiveUSB (but maybe I am wrong, in any case also this doesn’t work).

Third option which is given in the drop-down-menu is to not install a bootloader at all, but this to me doesn’t make sense.

If I chose the ‘default’ installation wiping the disk, I get 1 dos-partition scheme with 3 partitions /dev/nvme0n1p1 for /boot, /dev/nvme0n1p2 for / (including /home) and /dev/nvme0n1p3 for swap.

In this case everything works, but as soon as I turn /dev/nvme0n1p2 and /dev/nvme0n1p3 into a a physical volume (on dos or gpt disk label), the installation fails with one of the errors given above.

I use the newest Live-Distro, and I do

sudo apt update
sudo apt upgrade

before anything else.

I any case I have the suspicion that it has to do in one way or another with my Samsung SSD 970 PRO 512GB (my Librem15rev2 contains the EVO-version which shows up as /dev/sdb ).

Looks like the corresponding task at
https://tracker.pureos.net/T778
has been given high priority, but is still assigned to “none”.

Also I am not sure what can be done about it, is it the installer, grub, or maybe I am simply doing something wrong.

Would a “walk-through” with all the steps I do help?

What is this “commandline method”?

OK, I have to install a working system now because I need the laptop and will go for the standard installation. In case someone wants to investigate this case further, this is what I did (sorry for the lengthy entry, but I tried several things to get it working):

Boot from LiveUSB (pureos-8.0-gnome-live_20190714-amd64.hybrid.iso)
=> “Test or install PureOS” at Boot menu
=> Go through Welcome-Dialog, setup Wi_Fi

start “Software”-App (this apparently loads additional repositories), then on terminal:

sudo apt update

sudo apt upgrade (62 packages upgraded)

sudo apt install gnome-terminal (more convenient than Tilix)

sudo apt install xfsprogs reiserfsprogs reiser4progs jfsutils kpartx dmraid gpart udftools (don’t know if I need all those, but should do no harm)

sudo apt install grub2 grub grub-efi (I had the hope this would change something, but unfortunately not)

sudo su

fdisk /dev/nvme0n1
(delete existing partition /dev/nvme0n1p1 and existing partition /dev/nvme0n1p2, I start from scratch, “w” writes the new partition table and exits)

fdisk /dev/nvme0n1
g (creates new GPT disklabel)
w (writes new partition table and exits)

fdisk /dev/nvme0n1
n
1
+500M
(boot partition)

n
2
(first sector default)
(last sector default)
(LVM partition)

w
(write and exit)

fdisk /dev/nvme0n1:

Command (m for help): p
Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: Samsung SSD 970 PRO 512GB
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: 68702F5F-92E8-B74F-A7FC-02B9677290B6
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1026047 1024000 500M Linux filesystem
/dev/nvme0n1p2 1026048 1000215182 999189135 476.5G Linux filesystem

Now I encrypt the 2. partition:

cryptsetup -c aes-xts-plain64 -h sha256 -y -s 512 luksFormat /dev/nvme0n1p2
WARNING!
========
This will overwrite data on /dev/nvme0n1p2 irrevocably.
Are you sure? (Type uppercase yes): YES
Enter passphrase for /dev/nvme0n1p2:
Verify passphrase:

And unlocking it:

cryptsetup open /dev/nvme0n1p2 nvme0n1p2_crypt
Enter passphrase for /dev/nvme0n1p2:

Create physical volume and volume-group:

vgcreate librem–vg /dev/mapper/nvme0n1p2_crypt
Physical volume “/dev/mapper/nvme0n1p2_crypt” successfully created.
Volume group “librem–vg” successfully created

Now logical volumes for root, home and swap:

lvcreate --name root --size 50G librem–vg
lvcreate --name home --size 250G librem–vg
lvcreate --name swap --size 32G librem–vg

Create files systems:

mkfs.ext4 /dev/librem–vg/root
mkfs.ext4 /dev/librem–vg/home
mkswap /dev/librem–vg/swap

(I use gparted to add the “bios-grub”-flag to the 500MB partition, but leave it unformatted).

Now start Calamares-Installer:

  • American English

  • Berlin (system languaeg American Englsih (United States)

  • en.US.UTF-8 as locale

  • default keyboard model

Manual partitioning:
Chose “librem–vg - 476.4GiB (/dev/librem–vg)” in drop-down menu:
Edit /dev/librem–vg/home and add mountpoint /home
Edit /dev/librem–vg/root and add mountpoint /
/dev/librem–vg/swap is recognized as “swap” filesystem

Chose "Samsung SSD 970 Pro 512GB - 476.9 GiB (/dev/nvme0n1) from drop-down menu:
Edit /dev/nvme0n1p1, but I can’t select a mount point (which is probably ok),
but it shows as grayed out ext4???

So I reformat it from within the installer, keep it unformatted and make sure that the “bios-grub”-flag
is set.

But in this way, I can’t select a mount point, so I format it with ext2,
set mount point /boot
(and now I can also chose for the “Install boot loader on” drop down-menu
between

  • Master Boot Record of Samsung SSD 970 Pro 512 GB (/dev/nvme0n1)
  • Boot partition (/boot)
  • Do not install a boot loader

I chose the /boot partition

I do “next”, and enter my credentials, and do “next” and it shows a summary:

I do “Install” and confirm.

Installation process starts.

And crashes with an error message about grub-install:

/dev/nvme0n1p1 is now mounted under /tmp/calamares-root-611w276r/boot:

pureos@pureos:~$ df

Filesystem 1K-blocks Used Available Use% Mounted on
udev 16404352 0 16404352 0% /dev
tmpfs 3285516 9684 3275832 1% /run
/dev/sda 1445360 1445360 0 100% /cdrom
/dev/loop0 1396224 1396224 0 100% /rofs
/cow 16427560 1535708 14891852 10% /
tmpfs 16427560 0 16427560 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 16427560 0 16427560 0% /sys/fs/cgroup
tmpfs 16427560 4239724 12187836 26% /tmp
tmpfs 3285512 7308 3278204 1% /run/user/999
/dev/nvme0n1p1 495844 63301 406943 14% /tmp/calamares-root-611w276r/boot
tmpfs 16427560 0 16427560 0% /tmp/calamares-root-611w276r/run

I reformat the partition /dev/nvme0n1p1 (after unmounting) with gparted

And restart the installer.
(I can assign a mountpoint /boot to /dev/nvme0n1p1, and chose again to install
the bootloader into /boot)

=> Same result!

I do again, but this time install bootloader on the Master Boot Record of Samsung Disk.

=> same result

I try again! This time I do not install a boot-loader, and I get a different error message:

“PureOS has not been installed on your computer.
The error message was: Failed to unpack image
“/cdrom/casper/filesystem.squashfs”.”

On the “Error”-window, it says also “rsync failed with error code 11”

So this is how far I got. Anyone has some ideas? Is this a problem of the installer, grub, or maybe even the BIOS?

looks like this still isn’t fixed in the calamares installer: https://github.com/calamares/calamares/issues/1564

I have another question.
Does anybody have luck with transforming his (already installed) L5 mobile phone to LVM?

No, the Librem 5 reflashing process is non-configurable. The most I have ever been able to do is have LUKS encryption or not, or choose between Byzantium and Crimson.

You might be able to use Jumpdrive:

Some discussion of related concepts here:

It doesn’t seem like there’s much documentation around, though

1 Like

Of course.
I meant to use manual methods for setup LVM on L5.

1 Like

But if it’s just a disk image, it should be possible, right?

You can definitely reconfigure the LUKS encryption on the host computer after downloading the disk image and before flashing to the Librem 5.

I guess the big question would be whether the boot image in the boot partition has the necessary support for whatever LVM functionality is required.

Oh and having sufficient knowledge of the details in order to set LVM up that way. :wink:

1 Like

Yes, Calamares should function just like the AMD64 image, then mobile-optimized for the Librem 5.

I think there are always going to be differences between the way PureOS is installed on an x86 computer (can boot from a USB device regardless of the state of the internal disk or disks) and the way PureOS is installed on the Librem 5 (the only boot options are internal eMMC drive or from host computer via USB using uuu, which means that if the internal eMMC drive contents are borked then uuu is the only boot option).

Ultimately both of them could provide the same disk installation options, with somewhat user-friendly GUI, but to make them offer the same options would be a fair amount of effort.

I guess it might help if @neva_blyad shed light on what use of LVM would be made on the Librem 5.

I think that in the past some customers have mused over the possibility of combining the internal eMMC drive and the uSD drive into a single logical drive.

1 Like

I need a LVM snapshot feature.
It would allow to make full backup of root live filesystem.

1 Like