Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Image Added

Table of Contents

Download iso

...

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
languagepy
titletruenas_installer/install.py
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)

Workaround #1

Just re-try install 2-10 times until it work. Yes. as simple as that.


Workaund #2

So next workaround might be to create a partition in advance from the Shell

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/nvme1n1
sgdisk -Z /dev/nvme2n1
sgdisk -Z /dev/nvme3n1
# 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 #3 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

...

And that is the decision you have to think about. What kind of redundancy you want and how much space to sacrifice for that. Like 

ModeSize
Stripe16TB
RAIDZ112TB
dRAID112TB
Mirror4/8TB

So let's choose no redundancy. Like we trust in Samsung and TrueNAS a lot, 

...

Maybe this user will be used to admin this NAS so we can add group for that - builtin_administrators

Same to be done with all NAS users, if there any.

Try copying some files to network share

Image Added

Instances

we skip for now

Apps

...

Now Install - Something goes wrong..

from ssh we con see more

or using System/Shell

Code Block
oliutyi@truenas:~$ sudo awk '{gsub(/\\n/,"\n")}1' /var/log/app_lifecycle.log

fixed by

Code Block
chmown 999:999 /mnt/pool/data/immich/db

so now

Image AddedImage Added

Image AddedImage Added


Image AddedImage Added

Image AddedImage AddedImage Added


Reporting

Image AddedImage AddedImage Added

System

Services

Enable SSH

Image Added

Shell

Image Added