Re: Disk label problem?

2022-06-16 Thread Ted Spradley
On Thu, 16 Jun 2022 16:08:15 +0200
Martin Husemann  wrote:

> On Wed, Jun 15, 2022 at 05:42:55PM -0500, Ted Spradley wrote:
> > The other drive was a NetBSD-5.1 raid pair, one of which was apparently 
> > damaged.
> 
> What was the "Root partition:" value in the "raidctl -s" output for that
> raid?

Too late to find out now, I've already wiped both disks. Actually, I never even 
got to a login prompt, I gave up after a couple hours of waiting for fsck.

-- 
Ted Spradley 


Re: Disk label problem?

2022-06-16 Thread Martin Husemann
On Wed, Jun 15, 2022 at 05:42:55PM -0500, Ted Spradley wrote:
> The other drive was a NetBSD-5.1 raid pair, one of which was apparently 
> damaged.

What was the "Root partition:" value in the "raidctl -s" output for that
raid?

Martin


Re: Disk label problem?

2022-06-15 Thread Ted Spradley
On Wed, 15 Jun 2022 05:12:37 - (UTC)
mlel...@serpens.de (Michael van Elst) wrote:

> tsp...@talent-free-studios.com (Ted Spradley) writes:
> 
> >As long as it's the only disk attached this boots up and works fine:
> >But if there is any other drive attached, that other drive gets mounted as 
> >root (apparently).
> 
> What is on that other drive ?

The other drive was a NetBSD-5.1 raid pair, one of which was apparently damaged.

> Here is a rough description of the default boot process:
> 
> 1. BIOS reads the MBR, usually a BIOS setting that identifies from which 
> drive that is read.
> 2. The secondary bootloaders are read from the same drive.
> 3. The kernel is usually read from the same drive.
> 4. The kernel tries to guess what the root partition is, usually by 
> identifying the partition bootblock.
> 
> So "that other drive gets mounted as root" may mean that BIOS boots
> from it, or that it gets misidentified by the kernel. The latter
> can happen if it is (to some degree) a copy of the first drive.

My best guess now is that EUFI loaded the 9.2 kernel from the /boot (msdos) 
partition, but the borked GPT label prevented it from recognizing the root 
filesystem, so it chose the 5.1 root instead, given the choice.

In any case, the problem is resolved now because I mistakenly typed 
"of=/dev/rwd0a" when I meant rwd1a. I re-installed 9.2 and now I have a good 
GPT label.

-- 
Ted Spradley 


Re: Disk label problem?

2022-06-14 Thread Michael van Elst
tsp...@talent-free-studios.com (Ted Spradley) writes:

>As long as it's the only disk attached this boots up and works fine:
>But if there is any other drive attached, that other drive gets mounted as 
>root (apparently).

What is on that other drive ?

Here is a rough description of the default boot process:

1. BIOS reads the MBR, usually a BIOS setting that identifies from which drive 
that is read.
2. The secondary bootloaders are read from the same drive.
3. The kernel is usually read from the same drive.
4. The kernel tries to guess what the root partition is, usually by identifying 
the partition bootblock.

So "that other drive gets mounted as root" may mean that BIOS boots
from it, or that it gets misidentified by the kernel. The latter
can happen if it is (to some degree) a copy of the first drive.



Re: Disk label problem?

2022-06-13 Thread RVP

On Mon, 13 Jun 2022, Ted Spradley wrote:


Any suggestions how to fix in place?



If you cam convert your MBR to GPT, and label the GPT partitions, then
you can use those labels instead of device-names:

$ cat /boot.cfg
[...]
menu=Boot TEST:gop 0;rndseed /var/db/entropy-file;boot NAME=NetBSD_test:
menu=Boot TEST single user:rndseed /var/db/entropy-file;boot NAME=NetBSD_test: 
-s

$ cat /etc/fstab
NAME=NetBSD_test/   ffs rw,log,noatime  1 1
NAME=NetBSD_swapnoneswapsw,dp
[...]

-RVP


Disk label problem?

2022-06-13 Thread Ted Spradley
As long as it's the only disk attached this boots up and works fine:

unit2$ doas gpt show wd0
gpt: /dev/rwd0: bogus map current=mbr partition new=secondary gpt header
unit2$ doas fdisk wd0
Disk: /dev/rwd0
NetBSD disklabel disk geometry:
cylinders: 465141, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 468862128, bytes/sector: 512

BIOS disk geometry:
cylinders: 1024, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 468862128

Partitions aligned to 2048 sector boundaries, offset 2048

Partition table:
0: EFI system partition (sysid 239)
start 2048, size 262144 (128 MB, Cyls 0-16/113/33)
1: NetBSD (sysid 169)
bootmenu: NetBSD
start 266240, size 468595888 (228807 MB, Cyls 16/146/3-29185/80/63), Active
PBR is not bootable: All bytes are identical (0x00)
2: 
3: 
Bootselector disabled.
First active partition: 1
Drive serial number: 0 (0x)
unit2$ 

But if there is any other drive attached, that other drive gets mounted as root 
(apparently).

I changed all the occurrences of '/dev/wd0' in /etc/fstab to 'ROOT.' thinking 
that would fix it, but it doesn't. I tried "gpt recover" but that didn't change 
the result of "gpt show".

Any suggestions how to fix in place? Or should I just wipe it and start over 
(not much worth saving on it, just rc.conf and my $HOME dot files and a few 
pkg's).

-- 
Ted Spradley