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 13th November 2023
rons's Avatar
rons rons is offline
Snoozing
 
Join Date: Oct 2015
Posts: 69
Default NPF UEFI boot on USB

Hi,

Have mostly run vanilla NetBSD in the past, on hard drives, bios, etc. Not really very experienced with NetBSD in general, however.

Have a usb UEFI boot stick that wants to dump me to the command line with rootfs in read-only mode, no matter how I select the boot option (1,2, or 3). I can then remount the root filesystem in read-write mode with the command "mount -uw /", exit from the shell, and soon the normal login appears, and all is fine ... except for the npf and anything else in rc.conf that wants to write. The OS runs OK otherwise even with the late r/w status change.

Message log shows /dev/sd1 and /dev/dk1 devices. I end up with /dev/dk1 as the root file system. (Why not dk1a - maybe partition issue?) Note I have /dev/dk1 in fstab as read-write. Any suggestions?
Reply With Quote
  #2   (View Single Post)  
Old 14th November 2023
rons's Avatar
rons rons is offline
Snoozing
 
Join Date: Oct 2015
Posts: 69
Default

NPF seems very intuitive and am looking forward to using it once I can get the early read-only mode problem ironed out. I should note that this is IIRC a memory stick image downloaded from NetBSD.org, so it shouldn't have a partition issue or I wouldn't think so anyway ...
Reply With Quote
  #3   (View Single Post)  
Old 14th November 2023
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 362
Default

Perhaps explain your usage of NPF....

Quote:
Acronym Definition
NPF National Park Foundation
NPF National Pro Fastpitch
NPF National Psoriasis Foundation
NPF Norton Personal Firewall
NPF National Parkinson Foundation
NPF National Policy Framework (various locations)
NPF National Performance Framework (UK)
NPF National Pain Foundation (Englewood, Colorado)
NPF National Planning Framework (Scotland, UK)
NPF Nigerian Police Force
NPF National Progressive Front (Syria)
NPF No Problem Found
NPF Network Processing Forum
NPF Network Packet Filter (Internet protocol packets)
NPF Non-Public Funds (Canadian Armed Forces)
NPF National Pancreas Foundation
NPF National Peanut Festival
NPF Nurse Prescribers’ Formulary
NPF National Property Fund (Slovak Republic)
NPF Nominal Protection Factor
NPF Naval Powder Factory (US Navy)
NPF No Pants Friday
NPF Nippon Pet Food (Japan)
NPF Naval Procurement Fund (US Navy)
NPF Nuclear Power Facility
NPF Nomura Principal Finance Co. (Japan)
NPF NAVSTAR Processing Facility
NPF Nordic Powerlifting Federation
NPF Norsk Plantevern Forening (Norway)
NPF Network Partitioning Facility
NPF Ne Pas Fumer
NPF Non-Product Facility
__________________
Linux since 1999, & also a BSD user.
Reply With Quote
  #4   (View Single Post)  
Old 14th November 2023
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
The Deliverator
 
Join Date: Dec 2015
Location: London
Posts: 481
Default

Quote:
Originally Posted by bsd-keith View Post
Perhaps explain your usage of NPF
I think rons is referring to npf(7).

Quote:
Originally Posted by rons View Post
Message log shows /dev/sd1 and /dev/dk1 devices. I end up with /dev/dk1 as the root file system. (Why not dk1a - maybe partition issue?) Note I have /dev/dk1 in fstab as read-write. Any suggestions?
Perhaps post the log (or link to it if it is large) and also the content of /etc/fstab and the output of mount(8).

Not sure if I'll be able to help directly though because I don't use NetBSD (sorry).
Reply With Quote
  #5   (View Single Post)  
Old 16th November 2023
rons's Avatar
rons rons is offline
Snoozing
 
Join Date: Oct 2015
Posts: 69
Default

Quote:
Perhaps post the log (or link to it if it is large) and also the content of /etc/fstab and the output of mount(8).
Thanks for the reply. Here's some pertinent snips from syslog:
Code:
sd1: fabricating a geometry
sd1: 15193 MB, 15193 cyl, 64 heads ...
sd1: fabricating a geometry
sd1:GPT GUID 29A73 ...
dk0 at sd1: "EFI system" ...
dk1 at sd1: "NetBSD"
boot device: sd1
root on: dk1
root filesystem type: ffs
/dev/dk1: file system not clean; please run fsck ...
sd1: fabricating a geometry ...
sd1: 15193 MB, 15193 cyl, 64 heads ...
sd1: GPT GUID: 299A73 ...
dk0 at sd1: "EFI system"
dk1 at sd1: "NetBSD"
boot device: sd1
root on dk1
root filesystem type: ffs
/dev/dk1: file system not clean; please run fsck
For some reason, the sequence leading to fsck is repeated twice. I notice that when I exit the shell there is a quick message about root filesystem being mounted twice.

I have tried fsck (which works) - but the next boot it does the same thing anyway. I put fsck into /etc/rc.d/root but that is too late in the boot process, and doesn't allow npf to write, and thus it does not load. So, what do you think?

Last edited by ocicat; 16th November 2023 at 02:25 PM. Reason: Added [code] and [/code] tags for clarity.
Reply With Quote
  #6   (View Single Post)  
Old 16th November 2023
rons's Avatar
rons rons is offline
Snoozing
 
Join Date: Oct 2015
Posts: 69
Default

Here is fstab:
Code:
# NetBSD /etc/fstab
# See /usr/share/examples/fstab/ for more examples.
/dev/dk1        /       ffs     rw              1 1
kernfs          /kern   kernfs  rw
ptyfs           /dev/pts        ptyfs   rw
procfs          /proc   procfs  rw
tmpfs           /var/shm        tmpfs   rw,-m1777,-sram%25

Last edited by ocicat; 16th November 2023 at 02:27 PM. Reason: Added [code] and [/code] tags for clarity.
Reply With Quote
  #7   (View Single Post)  
Old 16th November 2023
Onauk's Avatar
Onauk Onauk is offline
Real Name: Thomas
Fdisk Soldier
 
Join Date: Jan 2023
Location: France
Posts: 72
Default

Maybe the output of disklabel sd1 could help to see the partitioning and explain the weirdness of dk1 etc.
Reply With Quote
  #8   (View Single Post)  
Old 18th November 2023
rons's Avatar
rons rons is offline
Snoozing
 
Join Date: Oct 2015
Posts: 69
Default

Hi Onauk,

Well , disklabel does give a confusing result. First, output of listwedges:

Code:
dkctl sd1 listwedges

/dev/rsd1: 2 wedges found:
   dk0: EFI system, 262144 blocks at 4096, type:msdos
   dk1: NetBSD, 25165824 blocks at 266240, type ffs

dkctl dk1 getwedgeinfo

   dk1: at sd1: NetBSD
   dk1: 25165824 blocks at 266240, type ffs
Reply With Quote
  #9   (View Single Post)  
Old 18th November 2023
rons's Avatar
rons rons is offline
Snoozing
 
Join Date: Oct 2015
Posts: 69
Default

So, listwedges seems OK. But, weirdness in disklabel:

Code:
disklabel sd1

/dev/rsd1:
type:SCSI
disk: USB3.0 CRW -SD
label: fictitious
flags: removable
bytes/sector:  512
sectors/track: 32
tracks/cyl: 64
total sectors: 31116288

4 partitions:
   size  offset fstype  fsize   bsize   
a: 31116288  0  4.2BSD  0  0
b: 31116288  0  unused  0  0
disklabel: boot block size 0
disklabel: super block size 0
The info in the partitions list is not logical and seems to be something that wouldn't even be allowed by the partitioner ...

Last edited by rons; 18th November 2023 at 06:12 PM.
Reply With Quote
Old 19th November 2023
rons's Avatar
rons rons is offline
Snoozing
 
Join Date: Oct 2015
Posts: 69
Default

Perhaps the gpt output will give a better picture of the disk than disklabel by itself:

gpt show sd0

Code:
start   length   index  description
0           1           PMBR
1           1           Pri GPT header
2           32          Pri GPT table
34          4062        Unused
4096      262144    1   GPT part - EFI System
266240   25165824   2   GPT part - NetBSD FFSv1/FFSv2
23432064  5684191       Unused
31116235   32            Sec GPT table
31116287   1              Sec GPT header
So, this does not look unusual, does it?

Last edited by rons; 19th November 2023 at 01:58 PM.
Reply With Quote
Old 19th November 2023
rons's Avatar
rons rons is offline
Snoozing
 
Join Date: Oct 2015
Posts: 69
Default

I do not look at GPT very often. What is the purpose of the second table/header? Now that I've been thinking about this stick, I remember that I downloaded the installation memory stick image from NetBSD, and then myself did the installation to this stick (that I'm using now :-) ).

So, any booboo is probably mine. Any ideas?

BTW, here is uname -a :

NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64

Edit: Perhaps it was the bleeding edge image for NetBSD 9.0, and I should just upgrade to a newer stick image. But then - ugh - I have to reinstall all the apps I've put onto the stick, like this newish version of Firefox that I'm using, etc. Would rather get this one perfected, in the interest of being lazy.

Last edited by rons; 19th November 2023 at 02:28 PM.
Reply With Quote
Old 19th November 2023
rons's Avatar
rons rons is offline
Snoozing
 
Join Date: Oct 2015
Posts: 69
Default

From https://daemonforums.org/showpost.ph...51&postcount=3 we have:

Quote:
Note that, unlike OpenBSD, NetBSD does not write a BSD label to the secondary GPT header, meaning there won't be any a-z slices for wd*, sd* and ld* disks (i.e., no ld0a, ld0b...), but just dk* logical disk wedges (dk1, dk2, dkn...), since the filesystem won't be structured as a single BSD label (partition) containing various slices, but as a set of standard independent partitions (similarly to Linux or Windows). I think this is meant to allow for better compatibility with other OSs. See dk(4).
This answers two questions, being "What is the purpose of the secondary header/table?", and "Why are there not any alphanumeric slices, like dk1a?"

I'm wondering if the presence of the secondary info is confusing the boot process? Just throwing things out there. Pays to read the other guys posts who came before LOL. Sorry I am monopolizing this thread, but I am getting my thoughts organized by blathering LOL.

Sure hope I can get the firewall (npf) working on this stick, as everything else in this setup is pretty nifty. I can get a *very* recent version of firefox going, wherein on some of the other OS's to do that you compile it yourself.

Last edited by rons; 19th November 2023 at 04:24 PM.
Reply With Quote
Reply

Tags
npf, readonly issue, uefi, usb boot

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
UEFI & eMMC (?) bsd-keith NetBSD Installation and Upgrading 2 7th February 2023 06:04 PM
Dual boot OpenBSD UEFI with Linux HopingStar OpenBSD Installation and Upgrading 5 21st October 2022 07:17 AM
Can not Boot FreeBSD NetBSD in Bare Metal, UEFI czachstd NetBSD Installation and Upgrading 5 28th July 2020 03:24 AM
FreeBSD 11.1 amd64 UEFI boot from ZFS mirror hanzer FreeBSD Installation and Upgrading 5 20th October 2017 10:53 PM
dragonfly BSD UEFI myway_1 Other BSD and UNIX/UNIX-like 4 31st March 2017 09:29 PM


All times are GMT. The time now is 03:26 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