DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD Installation and Upgrading

NetBSD Installation and Upgrading Have trouble getting NetBSD on your toaster?

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 6th October 2022
psarethi psarethi is offline
Port Guard
 
Join Date: Oct 2022
Posts: 10
Default NetBSD: installing to a specific existing partition

I've been testing some of the BSDs in qemu and then on real hardware. I have certain specific requirements including these next two.

One: the BSD must be installed to an existing partition, without disturbing any of the other partitions.

Two: the BSD must not touch the existing boot loader.

So far, OpenBSD can be made to do this. Yay!

NetBSD is another matter. After consulting documentation, and after many tries, I am beginning to suspect that NetBSD can only be installed by letting it trash everything else on the disk and then putting in its own boot-loader. I did, at one point, find an older page describing how to do it, but it did not correspond to the current installer.

Can NetBSD correctly be installed to a specified partition without touching the rest of the SSD/HD? If so, how?

p.s. Yes I set the partition to a9 ahead of time.
Reply With Quote
  #2   (View Single Post)  
Old 6th October 2022
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default

Your issue will be the bootloader. In this thread, an A9 partition is created and formated with the FFSv2 file system:
A special grub2 entry had to be created to boot the NetBSD / partition.
https://daemonforums.org/showthread.php?t=11898
To my knowledge, NetBSD's default amd64 bootloader will not allow you to boot non-NetBSD partitions.
Reply With Quote
  #3   (View Single Post)  
Old 8th October 2022
psarethi psarethi is offline
Port Guard
 
Join Date: Oct 2022
Posts: 10
Default

Thank you for the reply.

Quote:
Originally Posted by shep View Post
A special grub2 entry had to be created to boot the NetBSD / partition.
I don't use grub.
Quote:
NetBSD's default amd64 bootloader will not allow you to boot non-NetBSD partitions.
The intent is not to use NetBSD's bootloader, since my computer already has a working bootloader.

Clarification, NetBSD's installer doesn't seem to understand that other operating systems are on this computer and that it is only to put its files on the one specified partition and that it should not put any bootloader at all on.

Last edited by psarethi; 8th October 2022 at 12:25 AM. Reason: clarification
Reply With Quote
  #4   (View Single Post)  
Old 8th October 2022
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default

Bootloaders occupy reserved space on your sdd/hd/usb drive. You can only have one bootloader per device and I cannot think of any reason to install NetBSD without being able to boot it.

This is a complex topic and would be easier if you provided the OS's already installed, the bootloader you are using and what your overall goal is. The following link describes the usual process, the many options and the many opensource bootloaders.
https://wiki.archlinux.org/title/Arch_boot_process. It is possible to go into the bios and boot the bootloader on a usb drive and then give the path to the / partition on another device. Rescue disks work this way.

The NetBSD installer has an option not to install a bootloader which was done in the prior link where grub2 had already been installed.

Last edited by shep; 14th October 2022 at 11:50 PM.
Reply With Quote
  #5   (View Single Post)  
Old 8th October 2022
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

I can't comment about the new installer and any changes that may have been made to its process because I haven't used NetBSD in many years.

But, what I used to do during a manual upgrade included these steps related to boot loading (modify command arguments as appropriate for your situation):

* Copy the new SECONDARY boot loader into the / directory:

% cp /usr/mdec/boot /boot

* Install the new PRIMARY boot loader into the "disklabel area", e.g.,

% installboot -v -o timeout=10 /dev/rwd0a /usr/mdec/bootxx_ffsv2

And when the upgrade was complete, I would reboot with LILO (not a grub user either ), which was installed in the MBR. (I don't think it would necessarily have to be there, but obviously it shouldn't be in the NetBSD partition.)

Not sure if this helps, but perhaps you'd want to try to get the new installer to do those steps and no more so that it doesn't wipe out LILO or equivalent. Is this possible with the new installer? I don't know.
Reply With Quote
  #6   (View Single Post)  
Old 14th October 2022
psarethi psarethi is offline
Port Guard
 
Join Date: Oct 2022
Posts: 10
Default

Quote:
Originally Posted by shep View Post
would be easier if you provided the OS's already installed, the bootloader you are using and what your overall goal is.
Right. So the drive on this machine has been partitioned into three pieces. The first partition is 32 gig and is used for occasionally trying an OS out after first testing in emulation. The partition is usually not used. The second partition is a small one, I think 256 meg, enough to contain some kernels, init ram disk files and lilo. The entire rest of the drive is one LUKS encrypted partition. Inside of that is an LVM2 physical volume which, in turn, contains several thin provisioned volumes. There is one Linux distro whose sole function is to run lilo and thus it is the boot manager OS for this computer. There are three other Linux installs: one is the daily driver, the other two are older former daily drivers. Upon rebooting, lilo presents a menu that lists all operating systems and I can then chose any one of them. The only negative aspect to all of this is when a kernel or init ram disk update happens in my daily driver, I have to reboot into the boot manager, copy the kernel & init ram fs in, then rerun lilo.

It is intended that BSD go on the 32 gig first partition, and that it doesn't mess with anything else on the drive and that lilo can hand off to it.

That's a mess of detail. I hope it helps to clarify matters.

p.s. this is how I successfully booted a previous OpenBSD install in lilo.conf:
Code:
# open bsd part begins
other = /dev/sda1
  label = OpenBSD
  table = /dev/sda
  loader = chain
# open bsd part ends
so I'd guess that would also work for NetBSD, once it actually gets installed? But getting it installed is the current problem.
Reply With Quote
  #7   (View Single Post)  
Old 15th October 2022
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default

I'm assuming that /dev/sda1 is 32GB partition that was previously formated with OpenBSD file system.

You should be able to relabel that partition as NetBSD and then format. The installer will ask which NetBSD partion is root file system. If you web search, you will be able to find the syntax for the LILO entry.
https://www.netbsd.org/docs/guide/en...nst-partitions

You will not have a swap space but the NetBSD documentation has a work around.

NetBSD does provide 2 amd64 install images: one of gpt/uefi and the second for MBR. In this instance you want the MBR image.
Reply With Quote
  #8   (View Single Post)  
Old 17th October 2022
psarethi psarethi is offline
Port Guard
 
Join Date: Oct 2022
Posts: 10
Default

Now I remember something that I've been running into that I forgot to mention in my original post. The guide does not correspond to the current version of the installer. The menus are different. It's actually impossible to follow the guide to install NetBSD to a specified partition. Just now I tried it again in qemu, to verify. Nope.

Looks like the only way to jam NetBSD into an exiting partition is to make a hard disk in qemu that is the intended size plus one meg, then let the installer wipe all and fill the emulated disk, then, after the install, dd it out to the real partition. That's a bit too Rube Goldberg for me.
Reply With Quote
  #9   (View Single Post)  
Old 30th October 2022
Sehnsucht94's Avatar
Sehnsucht94 Sehnsucht94 is offline
Real Name: Paolo Vincenzo Olivo
Package Pilot
 
Join Date: Oct 2017
Location: Rome
Posts: 169
Default

Quote:
Originally Posted by psarethi View Post
Looks like the only way to jam NetBSD into an exiting partition is to make a hard disk in qemu that is the intended size plus one meg, then let the installer wipe all and fill the emulated disk, then, after the install, dd it out to the real partition. That's a bit too Rube Goldberg for me.

Just for the sake of transparency and correct information: this isn't true. By default, sysinst:


- will allow one to select existing partitions (and either re-format them or not) alongside their mountpoint. I've done this multiple times.

- will allow to avoid writing the bootcode to the MBR or th GPT's PMBR. It doesn't configure a GPT disk as a dedicated BSD label and can be therefore multi-booted with a second OS installed on the same disk.

- by dropping to the command line the user can manually manipulate the disk layout, including creating ecrypted disks, LVM volumes, ZFS pools, which can be later selected as a destination for the sets to be installed via sysinst.
__________________
“Mi casa tendrá dos piernas y mis sueños no tendrán fronteras„
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
How to mount a Linux / Ubuntu ext4 partition on NetBSD marietto2021 NetBSD General 1 17th September 2021 09:10 AM
Installing NetBSD to HD/SSD on the Banana Pi danboid NetBSD Installation and Upgrading 10 14th February 2016 11:09 PM
Clean install of OpenBSD but keeping existing partition table daemonbak OpenBSD Installation and Upgrading 8 27th May 2015 10:39 PM
Mounting a NetBSD partition from OpenBSD daemonfowl OpenBSD General 4 19th July 2012 12:03 PM
Preserving existing OpenBSD partition layout during a re-install J65nko Guides 3 17th February 2010 03:55 AM


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


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