Booting Proxmox from internal SD card (only /boot partition)

shalak

Member
May 9, 2021
57
4
13
39
Hello!

I'm trying to setup a Proxmox installation on HP Proliant DL380e with ZFS on P420. I switched it to HBA mode and I'm trying to follow this tutorial. I'm having issues with the Step 2.

I'm running the commands below on live debian 11. I installed zfsutils-linux and SSH (SSH because iLO console is very, very slow).

For mounting the pool I had to use different command. I executed zpool import -f -R /mnt rpool:
Code:
root@debian:~# zpool import -f -R /mnt rpool
root@debian:~# df -H
Filesystem        Size  Used Avail Use% Mounted on
udev               34G     0   34G   0% /dev
tmpfs             6.8G  1.6M  6.8G   1% /run
/dev/sr0          947M  947M     0 100% /run/live/medium
/dev/loop0        721M  721M     0 100% /run/live/rootfs/filesystem.squashfs
tmpfs              34G  231M   34G   1% /run/live/overlay
overlay            34G  231M   34G   1% /
tmpfs              34G     0   34G   0% /dev/shm
tmpfs             5.3M     0  5.3M   0% /run/lock
tmpfs              34G     0   34G   0% /tmp
tmpfs             6.8G  4.1k  6.8G   1% /run/user/1000
rpool/ROOT/pve-1  231G  1.3G  230G   1% /mnt
rpool             230G  132k  230G   1% /mnt/rpool
rpool/ROOT        230G  132k  230G   1% /mnt/rpool/ROOT
rpool/data        230G  132k  230G   1% /mnt/rpool/data
root@debian:~# ls /mnt/
bin  boot  dev    etc  home  lib    lib32  lib64  libx32  media  mnt  opt  proc  root  rpool  run  sbin  srv  sys  tmp  usr  var
root@debian:~# zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
rpool   222G  1.16G   221G        -         -     0%     0%  1.00x    ONLINE  /mnt

I also mounted the freshly ext4-formatted SD card: root@debian:~# mount /dev/sdi1 /mnt/boot

Ok, and what now - the tutorial mentions to edit the fstab - but which one? The one from live debian, i.e. /etc/fstab or the one from proxmox partition, i.e. /mnt/etc/fstab? I'm not sure how it's supposed to work, can someone shed some light?

Nevertheless I started to experiment and I wanted to use the approach of chroot, as described by u/jochim_vd in the comment. I assumed, that he made a typo there and he meant to chroot /mnt instead of /tmp. I chrooted and then I edited the /etc/fstab - and since I was in chroot, I believe it was the proxmox one (am I correct?). I added proper entry there:

Code:
root@debian:~# for i in /sys /proc /run /dev; do mount --bind "$i" "/mnt$i"; done

root@debian:~# mount -l
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=32935588k,nr_inodes=8233897,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=6591240k,mode=755)
/dev/sr0 on /run/live/medium type iso9660 (ro,noatime,nojoliet,check=s,map=n,blocksize=2048) [d-live 11.0.0 st amd64]
/dev/loop0 on /run/live/rootfs/filesystem.squashfs type squashfs (ro,noatime)
tmpfs on /run/live/overlay type tmpfs (rw,noatime,size=32956188k,mode=755)
overlay on / type overlay (rw,noatime,lowerdir=/run/live/rootfs/filesystem.squashfs/,upperdir=/run/live/overlay/rw,workdir=/run/live/overlay/work)
tmpfs on /usr/lib/live/mount type tmpfs (rw,nosuid,nodev,noexec,relatime,size=6591240k,mode=755)
/dev/sr0 on /usr/lib/live/mount/medium type iso9660 (ro,noatime,nojoliet,check=s,map=n,blocksize=2048) [d-live 11.0.0 st amd64]
/dev/loop0 on /usr/lib/live/mount/rootfs/filesystem.squashfs type squashfs (ro,noatime)
tmpfs on /usr/lib/live/mount/overlay type tmpfs (rw,noatime,size=32956188k,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=38418)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=6591236k,nr_inodes=1647809,mode=700,uid=1000,gid=1000)
rpool/ROOT/pve-1 on /mnt type zfs (rw,noatime,xattr,noacl)
rpool on /mnt/rpool type zfs (rw,noatime,xattr,noacl)
rpool/ROOT on /mnt/rpool/ROOT type zfs (rw,noatime,xattr,noacl)
rpool/data on /mnt/rpool/data type zfs (rw,noatime,xattr,noacl)
/dev/sdi1 on /mnt/boot type ext4 (rw,relatime)
sysfs on /mnt/sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /mnt/proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /mnt/run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=6591240k,mode=755)
udev on /mnt/dev type devtmpfs (rw,nosuid,relatime,size=32935588k,nr_inodes=8233897,mode=755)

root@debian:~# chroot /mnt/

root@debian:/# blkid -c /dev/null
(...)
/dev/sdi1: UUID="ed181fd9-04bc-489d-bde9-7127baa9889a" BLOCK_SIZE="4096" TYPE="ext4"
(...)

root@debian:/# echo "UUID=ed181fd9-04bc-489d-bde9-7127baa9889a /boot ext4 defaults 0 0" >> /etc/fstab

Now the grub part, about which I'm not sure at all what's going on:

Code:
root@debian:/# update-grub
Generating grub configuration file ...
W: This system is booted via proxmox-boot-tool:
W: Executing 'update-grub' directly does not update the correct configs!
W: Running: 'proxmox-boot-tool refresh'

Copying and configuring kernels on /dev/disk/by-uuid/6DAA-6603
    Copying kernel 5.11.22-1-pve
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.11.22-1-pve
Found initrd image: /boot/initrd.img-5.11.22-1-pve
done
Copying and configuring kernels on /dev/disk/by-uuid/6DAC-0FA7
    Copying kernel 5.11.22-1-pve
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.11.22-1-pve
Found initrd image: /boot/initrd.img-5.11.22-1-pve
done
Found linux image: /boot/vmlinuz-5.11.22-1-pve
Found initrd image: /boot/initrd.img-5.11.22-1-pve
Found memtest86+ image: /memtest86+.bin
Found memtest86+ multiboot image: /memtest86+_multiboot.bin
done
I do not know if the above warning is valid or not :/ After all I am doing something that's not officially supported. I assumed it was not valid and started to proceed with grub-install:

Code:
root@debian:/# grub-install /dev/sdi
grub-install is disabled because this system is booted via proxmox-boot-tool, if you really need to run it, run /usr/sbin/grub-install.real
I assumed I should use the "real" one:
Code:
root@debian:/# grub-install.real /dev/sdi
Installing for i386-pc platform.
Installation finished. No error reported.

After the reboot, the grub failed to import the zpool:

1629719269582.png

I executed zpool import -f rpool then exit. After that, the Proxmox loaded successfully and after rebooting it's still working.

So it appear to be working, but I hate a situation in which something works and I don't know why. Can someone please validate that my actions above are correct and shed some light on the blind spots?
 
The S.M.A.R.T. appears as "UNKNOWN" in Proxmox GUI:
1629727443623.png

But from console it appears to be working - I guess I messed something up during the installation? (sda is one of the storage drives, proxmox is installed on sdg+sdh)

Code:
[16:00:30][root@zoltan]:~# smartctl -a /dev/sda
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.11.22-1-pve] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sda: requires option '-d cciss,N'
Please specify device type with the -d option.

Use smartctl -h to get a usage summary

[16:02:47][root@zoltan]:~# smartctl -a /dev/sda1
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.11.22-1-pve] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Seagate IronWolf
Device Model:     ST4000VN008-2DR166
Serial Number:    ZDH9LH5K
LU WWN Device Id: 5 000c50 0c938c452
Firmware Version: SC60
User Capacity:    4,000,787,030,016 bytes [4.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5980 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-3 T13/2161-D revision 5
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Mon Aug 23 16:02:49 2021 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00)    Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)    The previous self-test routine completed
                    without error or no self-test has ever
                    been run.
Total time to complete Offline
data collection:         (  581) seconds.
Offline data collection
capabilities:              (0x73) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    No Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003)    Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01)    Error logging supported.
                    General Purpose Logging supported.
Short self-test routine
recommended polling time:      (   1) minutes.
Extended self-test routine
recommended polling time:      ( 601) minutes.
Conveyance self-test routine
recommended polling time:      (   2) minutes.
SCT capabilities:            (0x50bd)    SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   065   065   044    Pre-fail  Always       -       3417529
  3 Spin_Up_Time            0x0003   093   093   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       12
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   100   253   045    Pre-fail  Always       -       949151
  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       1380 (108 168 0)
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       12
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   077   076   040    Old_age   Always       -       23 (Min/Max 22/23)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       13
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       250
194 Temperature_Celsius     0x0022   023   040   000    Old_age   Always       -       23 (0 19 0 0 0)
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       1380 (81 85 0)
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       3035499
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       382030

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
 
Last edited:
pveperf looks poor when it comes to the raid-z2 datapool I created:

Code:
# pveperf /datapool/
CPU BOGOMIPS:      115091.04
REGEX/SECOND:      1281010
HD SIZE:           14356.56 GB (datapool)
FSYNCS/SECOND:     137.60
DNS EXT:           20.92 ms
DNS INT:           14.18 ms (mydomain)

On the mirrored SSD drives looks good, I guess:
Code:
# pveperf
CPU BOGOMIPS:      115091.04
REGEX/SECOND:      1321827
HD SIZE:           215.06 GB (rpool/ROOT/pve-1)
FSYNCS/SECOND:     1481.00
DNS EXT:           59.45 ms
DNS INT:           86.64 ms (mydomain.com)
 
Last edited by a moderator: