DietPi-PREP | Add LVM + swap partition support

Created on 19 Jul 2019  路  10Comments  路  Source: MichaIng/DietPi

Creating a bug report/issue

Required Information

Hardware: ODROID-H2
OS: debian-10.0.0-amd64-netinst.iso
Setup: DietPi-PREP

Steps to reproduce

  1. Startup install Debian 10.0.0
  2. partition entire disc using LVM
    image
  3. Run and complete DietPi PREP
  4. Reboot
  5. system is left in a non-bootable state in (initramfs)

Expected behaviour

  • Should boot int dietpi

Actual behaviour

Gave up waiting for suspend/resume device
Gave up waiting for root file system device. Common problems:

  • Boot Args(cat /proc/cmdline)
    -check root delay =(did system wait long enough?)
  • missing modules (cat /proc/modules; ls /dec)
    Alert! /dev/mapper/debian--g--root does not exist.. Dropping to shell!

Extra information

Please read this read as it contains the necessary information to describe the issue and provide a fix.

Feature Request Investigation required PREP x86_64

Most helpful comment

LVM support: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-629822409

  • Additionally, likely initramfs-tools is required instead of tiny-initramfs, which is currently installed when choosing VM.

swap partition: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-630098552

@rondadon
Totally forgot that we have an open request about that 馃槃.

All 10 comments

@LexiconCode
Many thanks for your report.

Never tried it with LVM actually, will do a test install with VM (which should behave the same).

Just checking in to see if there's news.

Sorry, it was forgotten by me. I assigned v6.28 milestone to remind myself.

Sorry, it was forgotten by me. I assigned v6.28 milestone to remind myself.

Thanks for looking into it! I believe this will allow
Urbackup client to backup a DietPi-server.

@LexiconCode
I think I found it. From fresh VM with LVM setup I purged lvm2 page. Reboot worked well. I purged some more packages, most likely not related, then though about the initramfs. Ran update-initramfs -u and reboot failed. I need to verify:

apt purge lvm2
apt autoremove --purge
update-initramfs -u
reboot

If the above breaks VM boot replicable, then we found it. Then we need to check for an LVM mount identifier, basically the source path shows it. Then add lvm2 package to dependencies. Since this setup includes a swap partition, this would be another question, to re-add the swap partition to /etc/fstab as well.

However I will not be able to add this with v6.29.

LVM support: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-629822409

  • Additionally, likely initramfs-tools is required instead of tiny-initramfs, which is currently installed when choosing VM.

swap partition: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-630098552

@rondadon
Totally forgot that we have an open request about that 馃槃.

Additional info: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-630510940


Related: #3557

This is a bit all spread out what's the correct approach?

After DietPi-PREP has finished but before rebooting, do:

apt update
apt install lvm2 initramfs-tools
apt autopurge
sed -i '\|[[:blank:]]/[[:blank:]]|s|UUID="[^"]*"|/dev/mapper/vg00-lv01|' /etc/fstab
update-initramfs -u

If there is not (swap) partition present in front of the root partition, vg00-lv01 must be replaced with vg00-lv00.

For the swap partition (if present in front of root partition!):

/boot/dietpi/func/dietpi-set_swapfile 0
mkswap /dev/mapper/vg00-lv00
swapon /dev/mapper/vg00-lv00
echo '/dev/mapper/vg00-lv00 none swap sw' >> /etc/fstab

But check back the drive sources: blkid

Your instructions worked well!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bhaveshgohel picture bhaveshgohel  路  3Comments

aesirteam picture aesirteam  路  3Comments

Fourdee picture Fourdee  路  3Comments

Invictaz picture Invictaz  路  3Comments

oshank picture oshank  路  3Comments