Re: No valid root disk found when upgrading

2022-04-23 Thread michal . lyszczek
On 2022-04-22 07:56:25, Stuart Henderson wrote:
> On 2022-04-21, Stuart Henderson  wrote:
> >> upgrade# cd /dev; sh MAKEDEV sd0
> >> upgrade# mount -t ffs -r /dev/sd0a /mnt
> >> upgrade# ls /mnt
> >> .cshrc  bsd dev sbin
> >> .profilebsd.booted  etc sys
> >> altroot bsd.rd  hometmp
> >> auto_upgrade.conf   bsd.sp  mailwrapper.coreusr
> >> bin bsd.upgrade rootvar
> >> upgrade# df -h
> >> Filesystem SizeUsed   Avail Capacity  Mounted on
> >> /dev/rd0a  3.5M3.0M451K87%/
> >> /dev/sd0a  3.9G677M3.0G18%/mnt
> >>
> >>> it's worth seeing what "sysctl hw.disknames" says too
> >> upgrade# sysctl hw.disknames
> >> hw.disknames=sd0:dc999ef6267325df,rd0:a8c7c8e3bbaa0da7
> >
> > That looks sane too..
> 
> Oh I didn't look close enough. You are missing /mnt. mkdir it and
> that shoukd fix the problem.
Yup, that was the problem. Thank you!
Guess I must have removed it at some point from my rootfs.
Thanks again for the help Stuart.

-- 
.-.---.--.-.
| Michal Lyszczek | Embedded C, Linux |   Company Address|  .-. opensource |
| +48 727 564 419 | Software Engineer | Akacjowa 10a; 55-330 |  oo|  supporter |
| https://bofc.pl `.--: Brzezinka Sredzka PL | /`'\  & |
| GPG FF1EBFE7E3A974B1 | Bits of Code | NIP:   813 349 58 78 |(\_;/) programer |
`--^--^--^-'


signature.asc
Description: PGP signature


Re: No valid root disk found when upgrading

2022-04-22 Thread Stuart Henderson
On 2022-04-21, Stuart Henderson  wrote:
>> upgrade# cd /dev; sh MAKEDEV sd0
>> upgrade# mount -t ffs -r /dev/sd0a /mnt
>> upgrade# ls /mnt
>> .cshrc  bsd dev sbin
>> .profilebsd.booted  etc sys
>> altroot bsd.rd  hometmp
>> auto_upgrade.conf   bsd.sp  mailwrapper.coreusr
>> bin bsd.upgrade rootvar
>> upgrade# df -h
>> Filesystem SizeUsed   Avail Capacity  Mounted on
>> /dev/rd0a  3.5M3.0M451K87%/
>> /dev/sd0a  3.9G677M3.0G18%/mnt
>>
>>> it's worth seeing what "sysctl hw.disknames" says too
>> upgrade# sysctl hw.disknames
>> hw.disknames=sd0:dc999ef6267325df,rd0:a8c7c8e3bbaa0da7
>
> That looks sane too..

Oh I didn't look close enough. You are missing /mnt. mkdir it and
that shoukd fix the problem.



Re: No valid root disk found when upgrading

2022-04-21 Thread Nick Holland

On 4/21/22 11:46 AM, michal.lyszc...@bofc.pl wrote:

Hello,

So I have OpenBSD 6.8 (yeah I know), and are trying to upgrade to
6.9 (and version by version until 7.1:)). Problem is that installer
does not see disk. This is my very first time I upgrade OpenBSD,
so I might be missing something simple. I've read through the upgrade
documentation, and tried to google my problem but I could not fix
my problem.

I upgrade with sysupgrade. After boot I try to select root disk:

Available disks are: .
Which disk is the root disk? ('?' for details) ?
sd0: NVMe, Samsung SSD 970, 2B2Q  (232.9G)
Available disks are: .
Which disk is the root disk? ('?' for details) sd0
sd0 is not a valid root disk.
Available disks are: .


Going into shell, /dev/sd0* do not exist. So I tried to create nodes:

upgrade# ./MAKEDEV sd0


Now disklabel shows proper disk info
(label is from samsung 960, even though I have samsung 970 disk.
I migrated some time ago from 960 to 970, guess I must have used
dd to do it, hence label from previous disk. I assure you I have
only 1 disk inserted, and no usb disks).

upgrade# disklabel sd0
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: Samsung SSD 960
duid: dc999ef6267325df
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 30401
total sectors: 488397168
boundstart: 1024
boundend: 488397105
drivedata: 0

16 partitions:
#size   offset  fstype [fsize bsize   cpg]
  a:  8400960 1024  4.2BSD   2048 16384 12960
  b: 67119581  8401984swap
  c:4883971680  unused
  d:134223072 75521568  4.2BSD   2048 16384 12960
  e:278652416209744640  4.2BSD   4096 32768 26062
  i:  960   64   MSDOS


fdisk

upgrade# fdisk /dev/rsd0c
Disk: /dev/rsd0c   Usable LBA: 64 to 488397104 [488397168 Sectors]
   #: type [   start: size ]

   1: EFI Sys  [  64:  960 ]
   3: OpenBSD  [1024:488396081 ]


But when I exit shell I still have the very same problem as at the
beginning and I can't select root disk. Strange thing is, that when
I exit shell to installer, and then go back to shell with "!",
/dev/sd0 disappears.


that part is normal; I'm not sure why, but /dev seems to be "cleaned" if you
exit the install script under some (most?) circumstances.


This really isn't a way to work towards figuring out what is going wrong,
but being that a problem with the 6.8 to 6.9 upgrade isn't going to be
fixed at this point, I'm kinda thinking it would be worth just doing a manual
upgrade to 6.9 via copying over the kernel and untaring the files and see if
6.9 to 7.0 goes better.

If you want to play it safe, maybe just copy the new bsd to /bsd69 and
then do a "boot bsd69" and make sure it sees the disks properly before
committing to an actual upgrade.  You will probably get all kinds of nasty
error messages, but if so, you know 6.9 is seeing the disk, and a full
upgrade should be safe.

Nick.



Re: No valid root disk found when upgrading

2022-04-21 Thread Stuart Henderson
On 2022-04-21, michal.lyszc...@bofc.pl  wrote:
> --47wmzg5ty6ypgy6x
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: 7bit
>
> Hello Stuart,
> Thanks for your reply, here is more data
> On 2022-04-21 21:43:08, Stuart Henderson wrote:
>> if you boot the upgrade kernel and drop to a shell, what do you
>> get from this?
>> 
>> cd /dev; sh MAKEDEV sd0
>> mount -t ffs -r /dev/sd0a /mnt
>> ls /mnt
> Sadly, nothing that would raise any flags or ideas in my brain,
> everything seems to work fine
>
> upgrade# cd /dev; sh MAKEDEV sd0
> upgrade# mount -t ffs -r /dev/sd0a /mnt
> upgrade# ls /mnt
> .cshrc  bsd dev sbin
> .profilebsd.booted  etc sys
> altroot bsd.rd  hometmp
> auto_upgrade.conf   bsd.sp  mailwrapper.coreusr
> bin bsd.upgrade rootvar
> upgrade# df -h
> Filesystem SizeUsed   Avail Capacity  Mounted on
> /dev/rd0a  3.5M3.0M451K87%/
> /dev/sd0a  3.9G677M3.0G18%/mnt
>
>> it's worth seeing what "sysctl hw.disknames" says too
> upgrade# sysctl hw.disknames
> hw.disknames=sd0:dc999ef6267325df,rd0:a8c7c8e3bbaa0da7

That looks sane too..

>> (similar to what's used for the "is_rootdisk()" check in
>> src/distrib/miniroot/install.sub)
> Is there a way to run upgrade script with "set -x" globally?
> I tried to run /bin/ksh -x /upgrade.sh, but it seems -x is
> discarded in functions and I can only see debug up untile
> +do_ugrade function call.
>
> Maybe replacing all "() {" with "() {\nset -x" will do the trick?
>

Not 100% sure but there are some functions that return output rather
than just a return code and I think it may break those. Something more
targetted in is_rootdisk might do though (set -x. maybe get rid of the
redirect).




Re: No valid root disk found when upgrading

2022-04-21 Thread michal . lyszczek
Hello Stuart,
Thanks for your reply, here is more data
On 2022-04-21 21:43:08, Stuart Henderson wrote:
> if you boot the upgrade kernel and drop to a shell, what do you
> get from this?
> 
> cd /dev; sh MAKEDEV sd0
> mount -t ffs -r /dev/sd0a /mnt
> ls /mnt
Sadly, nothing that would raise any flags or ideas in my brain,
everything seems to work fine

upgrade# cd /dev; sh MAKEDEV sd0
upgrade# mount -t ffs -r /dev/sd0a /mnt
upgrade# ls /mnt
.cshrc  bsd dev sbin
.profilebsd.booted  etc sys
altroot bsd.rd  hometmp
auto_upgrade.conf   bsd.sp  mailwrapper.coreusr
bin bsd.upgrade rootvar
upgrade# df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/rd0a  3.5M3.0M451K87%/
/dev/sd0a  3.9G677M3.0G18%/mnt

> it's worth seeing what "sysctl hw.disknames" says too
upgrade# sysctl hw.disknames
hw.disknames=sd0:dc999ef6267325df,rd0:a8c7c8e3bbaa0da7

> (similar to what's used for the "is_rootdisk()" check in
> src/distrib/miniroot/install.sub)
Is there a way to run upgrade script with "set -x" globally?
I tried to run /bin/ksh -x /upgrade.sh, but it seems -x is
discarded in functions and I can only see debug up untile
+do_ugrade function call.

Maybe replacing all "() {" with "() {\nset -x" will do the trick?

-- 
.-.---.--.-.
| Michal Lyszczek | Embedded C, Linux |   Company Address|  .-. opensource |
| +48 727 564 419 | Software Engineer | Akacjowa 10a; 55-330 |  oo|  supporter |
| https://bofc.pl `.--: Brzezinka Sredzka PL | /`'\  & |
| GPG FF1EBFE7E3A974B1 | Bits of Code | NIP:   813 349 58 78 |(\_;/) programer |
`--^--^--^-'


signature.asc
Description: PGP signature


Re: No valid root disk found when upgrading

2022-04-21 Thread Stuart Henderson
On 2022-04-21, michal.lyszc...@bofc.pl  wrote:
>> 16 partitions:
>> #size   offset  fstype [fsize bsize   cpg]
>>   a:  8400960 1024  4.2BSD   2048 16384 12960
>>   b: 67119581  8401984swap
>>   c:4883971680  unused
>>   d:134223072 75521568  4.2BSD   2048 16384 12960
>>   e:278652416209744640  4.2BSD   4096 32768 26062
>>   i:  960   64   MSDOS

disklabel looks alright. if you boot the upgrade kernel and drop to a
shell, what do you get from this?

cd /dev; sh MAKEDEV sd0
mount -t ffs -r /dev/sd0a /mnt
ls /mnt

(similar to what's used for the "is_rootdisk()" check in
src/distrib/miniroot/install.sub)

it's worth seeing what "sysctl hw.disknames" says too



No valid root disk found when upgrading

2022-04-21 Thread michal . lyszczek
Hello,

So I have OpenBSD 6.8 (yeah I know), and are trying to upgrade to
6.9 (and version by version until 7.1:)). Problem is that installer
does not see disk. This is my very first time I upgrade OpenBSD,
so I might be missing something simple. I've read through the upgrade
documentation, and tried to google my problem but I could not fix
my problem.

I upgrade with sysupgrade. After boot I try to select root disk:
> Available disks are: .
> Which disk is the root disk? ('?' for details) ?
> sd0: NVMe, Samsung SSD 970, 2B2Q  (232.9G)
> Available disks are: .
> Which disk is the root disk? ('?' for details) sd0
> sd0 is not a valid root disk.
> Available disks are: .

Going into shell, /dev/sd0* do not exist. So I tried to create nodes:
> upgrade# ./MAKEDEV sd0

Now disklabel shows proper disk info
(label is from samsung 960, even though I have samsung 970 disk.
I migrated some time ago from 960 to 970, guess I must have used
dd to do it, hence label from previous disk. I assure you I have
only 1 disk inserted, and no usb disks).
> upgrade# disklabel sd0
> # /dev/rsd0c:
> type: SCSI
> disk: SCSI disk
> label: Samsung SSD 960
> duid: dc999ef6267325df
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 30401
> total sectors: 488397168
> boundstart: 1024
> boundend: 488397105
> drivedata: 0
> 
> 16 partitions:
> #size   offset  fstype [fsize bsize   cpg]
>   a:  8400960 1024  4.2BSD   2048 16384 12960
>   b: 67119581  8401984swap
>   c:4883971680  unused
>   d:134223072 75521568  4.2BSD   2048 16384 12960
>   e:278652416209744640  4.2BSD   4096 32768 26062
>   i:  960   64   MSDOS

fdisk
> upgrade# fdisk /dev/rsd0c
> Disk: /dev/rsd0c   Usable LBA: 64 to 488397104 [488397168 Sectors]
>#: type [   start: size ]
> 
>1: EFI Sys  [  64:  960 ]
>3: OpenBSD  [1024:488396081 ]

But when I exit shell I still have the very same problem as at the
beginning and I can't select root disk. Strange thing is, that when
I exit shell to installer, and then go back to shell with "!",
/dev/sd0 disappears.


More info:
==

Disk is detected in bsd.upgrade kernel
> upgrade# dmesg | grep -i samsung
> nvme0 at pci1 dev 0 function 0 "Samsung SM981/PM981 NVMe" rev 0x00: msix, 
> NVMe 1.3
> nvme0: Samsung SSD 970 EVO Plus 250GB, firmware 2B2QEXM7, serial 
> S4EUNX0R502629B
> sd0 at scsibus1 targ 1 lun 0: 
> nvme0 at pci1 dev 0 function 0 "Samsung SM981/PM981 NVMe" rev 0x00: msix, 
> NVMe 1.3
> nvme0: Samsung SSD 970 EVO Plus 250GB, firmware 2B2QEXM7, serial 
> S4EUNX0R502629B
> sd0 at scsibus0 targ 1 lun 0: 

It seems I am booting with uefi
> >> OpenBSD/amd64 BOOTX64 3.54
> boot>

When system is booted root disk is sd0
> # mount | grep sd0a
> # /dev/sd0a on / type ffs (local)


I don't know what else might be usefull. I have no idea what else I can
do here :(

-- 
.-.---.--.-.
| Michal Lyszczek | Embedded C, Linux |   Company Address|  .-. opensource |
| +48 727 564 419 | Software Engineer | Akacjowa 10a; 55-330 |  oo|  supporter |
| https://bofc.pl `.--: Brzezinka Sredzka PL | /`'\  & |
| GPG FF1EBFE7E3A974B1 | Bits of Code | NIP:   813 349 58 78 |(\_;/) programer |
`--^--^--^-'


signature.asc
Description: PGP signature