DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 4th July 2022
stanl stanl is offline
Real Name: Stan
Shell Scout
 
Join Date: Jun 2019
Location: New York
Posts: 129
Default Re-installing OpenBSD

After fixing my /etc/mail/aliases file with jggimi's help, I continued to poke around where I shouldn't have been poking.
As a result I have to do a fresh install of OpenBSD but am stuck before I even begin.

I have a MacBook Air which I used to download the AMD64 version of install71.img from the OpenBSD web site.

Now, using the Mac:

diskutil list tells me the flash drive is /dev/disk2.

I unmount the drive with diskutil unmountDisk /dev/disk2.

Then:

dd if=/Users/stan/install71.img of=/dev/rdisk2s1 bs=512 (I tried bs=1M but got an error invalid numeric value).

After a few miunutes dd finishes without an error. I put the flash drive in my X220 and try to boot from it but the drive is blank.

What am I doing wrong?

Thank you
Reply With Quote
  #2   (View Single Post)  
Old 4th July 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,722
Default

This isn't an OpenBSD question. It's a MacOS question. I'm going to guess, having never used MacOS, that the "s1" in your output device string is incorrect. A bootable image must be written to the whole drive starting at logical block address zero.

Of course, this is just a wild guess.
Reply With Quote
  #3   (View Single Post)  
Old 4th July 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,722
Default

Oh, yes ... if you can still get a "boot>" prompt from the OpenBSD system that you broke, you should be able to load the RAMDISK kernel stored in the root partition: just enter "bsd.rd" at that prompt. From there, you can re-install over a network connection, or restore from backup, or perform other rescue operations.
Reply With Quote
  #4   (View Single Post)  
Old 11th August 2022
Nixota Nixota is offline
New User
 
Join Date: Aug 2022
Posts: 6
Default

Hello,

I just had a very similar situation as the one described here, where I too am (unsuccessfully) trying to install OpenBSD vs.7.1 - on a Thinkpad P51 - to substitute MS Win10. Here the list of activities:

- REFERENCES:
https://ftp.openbsd.org/pub/OpenBSD/.../INSTALL.amd64
https://www.openbsd.org/faq/faq4.html
https://sohcahtoa.org.uk/openbsd.html

- On a MAC with Mojave OS:
1. initialize USB flashcard: format MS-DOS(FAT), i.e. FAT32
2. check the USB volume: $ diskutil list
3. unmount the USB volume: $ diskutil unmountDisk /dev/DISCNAME
4. burn a raw disk image on it: $ dd if=install71.img of=/dev/rDISCNAME bs=1m
5. $ diskutil eject /dev/DISCNAME

- On a LAPTOP Lenovo ThinkPad P51 (2017) with MS windows:
1. BIOS set up: no 'secure boot' + active 'UEFI mode' + 'CSM support' + set USB HDD as first bootable device
2. plug the USB flashcard on the USB 3.0 port
3. choose the USB HDD bootloader and load:
3.1 the OpenBSD/amd64 BOOTX64 3.59 fails, and no installation prompt is given.

The final result is what appears in the boot> as:
cannot open hd0a:/etc/random.seed: Invalid Argument
booting hd0a:/bsd: open hd0a:/bsd: Invalid Argument
(...)
and another series of other booting directories with 'Invalid Argument' .

As a last attempt, I tried to invoke $ boot> bsd.rd (the Ramdisk kernel), but to no avail.

Thank you in advance for your feedback!

Last edited by Nixota; 30th August 2022 at 03:54 PM.
Reply With Quote
  #5   (View Single Post)  
Old 11th August 2022
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,977
Default

To summarize:

1. You created an USB memory stick on a Apple MAC under the Mojave OS.
2. The resulting USB device does not completely boot on your Lenovo ThinkPadP51, that has MS Windows on it.

The error is:
Code:
open (hd0a:/etc/boot.conf) : Invalid argument
Then both efforts to read /etc/random.seed and to load the /bsd kernel fails.

I think something went wrong with writing the install image to the USB stick.
You could try to write the install image to the USB stick for a second time. But now with a conv=sync added to it:

Code:
$ dd if=install71.img of=/dev/rDISCNAME bs=1m conv=sync
Why?
MAC OS has most of its utilities from FreeBSD. And the conv=sync is needed on FreeBSD (see https://docs.freebsd.org/en/books/ha...bsdinstall-pre )

BTW that section of the FreeBSD handbook has procedures how to write an USB flash drive/memory stick under Windows.

There is no need to format the USB device with MS-DOS FAT32.
The dd command will copy block by block ignoring anything that was originally on the USB thingy.

If it still does not boot you could try another USB stick, I had two USB sticks gone bad recently
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 11th August 2022 at 05:15 PM.
Reply With Quote
  #6   (View Single Post)  
Old 11th August 2022
k9w k9w is offline
New User
 
Join Date: Oct 2020
Posts: 3
Default

stanl, here is how writing a bootable image to USB is explained by Arch Linux. Same should apply for OpenBSD.

Specifically:
- Don't use the s1.
- Use bs=1m, not bs=1M

This agrees with what J54nko posted and should help Nixota too.

Loving the new https! I would have commented on the announcement thread itself but here works too.
Reply With Quote
  #7   (View Single Post)  
Old 13th August 2022
Nixota Nixota is offline
New User
 
Join Date: Aug 2022
Posts: 6
Default

@J65nko, thank you very much!

I followed your instructions - sure, my initial CLI command to burn the flash USB was not correct - now OpenBSD is running on my machine.

BR
Reply With Quote
  #8   (View Single Post)  
Old 16th August 2022
Nixota Nixota is offline
New User
 
Join Date: Aug 2022
Posts: 6
Default

[UPDATE] Big troubles re-installing OpenBSD

Hello again. After a first successful installation of OpenBSD, I found an unexpected situation when propping up the .xsession file for configuring the cwm windows manager. All of a sudden - after rebooting - the OS was not showing any GUI log in prompt, but only the CLI.

I then decided to redo the installation from scratch. That's where troubles arose.
Everything was done exactly like suggested from:
1. https://www.openbsd.org/faq/faq4.html
2. https://www.c0ffee.net/blog/openbsd-on-a-laptop/

and from @J65nko, using the same flash USB installer containing the OpenBSD file sets.

The installation was successful - apparently without any glitch - but then when finally rebooting (exactly like suggested at link 2. immediately before 'Network Setup' section), the system is ONLY showing back the BIOS interface options, and does not show any OpenBSD login GUI, nor CLI.

I tried to reinstall the whole thing for #3 times, without any different outcome.

What now?

(thank you in advance)
Reply With Quote
  #9   (View Single Post)  
Old 16th August 2022
frcc frcc is offline
Don't Worry Be Happy!
 
Join Date: Jul 2011
Location: hot,dry,dusty,rainy,windy,straight winds, tornado,puts the fear of God in you-Texas
Posts: 273
Default

Just a suggestion, try installing the system with the CD/DVD install71.iso
During installation you will be asked if you want X (gui) login, or if not, at the prompt
you can manually, as non-root startx

If successful post your dmesg file here for further scrunity by those who can look at your system particulars.
https://www.openbsd.org/faq/faq4.html#SendDmesg

Last edited by frcc; 16th August 2022 at 10:40 AM.
Reply With Quote
Old 16th August 2022
Nixota Nixota is offline
New User
 
Join Date: Aug 2022
Posts: 6
Default

@frcc, please two things:

1. no alternative medium seems to be available:
Quote:
Originally Posted by frcc View Post
Just a suggestion, try installing the system with the CD/DVD install71.iso
On my laptop there's no CD/DVD slot, nor I have an external CD/DVD reader. I can use an ethernet connection... is that possible to download/launch the whole installation from the internet? Any other option?

2. why re-installing from the burned USB install71.img is failing? (the first time it went ok.)

BR
Reply With Quote
Old 16th August 2022
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,977
Default

Nixota,

The howto at https://www.c0ffee.net/blog/openbsd-on-a-laptop/ is very complicated and it is easy to make a mistake, for example in editing /etc/fstab. If you make a mistake in that file, your system will not work correctly. Some things like using M:tier for updated packages are also outdated and not applicable anymore.

Just reinstall from your USB stick , say "Yes" to the question if you want to install the X Window system and everything probably will be fine.
Boot into the new system, login, gain root powers by doing su - root and do a # pkg_add firefoxto install Firefox.
Then as normal user in an xterm window start Firefox: [$ firefox & and you should be able to browse the net

If you want to install more software and want to know what is available: https://openports.pl/
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 16th August 2022 at 11:34 PM.
Reply With Quote
Old 17th August 2022
Nixota Nixota is offline
New User
 
Join Date: Aug 2022
Posts: 6
Default

@J65nko

Quote:
Originally Posted by J65nko View Post
The howto at https://www.c0ffee.net/blog/openbsd-on-a-laptop/ is very complicated and it is easy to make a mistake, for example in editing /etc/fstab. If you make a mistake in that file, your system will not work correctly. Some things like using M:tier for updated packages are also outdated and not applicable anymore.
During the first successful installation I followed that link only for the .xsession config file for the cwm windows manager, exclusively.


Quote:
Originally Posted by J65nko View Post
Just reinstall from your USB stick , say "Yes" to the question if you want to install the X Window system and everything probably will be fine.
I tried to reinstall the whole thing two times again - from the USB install71.img, using a working ethernet connection with DHCP autoconf - and everything is successful: with the exception that at the end of the procedure (I did as explained in the original OpenBSD.org link: https://www.openbsd.org/faq/faq4.html ) when I reboot it always brings me back to the Boot Menu interface.

Question: could it be that by making a 'hard reset' (i.e., taking off the internal battery) of the laptop would reset the system to original specs? and try again? else?

BR

Last edited by Nixota; 30th August 2022 at 03:50 PM.
Reply With Quote
Old 17th August 2022
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,977
Default

Can you boot into your OpenBSD system? IF yes, please post the output of fdisk(1) to check whether the OpenBSD partition is bootable:
Code:
# Disk: sd0       geometry: 243201/255/63 [3907029168 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
*3: A6      0   1   2 - 243201  80  63 [          64:  3907029104 ] OpenBSD
You set the partition bootable with the interactive fdisk command:
Code:
     flag # [value]
             Make the given MBR partition table entry bootable and mark all
             others as not bootable (only one entry can be marked bootable).
             The bootable partition is denoted with `*'.  If a value of 0 is
             given, the MBR partition is marked as not bootable, but no other
             MBR partitions are touched.
Posting the output of disklabel also could be helpful,

I have not used Windows since Windows 95, so I don't know if it is a Windows boot manager issue or a BIOS problem
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 19th August 2022
Nixota Nixota is offline
New User
 
Join Date: Aug 2022
Posts: 6
Default

@J65nko

thank you forever! You pointed me in the right direction with your last post: I simply re-initialized the BIOS Setup to its original default specs and it worked (I probably must have changed something in the BIOS during my first attempts to make a reboot...). Now I can reboot to OpenBSD freshly installed, X-windows manager included

Ok, I think we can consider this whole thread solved. Now it's my duty to learn OpenBSD in depth. Once again: awesome support! Thanks!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing OpenBSD to eMMC shep OpenBSD Installation and Upgrading 12 25th December 2019 01:58 AM
Installing KDE on OpenBSD 5.2 EverydayDiesel OpenBSD General 3 17th January 2013 11:25 PM
Installing Cacti on OpenBSD 4.9 ai-danno Guides 6 23rd September 2011 06:59 PM
OpenBSD installing OpenBSD from USB ocicat News 5 5th April 2010 10:51 PM
installing openbsd bsdnewbie999 OpenBSD Installation and Upgrading 12 4th May 2009 11:55 AM


All times are GMT. The time now is 01:39 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick