Author Topic: Manual installation with LVM  (Read 18 times)

0 Members and 1 Guest are viewing this topic.

Offline SilencePolyphonia

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
  • AVLinux User
Manual installation with LVM
« on: March 15, 2019, 11:15:08 AM »
Hi everyone

I've just wanted to share, that even though it is not supported by the installer it is indeed possible. Nevertheless this might lead to bugs I have yet to uncover and this hasn't been tested on other machines, so I don't really recommend to do this unless you really know what you are doing, also as always back up your data before trying out installations like this, but if you like me would otherwise not install AV Linux at all here is how I did it just before (if you are careful try it on a VM first, i.e. install another distro with LVM and then add this on top of it).

I assume you have a working Linux distribution on your machine already (and UEFI firmware but it should probably work with BIOS too).

1. Download the ISO from the AV Linux website. (You can do the next step while it downloads.)
2. Create the LVM logical volumes you want to later install AV Linux on using lvcreate. Format these volumes, for example with mkfs.ext4
3. From the ISO extract the file /live/filesystem.squashfs, there are many ways to do this. You can open the ISO with Ark and then drag it out of the window or click extract.
4. Mount this file somewhere, i.e.
Code: [Select]
SRCMNT=/mnt/somedir    # without trailing slash
mkdir $SRCMNT
mount /path/to/filesystem.squashfs $SRCMNT

5. Mount your target filesystem.
Code: [Select]
TARGET=/mnt/target    # without trailing slash
mkdir $TARGET
mount /dev/mapper/vgname-lvname $TARGET
mount yourefipartition $TARGET/boot/efi
# optional: mount home partition etc into $TARGET/home
Warning: Assume that the next step will override the contents of these mounts, so check that they are really empty directories.
6. Copy the files from $SRCMNT to $TARGET
Code: [Select]
sudo cp -aPrv $SRCMNT/* $TARGET 7. Chroot into the directory
Code: [Select]
sudo mount -t proc /proc $TARGET/proc
sudo mount --rbind /sys $TARGET/sys
sudo mount --rbind /dev $TARGET/dev
sudo mount -o bind /run $TARGET/run
sudo cp /etc/resolv.conf $TARGET/etc/resolv.conf
sudo chroot $TARGET /bin/bash
8. Run apt update.
9. apt install lvm2
10. Create the /etc/fstab and fill it with at least your root drive, partition etc (you can use /dev/mapper/... for LVM partitions to specify them). See for more details.
11. Not sure if this is necessary but it will fix a warning, if you don't have a swap drive for some reason. Uncomment /etc/initramfs-tools/conf.d/resume by inserting a "#" as the first character.
12. If you want you can now do apt upgrade. Since grub is installed by default it will likely be updated and trigger the grub-update command. In either case you should probably run grub-install and grub-update as needed to install the bootloader. Usually this should respect/detect the other distributions installed on your machine. (You could also configure Refind to boot it correctly.)
13. And that's it, I hope I did not forget some important steps. Reboot your machine and hopefully it works. If you mess up big time and you are not able to boot anything, you can try some recovery Linux distribution. In my experience on EFI machines Refind is your friend in times like this due to its auto detection capabilities.

Now when the machine reboots you can do stuff like change user name, password, group and home directory (, rename the machine hostname, set the timezone etc.