...
Failed to find partition number 2 on mmcblk0
See source code in https://github.com/truenas/truenas-installer/blob/master/truenas_installer/install.py
64GB looks like the absolute minimum eMMC to TrueNAS Scale partition sizes
That is the place where we got in the "Bad hardware" category, so a workaround might be to create a partition in advance from the Shell
Code Block | ||||
---|---|---|---|---|
| ||||
async def format_disk(disk: Disk, set_pmbr: bool, callback: Callable):
await wipe_disk(disk, callback)
# Create BIOS boot partition
await run(["sgdisk", "-a4096", "-n1:0:+1024K", "-t1:EF02", "-A1:set:2", disk.device])
# Create EFI partition (Even if not used, allows user to switch to UEFI later)
await run(["sgdisk", "-n2:0:+524288K", "-t2:EF00", disk.device])
# Create data partition
await run(["sgdisk", "-n3:0:0", "-t3:BF01", disk.device])
# Bad hardware is bad, but we've seen a few users
# state that by the time we run `parted` command
# down below OR the caller of this function tries
# to do something with the partition(s), they won't
# be present. This is almost _exclusively_ related
# to bad hardware, but we will wait up to 30 seconds
# for the partitions to show up in sysfs.
disk_parts = await get_partitions(disk.device, [1, 2, 3], tries=30)
for partnum, part_device in disk_parts.items():
if part_device is None:
raise InstallError(f"Failed to find partition number {partnum} on {disk.name}")
if set_pmbr:
await run(["parted", "-s", disk.device, "disk_set", "pmbr_boot", "on"], check=False) |
So workaround might be to create a partition in advance from the Shell
Workaund #1
Code Block |
---|
# Choose (3) Shell option in menu
# remove partition tables
sgdisk -Z /dev/mmcblk0
# from NVMe also (but it might not be neccessary)
sgdisk -Z /dev/nvme0n1
sgdisk -Z /dev/nvme0n1
sgdisk -Z /dev/nvme0n1
# create partition table on eMMC as Install script do it
sgdisk -a 4096 -n 1:0:+1024K -t 1:EF02 -A 1:set:2 /dev/mmcblk0
sgdisk -n 2:0:+524288K -t 2:EF00 /dev/mmcblk0
sgdisk -n 3:0:0 -t 3:BF01 /dev/mmcblk0
# it might be an overkill with partprobes, but anyway
sync;
partporbe
partprobe /dev/mmcblk0
partprobe /dev/nvme0n1
partprobe /dev/nvme1n1
partprobe /dev/nvme2n1
partprobe /dev/nvme3n1
exit # End continue Install.
|
Try using commands like below in the shell
Workaround #2 less chance, but you can play with it too
Code Block |
---|
#dddd if=/dev/zero of=/dev/mmcblk0 bs=4k count=16k dd if=/dev/zero of=/dev/nvme0n1 bs=4k count=16k dd if=/dev/zero of=/dev/nvme1n1 bs=4k count=16k dd if=/dev/zero of=/dev/nvme2n1 bs=4k count=16k dd if=/dev/zero of=/dev/nvme3n1 bs=4k count=16k #partedparted -s /dev/mmcblk0 mktable gpt parted -s /dev/nvme0n1 mktable gpt mkpart primary ext4 2048 4T parted -s /dev/nvme1n1 mktable gpt mkpart primary ext4 2048 4T parted -s /dev/nvme2n1 mktable gpt mkpart primary ext4 2048 4T parted -s /dev/nvme3n1 mktable gpt mkpart primary ext4 2048 4T mkfs.ext4 /dev/mmcblk0p1 -F -m 0 -b 4k -L eMMC1 mkfs.ext4 /dev/mmcblk0p2 -F -m 0 -b 4k -L eMMC2 mkfs.ext4 /dev/mmcblk0p3 -F -m 0 -b 4k -L eMMC3 mkfs.ext4 /dev/nvme0n1p1 -F -m 0 -b 4k -L NVMe1 mkfs.ext4 /dev/nvme1n1p1 -F -m 0 -b 4k -L NVMe2 mkfs.ext4 /dev/nvme2n1p1 -F -m 0 -b 4k -L NVMe3 mkfs.ext4 /dev/nvme3n1p1 -F -m 0 -b 4k -L NVMe4 sync; partprobe partprobe /dev/mmcblk0 partprobe /dev/nvme0n1 partprobe /dev/nvme1n1 partprobe /dev/nvme2n1 partprobe /dev/nvme3n1 lsblk reboot # Install after reboot |
After reboot, try installing again
...