Re: Disk setup X5000

From: Al <al_at_datazap.net>
Date: Wed, 15 Dec 2021 20:42:22 UTC
Hello,

On 13/12/21 13:41, Justin Hibbits wrote:
> On Sat, 11 Dec 2021 17:52:56 -0500
> Al <al@datazap.net> wrote:
>
>> Hello,
>>
>> I have worked for the last few months on this issue without any real
>> solution. I think I may have eliminated some things, but that is it.
>> At first I thought maybe it was that the bootloader could see the
>> partition, but the kernel could not see it, but after much testing I
>> don't think that is the case. Then I thought because we have switched
>> to mbr, that maybe I needed to setup the drives on an i386 system. I
>> don't really own much in the way of i386, but I was able to use the
>> school's laptop to setup a drive, but even the bootloader could not
>> load the kernel from that partition. It really looks like adding
>> bootargs: vfs.root.moutnfrom=ufs:/dev/ada0s2a to uboot does nothing,
>> but doesn't hurt anything either. I think the problem is still with
>> the disk setup. What it really looks like is that it finds the disk,
>> but then later on it tries to remount it and then things go wrong.
>> Before the kernel would look at: the ada disk first, but now it looks
>> at mmcsd0: 4GB first. I guess that I thought a disklabel would fix
>> this.
> You *could* put ubldr on the SD card, but I've not tried that and you
> need to be careful with the partitioning so you don't erase the uboot.
>
>> I have looked at many howto's on using gpart to setup disks. Nothing
>> has helped me.
>>
>> 1. What should be in fstab?
>> 2. Is there a gpart howto somewhere that explains what needs to be
>> done to partition the drives on an X5000?
> I think the u-boot on these systems only supports MBR partitioning, so
> you're stuck with that.  There should be many HOWTOs scattered over the
> internet about using gpart to setup FreeBSD on an MBR system
There are many HowTos on setting up MBR partitions in FreeBSD. I could 
not find anything exactly like what I am doing. What I used was a HowTo 
on setting up a thumbdrive and on setting up a second drive for i386. 
However, I wasn't sure if I was setting this up right, but I have this:

=>       63  234441585  ada1  MBR  (112G)
          63     204800     1  fat16  (100M)
      204863  234236785     2  freebsd  (112G)

=>        0  234236785  ada1s2  BSD  (112G)
           0  234236785       1  freebsd-ufs  (112G)

It shouldn't need swap or a zfs partition to boot, so I really believe 
this is right.


>> 3. Should the disklabel be added with newfs and is there anything
>> else that I need to know?
> The boot partition should be a small FAT partition that just has ubldr
> and your dtb. Everything else can go on the rootfs which should
> be in the disklabel.
>
> My X5000 has the following layout from 'gpart show':
>
> =>        63  1000215153  ada0  MBR  (477G)
>            63      262144     1  fat16  (128M)
>        262207   999953009     2  freebsd  (477G)
>
> =>        0  999953009  ada0s2  BSD  (477G)
>            0   62914560       1  freebsd-ufs  (30G)
>     62914560   16777216       2  freebsd-swap  (8.0G)
>     79691776  920261233       4  freebsd-zfs  (439G)
>
>> 4. Does the slice of the root partition need to be marked active?
> I don't think so.
>
>> 5. Should I be creating a UFS1 or UFS2 partition?
> UFS2.  You can also run ZFS on these systems.  My setup has a rootfs
> that's UFS2, and dedicates the entire rest of the disk to ZFS.

I have tried both and neither has worked.

>> 6. Should -T option be set with newfs?
> Trim?  If you're using an SSD it's a good idea.

All SSDs.

> 7. Could there be something missing in the kernel?
> What other issues are you running into?

Only not booting after it gets to where it mounts the rootfs.

Of course, I am using a serial console, but I believe the video driver 
needs to be installed on a working system with ports, so this may be an 
issue later on.


>
> For reference, relevant U-Boot environment variables (transcribed):
>
> bootargs_sata=vfs.root.mountfrom=ufs:/dev/ada0s2a
> bootcmd=run bootcmd_sata
> bootcmd_sata=sata start; fatload sata 0:1 ${loadaddr} ${bootfile};
> fatload sata 0:1 ${fdtaddr} ${fdtfile}; fdt addr ${fdtaddr}; fdt
> boardsetup; bootelf ${loadaddr}
> bootfile=ubldr
> fdtfile=cyrus_p5020.dtb
This is what I am using.

>> I really need to verify at this point that my setup is correct. I
>> guess it could be something set in uboot, but I don't see how. If I
>> can't figure this out, then maybe someone on this list could help me.
>> I would be willing to pay $100 an hour, or what you make at your day
>> job per hour, or what ever seems reasonable to you to get this issue
>> resolved. I think this could be done remotely by ssh into another
>> computer and then using the serial console, or I can send you a disk,
>> or maybe I could buy time on a working FreeBSD X5000, or I am sure
>> there are other options. I just don't want it to be 2025 and I am
>> still stuck on this issue.
>>
>> Kind Regards,
>> Al
>>
>>
> The easiest way to install would be to gpart from another powerpc
> machine, mount the rootfs, mount the bootfs to ${rootfs}/boot/uboot,
> then extract the base.txz and kernel.txz, that you can find on the
> download server, in the mounted rootfs.  You can then use bsdconfig to
> configure it.
>
> - Justin
>
I didn't know there were binaries available. I looked all over the 
download server, which ones are for the X5000? PowerPC64?

Also, would I need to add the boot fs to fstab?

The system always stops in the same place when booting. The kernel does 
not find the root fs and is looking for it, then the boot stops right 
there. Even using disklabels has not helped. If I change the root 
partition in fstab to something besides the root partition, then its 
behavior different, so I believe that it is finding it, but it can't 
mount it for some reason. I think the next step is to try other binaries 
and see if that helps.

Kind Regards,
Al