Re: 4k sector disk on APU2 problems

2021-03-02 Thread Raimo Niskanen
On Mon, Mar 01, 2021 at 09:41:31PM +, Stuart Henderson wrote:
> On 2021-03-01, Raimo Niskanen  wrote:
> > Hi Misc!
> >
> > Unfortunately I do not have one clear question here, but I wonder if 
> > somebody
> > could shed som light on some problems I have encountered on my PC Engines 
> > APU2.
> >
> > It runs OpenBSD 6.7 from a 32 GB mSATA SSD disk, and I would like to change
> > the disk since it is a few years old now, so I buyed a 128 GB Kingston
> > mSATA SSD, and an mSATA -> SATA adapter and put that combo in an USB 2
> > external disk adapter.
> >
> > The disk showed up as a 4k sector disk, and after installing OpenBSD 6.7
> > over USB over the mSATA-SATA adapter I plugged it in the internal mSATA
> > connector, and it did not boot.
> 
> This is a problem with some USB-SATA adapters. See e.g.
> https://www.klennet.com/notes/2018-04-14-usb-and-sector-size.aspx
> 

Just my bad luck, then...

> > Much fumbling later it seems that when the disk is connected to the
> > internal mSATA slot it is seen as a 512 bytes per sector disk.  I do not
> > know what the BIOS thinks of it (factory SeaBIOS 1.10.something).  When I
> > re-installed with the disk in the mSATA slot I got a bootable installation.
> > Both fdisk and disklabel now says the disk has got 512 bytes per sector.
> > (fdisk says nothing but for a 4k disk it should say it is a 4k disk)
> >
> > My old 32 GB mSATA disk is readable over the mSATA-SATA adapter USB adapter
> > as a 512 bytes per sector disk.
> 
> You could try looking for a different adapter but at this point 
> I would probably install on the new drive (PXE boot or use another USB
> drive to boot the installer), then copy files back from the old drive.
> 
> > So I am just curious about how to handle this disk.  I can install to it
> > in the internal mSATA connector and read the old installation over the
> > mSATA-SATA-USB-adapter.  But one day when I want to install to a new disk
> > again, I will not be able to read from the disk in the 
> > mSATA-SATA-USB-adapter,
> > so the next re-installation looks unpromising.
> 
> backup/restore over the network via another machine perhaps?
> 
> > Some more specific questions:
> > * Would upgrading the BIOS be a good idea
> 
> yes but it won't help with this problem.
> (https://github.com/pcengines/apu2-documentation/blob/master/docs/apu_CPU_boost.md)
> 
> > * Sould upgrading to OpenBSD 6.8 improve the situation
> 
> it won't.
> 
> > * How is the disk sector size determined, and can I affect that?
> 
> by the manufacturer.
> 

Thank you for the information!  Enlighting!

Since I can boot from the internal SD card as well, I can use a different
USB drive as dump/restore storage instead of an external machine.  This
USB encosure sector size pecularity only blocks me from direct copy from
old installation to new, for future re-installations.

But for current re-installation I can read the old disk from the USB
enclosure, since it apparently does not alter the sector size for the old
32 GB disk.

Cheers
-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



Re: 4k sector disk on APU2 problems

2021-03-01 Thread Stuart Henderson
On 2021-03-01, Raimo Niskanen  wrote:
> Hi Misc!
>
> Unfortunately I do not have one clear question here, but I wonder if somebody
> could shed som light on some problems I have encountered on my PC Engines 
> APU2.
>
> It runs OpenBSD 6.7 from a 32 GB mSATA SSD disk, and I would like to change
> the disk since it is a few years old now, so I buyed a 128 GB Kingston
> mSATA SSD, and an mSATA -> SATA adapter and put that combo in an USB 2
> external disk adapter.
>
> The disk showed up as a 4k sector disk, and after installing OpenBSD 6.7
> over USB over the mSATA-SATA adapter I plugged it in the internal mSATA
> connector, and it did not boot.

This is a problem with some USB-SATA adapters. See e.g.
https://www.klennet.com/notes/2018-04-14-usb-and-sector-size.aspx

> Much fumbling later it seems that when the disk is connected to the
> internal mSATA slot it is seen as a 512 bytes per sector disk.  I do not
> know what the BIOS thinks of it (factory SeaBIOS 1.10.something).  When I
> re-installed with the disk in the mSATA slot I got a bootable installation.
> Both fdisk and disklabel now says the disk has got 512 bytes per sector.
> (fdisk says nothing but for a 4k disk it should say it is a 4k disk)
>
> My old 32 GB mSATA disk is readable over the mSATA-SATA adapter USB adapter
> as a 512 bytes per sector disk.

You could try looking for a different adapter but at this point 
I would probably install on the new drive (PXE boot or use another USB
drive to boot the installer), then copy files back from the old drive.

> So I am just curious about how to handle this disk.  I can install to it
> in the internal mSATA connector and read the old installation over the
> mSATA-SATA-USB-adapter.  But one day when I want to install to a new disk
> again, I will not be able to read from the disk in the mSATA-SATA-USB-adapter,
> so the next re-installation looks unpromising.

backup/restore over the network via another machine perhaps?

> Some more specific questions:
> * Would upgrading the BIOS be a good idea

yes but it won't help with this problem.
(https://github.com/pcengines/apu2-documentation/blob/master/docs/apu_CPU_boost.md)

> * Sould upgrading to OpenBSD 6.8 improve the situation

it won't.

> * How is the disk sector size determined, and can I affect that?

by the manufacturer.




Re: 4k sector disk on APU2 problems

2021-03-01 Thread Chris Cappuccio
Raimo Niskanen [raimo+open...@erix.ericsson.se] wrote:
> 
> Much fumbling later it seems that when the disk is connected to the
> internal mSATA slot it is seen as a 512 bytes per sector disk.  I do not
> know what the BIOS thinks of it (factory SeaBIOS 1.10.something).  When I
> re-installed with the disk in the mSATA slot I got a bootable installation.
> Both fdisk and disklabel now says the disk has got 512 bytes per sector.
> (fdisk says nothing but for a 4k disk it should say it is a 4k disk)
> 

You have to install and boot as 4k or install and boot as 512. You can't
mix. Perhaps try and upgrade the bios to see if it changes, but ultimately,
you have to install and boot with the same setting.



Re: 4k sector disk on APU2 problems

2021-03-01 Thread Marcus MERIGHI
Hello, 

raimo+open...@erix.ericsson.se (Raimo Niskanen), 2021.03.01 (Mon) 14:30 (CET):
> The disk showed up as a 4k sector disk, and after installing OpenBSD 6.7
> over USB over the mSATA-SATA adapter I plugged it in the internal mSATA
> connector, and it did not boot.

I've recently had the same encounter. 14TB HDD in an external USB
enclosure, to sync the data to it before putting it in the machine. 

The disk showed 4k sectors in the external enclosure.

After days of data transfer (~11TB) I finally put the HDD it in the
machine and learned the same lesson as you did: the 4k sectors turned to
512 byte sectors when connected internally via SATA. 

Unpleasant, but actually OT for an OpenBSD list, I'm afraid.

Marcus



4k sector disk on APU2 problems

2021-03-01 Thread Raimo Niskanen
Hi Misc!

Unfortunately I do not have one clear question here, but I wonder if somebody
could shed som light on some problems I have encountered on my PC Engines APU2.

It runs OpenBSD 6.7 from a 32 GB mSATA SSD disk, and I would like to change
the disk since it is a few years old now, so I buyed a 128 GB Kingston
mSATA SSD, and an mSATA -> SATA adapter and put that combo in an USB 2
external disk adapter.

The disk showed up as a 4k sector disk, and after installing OpenBSD 6.7
over USB over the mSATA-SATA adapter I plugged it in the internal mSATA
connector, and it did not boot.

Much fumbling later it seems that when the disk is connected to the
internal mSATA slot it is seen as a 512 bytes per sector disk.  I do not
know what the BIOS thinks of it (factory SeaBIOS 1.10.something).  When I
re-installed with the disk in the mSATA slot I got a bootable installation.
Both fdisk and disklabel now says the disk has got 512 bytes per sector.
(fdisk says nothing but for a 4k disk it should say it is a 4k disk)

My old 32 GB mSATA disk is readable over the mSATA-SATA adapter USB adapter
as a 512 bytes per sector disk.

Some time during my fumbling with the 120 GB disk in the mSATA slot, fdisk -v
claimed it could not read from sector 0, but the disklabel command could read
a disklabel.  I think the disklabel then claimed the disk was a 4k sector disk.

So I am just curious about how to handle this disk.  I can install to it
in the internal mSATA connector and read the old installation over the
mSATA-SATA-USB-adapter.  But one day when I want to install to a new disk
again, I will not be able to read from the disk in the mSATA-SATA-USB-adapter,
so the next re-installation looks unpromising.

Some more specific questions:
* Would upgrading the BIOS be a good idea
* Sould upgrading to OpenBSD 6.8 improve the situation
* How is the disk sector size determined, and can I affect that?

Cheers!
-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB