Re: cannot boot from SSD

2021-10-26 Thread Claus Assmann
Thanks for the details; I overwrote the mbr using

dd of=/dev/rsd0c if=/usr/mdec/mbr bs=512 count=1

and then used fdisk to reinstall the OpenBSD partition to the
values I used before - and now the system can boot from the ssd.

Thank you very much for the help!

-- 
Address is valid for this mailing list only, please do not reply
to it direcly, but to the list.



Re: cannot boot from SSD

2021-10-26 Thread Crystal Kolipe
On Tue, Oct 26, 2021 at 07:20:41AM -0300, Crystal Kolipe wrote:
> manually type 'boot sd0a:/bsd'

That should be hd0a:/bsd



Re: cannot boot from SSD

2021-10-26 Thread Crystal Kolipe
On Tue, Oct 26, 2021 at 08:15:48AM +0100, Claus Assmann wrote:
> On Mon, Oct 25, 2021, Crystal Kolipe wrote:
> 
> > Can you provide the output of the atactl identify command for this unit?
> 
> Thanks for the reply; below is the output from atactl identify,
> fdisk, and disklabel. The disk can be mounted without a problem
> and -- based on a brief look -- has the installed content.
> Is there some simple way to check that the boot loader is installed
> on the disk (besides trying to read some sectors using od or something
> similar?)
> 
> # atactl sd0 identify
> Model: KINGSTON SA400S37240G, Rev: S1Z40102, Serial #: 50026B7380B702FF

You seem to have a different firmware revision to any of our drives, which 
might be relevant, however...

> $ fdisk sd0
> Disk: sd0 geometry: 29185/255/63 [468862128 Sectors]
> Offset: 0 Signature: 0xAA55
> Starting Ending LBA Info:
>  #: id  C   H   S -  C   H   S [   start:size ]
> ---
>  0: BF  0   1   2 -  14592 254  63 [  64:   234436481 ] Solaris   
>   
>  1: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
>   
>  2: 00  0   0   0 -  0   0   0 [   0:   0 ] unused
>   
> *3: A6  14593   0   1 -  29184 254  63 [   234436545:   234420480 ] OpenBSD   
>   

Seeing that you have Solaris installed on the same disk, I'm now wondering if 
you have some non-standard MBR code that is causing the problem.

As your Solaris partition is first on the disk, I'm assuming that you installed 
OpenBSD afterwards.  I'm also assuming that you didn't manually use the 
'update' command from within OpenBSD fdisk to overwrite the MBR boot code, 
(just the boot code and not the partition data).

The OpenBSD MBR code, I.E. what would be loaded from the first sector on the 
SSD at boot, is responsible for displaying the 'Using drive X, partition Y' 
message.  If you are not seeing this, then the OpenBSD MBR code is not running.

Of course, the Solaris MBR code should also correctly parse the partition 
table, see that partition 3 is flagged as active and pass control to the 
OpenBSD PBR contained in it, at which point you would see 'Loading', but that 
is not happening.

If you boot into the OpenBSD bootloader from another device, such as a USB 
flash drive with the OpenBSD installation media on it, and manually type 'boot 
sd0a:/bsd', or whatever device the BIOS sees the SSD as, you should find that 
your newly installed system boots.

If you want to write the OpenBSD MBR code to the SSD, you can do that using the 
'update' command within fdisk.  This will probably allow you to boot OpenBSD 
from the SSD.  However, you will have overwritten the Solaris MBR, which may or 
may not cause you issues booting Solaris.

You could back up the existing MBR first with a command such as:

# dd if=/dev/sd0c of=$HOME/old_mbr bs=512 count=1

If you want to check that the OpenBSD MBR code is installed on the disk, the 
output of the following two commands should match:

# dd if=/usr/mdec bs=446 count=1 | hexdump -C
# dd if=/dev/sd0c bs=446 count=1 | hexdump -C



Re: cannot boot from SSD

2021-10-26 Thread Claus Assmann
On Mon, Oct 25, 2021, Crystal Kolipe wrote:

> Can you provide the output of the atactl identify command for this unit?

Thanks for the reply; below is the output from atactl identify,
fdisk, and disklabel. The disk can be mounted without a problem
and -- based on a brief look -- has the installed content.
Is there some simple way to check that the boot loader is installed
on the disk (besides trying to read some sectors using od or something
similar?)

# atactl sd0 identify
Model: KINGSTON SA400S37240G, Rev: S1Z40102, Serial #: 50026B7380B702FF
Device type: ATA, fixed
Cylinders: 16383, heads: 16, sec/track: 63, total sectors: 468862128
Device capabilities:
ATA standby timer values
IORDY operation
IORDY disabling
Device supports the following standards:
ATA-3 ATA-4 ATA-5 ATA-6 ATA-7 ATA-8 ATA-9 ATA-10 
Master password revision code 0xfffe
Device supports the following command sets:
NOP command
READ BUFFER command
WRITE BUFFER command
Host Protected Area feature set
Read look-ahead
Write cache
Power Management feature set
Security Mode feature set
SMART feature set
Flush Cache Ext command
Flush Cache command
48bit address feature set
Advanced Power Management feature set
DOWNLOAD MICROCODE command
Device has enabled the following command sets/features:
NOP command
READ BUFFER command
WRITE BUFFER command
Host Protected Area feature set
Read look-ahead
Write cache
Power Management feature set
SMART feature set
Flush Cache Ext command
Flush Cache command
48bit address feature set
DOWNLOAD MICROCODE command

$ fdisk sd0
Disk: sd0   geometry: 29185/255/63 [468862128 Sectors]
Offset: 0   Signature: 0xAA55
Starting Ending LBA Info:
 #: id  C   H   S -  C   H   S [   start:size ]
---
 0: BF  0   1   2 -  14592 254  63 [  64:   234436481 ] Solaris 
 1: 00  0   0   0 -  0   0   0 [   0:   0 ] unused  
 2: 00  0   0   0 -  0   0   0 [   0:   0 ] unused  
*3: A6  14593   0   1 -  29184 254  63 [   234436545:   234420480 ] OpenBSD 

$ disklabel sd0
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: KINGSTON SA400S3
duid: 2c155e5bcc7344d0
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 29185
total sectors: 468862128
boundstart: 234436545
boundend: 468857025
drivedata: 0 

16 partitions:
#size   offset  fstype [fsize bsize   cpg]
  a:  2097151234436545  4.2BSD   2048 16384 12960 
  b: 17267584236533696swap
  c:4688621280  unused
  d:  8388608253801280  4.2BSD   2048 16384 12960 
  e: 27767872262189888  4.2BSD   2048 16384 12960 
  f: 12582912289957760  4.2BSD   2048 16384 12960 
  g:  2097152302540672  4.2BSD   2048 16384 12960 
  h: 33947968304637824  4.2BSD   2048 16384 12960 
  i:234436481   64 unknown
  j:  4194304338585792  4.2BSD   2048 16384 12960 
  k: 12582912342780096  4.2BSD   2048 16384 12960 
  l:113494016355363008  4.2BSD   2048 16384 12960 

-- 
Address is valid for this mailing list only, please do not reply
to it direcly, but to the list.



Re: cannot boot from SSD

2021-10-25 Thread Crystal Kolipe
On Mon, Oct 25, 2021 at 08:42:06PM +0100, Claus Assmann wrote:
> I installed OpenBSD 7.0 via miniroot70.img from a USB stick on a
> Kingston SA400S3 SSD but unfortunately the machine does not boot
> from it (there is just a blinking cursor at the top of console).

We've used several Kingston SA400S3 SSDs on OpenBSD machines, including as boot 
drives, and not had many problems.

Can you provide the output of the atactl identify command for this unit?

One thing we have noticed is that large continuous writes to these SSDs often 
result in extremely slow performance for a while after ~500 Mb of writing, with 
the process stuck in a biowait state.  One unit that had been in use for a 
couple of years got so bad that we had to secerase it, and which point it 
seemed to brick itself for about 24 hours before coming back to life and on the 
face of it working just fine ever since.

Our Sandisk Ultra II and Corsair Force SSDs have never shown similar issues.