For Proxmox 8.0:
px:~# cat /etc/debian_version
12.0
Add /etc/apt/sources.list.d/pve-no-subscription.list lines:
deb
http://download.proxmox.com/debian/pve bookworm pve-no-subscription
deb
http://security.debian.org/debian-security bookworm-security main contrib
Commenting lines in files:
/etc/apt/sources.list.d/ceph.list
/etc/apt/sources.list.d/pve-enterprise.list
px:~# apt update && apt upgrade -y
px:~# reboot
px:~# apt-get install grub-efi-amd64
px:~# apt-get install mdadm
px:~# sfdisk -d /dev/sda > part_table
px:~# grep -v ^label-id part_table | sed -e 's/, *uuid=[0-9A-F-]*//' |grep -v sda3 | sfdisk /dev/sdb
px:~# partx -u /dev/sdb
px:~# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data pve -wi-a----- 1.00g
root pve -wi-ao---- 32.00g
swap pve -wi-ao---- 8.00g
Create a larger sdb3 than sda3, for example(!) +10G:
px:~# gdisk /dev/sdb
Command (? for help): n
Partition number (3-128, default 3):
First sector (2099200-1953525134, default = 2099200) or {+-}size{KMGTP}:
Last sector (2099200-1953525134, default = 1953525127) or {+-}size{KMGTP}: +42G
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): fd00
Changed type of partition to 'Linux RAID'
Command (? for help): w
px:~# gdisk -l /dev/sdb
…
Number Start (sector) End (sector) Size Code Name
1 34 2047 1007.0 KiB EF02
2 2048 2099199 1024.0 MiB EF00
3 2099200 90179583 42.0 GiB FD00 Linux RAID
px:~# mdadm --create /dev/md0 --level 1 --raid-devices 2 /dev/sdb3 missing
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
px:~# pvcreate /dev/md0
Physical volume "/dev/md0" successfully created.
px:~# vgextend pve /dev/md0
Volume group "pve" successfully extended
px:~# pvmove /dev/sda3 /dev/md0
/dev/sda3: Moved: 0.12%
…
/dev/sda3: Moved: 100.00%
px:~# vgreduce pve /dev/sda3
Removed "/dev/sda3" from volume group "pve"
px:~# gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.9
…
Command (? for help): d
Partition number (1-3): 3
Command (? for help): n
Partition number (3-128, default 3):
First sector (2099200-1953525134, default = 2099200) or {+-}size{KMGTP}:
Last sector (2099200-1953525134, default = 1953525127) or {+-}size{KMGTP}: +42G
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): fd00
Changed type of partition to 'Linux RAID'
Command (? for help): w
...
Do you want to proceed? (Y/N): y
...
The operation has completed successfully.
px:~# partx -u /dev/sda
px:~# mdadm --add /dev/md0 /dev/sda3
mdadm: added /dev/sda3
px:~# dd if=/dev/sda1 of=/dev/sdb1
px:~# dd if=/dev/sda2 of=/dev/sdb2
px:~# mdadm --detail --scan | awk '/ARRAY/ {print}' >> /etc/mdadm/mdadm.conf
px:~# update-initramfs -u -k all
px:~# mkdir /efi
px:~# mount /dev/sda2 /efi
px:~# grub-install --target=x86_64-efi --efi-directory=/efi --no-nvram --force-extra-removable /dev/sda
Installing for x86_64-efi platform.
Installation finished. No error reported.
px:~# umount /efi
px:~# mount /dev/sdb2 /efi
px:~# grub-install --target=x86_64-efi --efi-directory=/efi --no-nvram --force-extra-removable /dev/sdb
Installing for x86_64-efi platform.
Installation finished. No error reported.
px:~# reboot
https://forum.proxmox.com/threads/howto-proxmox-ve-7-with-software-raid-1.93745/
https://forums.debian.net/viewtopic.php?t=153302
Attention!
If the BIOS boot setting is not UEFI boot, but normal boot, then the grub boot error( disk 'lvmid/....' not found.) will still remain; grub will not have access to the lvm partition and the required /boot directory. You need to go into the BIOS and change to UEFI boot type.