Boot from SD card Fails

Shakran

New Member
Apr 25, 2024
9
0
1
so i recently redid my configuration and put my p420i controller into HBA mode.
This way, nothing boots anymore, as i was told.

Now i saw there is a way to move the boot partition onto SD card and boot from there.
I booted up a Gparted live cd, copied the boot partition over( /dev/sda1 nd sda2, so grub and boot), it didnt boot.

Then i got into the more complex stuff, and found out via command line how to reinstall grub.
open terminal as root:
mkdir /tmp/mydir
vgchange -a y
mount /dev/pve/root /tmp/mydir #it was /dev/sda3, but since pve is a lvm, it needs to be like this to go to root filesystem right?
mount --bind /dev /tmp/mydir/dev
mount --bind /proc /tmp/mydir/proc
mount --bind /sys /tmp/mydir/sys
mount --bind /dev/sdb2 /tmp/mydir/boot
chroot /tmp/mydir
grub-install /dev/sdb
exit
reboot

but this ends up booting into grub and not into pve, and im questioning why it does that and if i have done something wrong or missing somehting. I dont really know how to make it boot now. There are no proper guides showing how to move over the boot partition to make it boot again from HBA mod, only people saying it can be done.
I need some help from you experts.
 
The chroot looks fine but you might also need to mount the efivars: https://forum.proxmox.com/threads/rescue-boot-change-kernel-cmdline.144767/post-651871

Also, on modern Proxmox, you let proxmox-boot-tool handle the grub-install (or systemd-boot). What if you chroot into your Proxmox (with efivars if you boot in UEFI mode) and simply add the ESP-partition on the SD-card to proxmox-boot-tool: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysboot_proxmox_boot_setup . You probably can (or maybe need to?) remove the other ESP-partitions since they are appear to be no longer bootable.
 
The chroot looks fine but you might also need to mount the efivars: https://forum.proxmox.com/threads/rescue-boot-change-kernel-cmdline.144767/post-651871

Also, on modern Proxmox, you let proxmox-boot-tool handle the grub-install (or systemd-boot). What if you chroot into your Proxmox (with efivars if you boot in UEFI mode) and simply add the ESP-partition on the SD-card to proxmox-boot-tool: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysboot_proxmox_boot_setup . You probably can (or maybe need to?) remove the other ESP-partitions since they are appear to be no longer bootable.
mhhh need to try that out. it also lists alot more things to bind then the guide i found
Thank you already for this!
 
ok so i tried the proxmox boot tool version, but i fail there too.

So i did a new isntallation, got into the 3rd console after the installation of pve.
Tried the proxmox-boot-tool init /dev/sdc2.

And i get grub-install.real not found.

I tried to go with my old method of mounting dev, sys, proc. efi and boot wasnt possible.
first i got the error that it is part mbr part gpt, and the fixing of this with --force didnt work because it also wanted the -g argument which it didnt accept anymore.
Redid the whole table with fdisk, then it said wrong filesystem.
Redid the filesystem, wrong partition scheme (and then some cryptic hex code)

i tried alot, redid alot, but i cant get the proxmox-boot-tool to install grub on my sdcard. do i need to do something before i use the boot tool after installing pve?
 
FYI you are putting yourself through a very difficult process for no gain. SDcard is not a recommended boot media for Proxmox, it will likely wear out in a fairly short period of time and you will be back at Square 1 with having to replace the boot disk again.

If you have the budget, buy something like a Samsung T7 and install onto that, your life will be much simpler
 
FYI you are putting yourself through a very difficult process for no gain. SDcard is not a recommended boot media for Proxmox, it will likely wear out in a fairly short period of time and you will be back at Square 1 with having to replace the boot disk again.

If you have the budget, buy something like a Samsung T7 and install onto that, your life will be much simpler
what i absically try to do is get myself a server for multiple things that so far needed all a microcomputer for it. having it in one palce is way better.
I failed upon finding a smb share OS that doesnt run with ZFS.

I had proxmox running fine, but with raid, and thus not being nice with truenas.
So i thought i will try to go this route with hba passthrough, but the rattail behind it is really something... FIrst to get HBA working and now proxmox...

i dont know (yet) about a os that can do shares and all kinda like truenas, without being plane windows. sure that would work, but the reliability of anything linux is just way better.

if i cant find a solution and my tests fail further, i might revert it all, go raid again, and will go away from zfs
 
FYI you are putting yourself through a very difficult process for no gain. SDcard is not a recommended boot media for Proxmox, it will likely wear out in a fairly short period of time and you will be back at Square 1 with having to replace the boot disk again.
A SD card or USB stick is fine for an ESP. It is not (re)written that often and historically a perfectly valid way to boot ZFS. But don't install Proxmox (rpool) on it!
 
Ok, i got the mystery solved on how it is done that noone has Told yet in the whole picture.
So for Everyone using HBA or TI Mode on p420i or LSI cards, its a few steps, not really that complicated tho.

Go into Gparted and delete the SD card you want to use.
either you create with Gparted, or with fdisk some 1024mb fat32 partition, but then continue with fdisk:
fdisk /dev/sdX (choose sd card)
n (make partition)
start is 34
End is 2047
v (set partition type)
BIOS boot
w (write data)

This is the Bios boot partition. pretty important step. you can also do this afterwards if your main partition on the sd card didnt start before 2047.

no install proxmox in the debug GUI. When you are at the reboot screen, klick reboot and get the 3rd Terminal.
In there you type:
mkdir /tmp/mydir
mount /dev/pve/root
mount --bind /dev /tmp/mydir/dev
mount --bind /sys /tmp/mydir/sys
mount --bind /proc /tmp/mydir/proc
mount --bind /run /tmp/mydir/run
chroot /tmp/mydir
proxmox-boot-tool format /dev/sdbX (X=your soon-to-be SD card boot partition)
proxmox-boot-tool init /dev/sdbX (X=your SD card boot partition)


this actually did work.

In my case i forgot the bios boot partition, but i had my main grub partition starting at like 800mb on the sd card, so i could put my BIOS boot partition in the front still with fdisk.

But yeah, that is the mystery on how to use the proxmox-boot-tool to create a separate boot device if you are on pass-through mode.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!