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 20th January 2010
mgreen mgreen is offline
New User
 
Join Date: Jan 2010
Posts: 6
Unhappy afterboot questions following new installation

Hello
I am well experienced in FreeBSD and Unix but recently did my first NetBSD install. It went like a dream - except for one obscure problem. I found the idea of the "afterboot" manpage very usefull. Everything was explained just fine and worked first time when I followed the instructions - except setting my DomainName server. The instructions state "put an entry in /etc/resolv.conf", ( eg nameserver 192.168.1.99 ). I did this but it didn't work. I racked my brains and wasted several hours reading and trying everything I could find on the web. This took 3 times longer than the install itself. Finally I discovered the problem. Whatever looks at "resolv.conf" will NOT tolerate white space at the start of the line. It doesn't take SPACES or TABS at the start of the line. The "afterboot" instructions however show the example entries as being seemingly in the middle of the line. This error ( of mine) was first noted when I read /var/log/messages after my first boot. It causes the time sync daemon to go wrong - obviously in retrospect it couldn't get a name lookup to contact the clock server but at the time that wasn't clear. Only when I attempted to ping a host outside my network did it become obvious that there was no name lookup working.

The "afterboot" manpage needs (when someone has time) to be augmented with a warning of this gotcha. This seems like a trivial thing and I rather enjoyed the hunt for this problem, but it did stand out as a blot on an otherwise excellent installation procedure.

One other thing surprised me. The install offered to partion the disk automatically, but to my surprise didn't allocate a swap partition, which leads to warnings on boot about "No swap space allocated". I wasn't too annoyed because I had just previously been ranting about PCBSD install, which doesn't let you put your swap on a second disk. The "afterboot" man page should warn you that if you have got this situation you should either partition a swap on your second disk, or create a swap file (or 2) and put an entry in /etc/fstab . It should explain about "swapctl" .

I have three questions about swap.
How much slower is a swap file than a swap partition ?
Does NetBSD stripe swap across multiple swap areas ?
Other Unix often says "always try to have two or more swap areas", whereas NetBSD seems to be suggesting you use the "priority" field which would cause normally the use of only one area even though you may have multiple swap areas.
What is the best advice on this?
Reply With Quote
  #2   (View Single Post)  
Old 20th January 2010
s0xxx's Avatar
s0xxx s0xxx is offline
Package Pilot
 
Join Date: May 2008
Posts: 192
Default

Quote:
Originally Posted by mgreen View Post
Hello
I am well experienced in FreeBSD and Unix but recently did my first NetBSD install. It went like a dream - except for one obscure problem. I found the idea of the "afterboot" manpage very usefull. Everything was explained just fine and worked first time when I followed the instructions - except setting my DomainName server. The instructions state "put an entry in /etc/resolv.conf", ( eg nameserver 192.168.1.99 ). I did this but it didn't work. I racked my brains and wasted several hours reading and trying everything I could find on the web. This took 3 times longer than the install itself. Finally I discovered the problem. Whatever looks at "resolv.conf" will NOT tolerate white space at the start of the line. It doesn't take SPACES or TABS at the start of the line. The "afterboot" instructions however show the example entries as being seemingly in the middle of the line.
If you check the man page again you would see the format of the page: a block of text describing the entry, and then bellow the commands, or entries that are to be put in. Those commands and entries are a bit moved to the right side, for clearer reading I guess. It applies to whole man page, it's not just the resolv.conf section.

Quote:
Originally Posted by mgreen
One other thing surprised me. The install offered to partion the disk automatically, but to my surprise didn't allocate a swap partition, which leads to warnings on boot about "No swap space allocated". I wasn't too annoyed because I had just previously been ranting about PCBSD install, which doesn't let you put your swap on a second disk. The "afterboot" man page should warn you that if you have got this situation you should either partition a swap on your second disk, or create a swap file (or 2) and put an entry in /etc/fstab . It should explain about "swapctl" .
You have more info here: http://www.netbsd.org/docs/misc/#adding-swap
Quote:
Originally Posted by mgreen
I have three questions about swap.
How much slower is a swap file than a swap partition ?
Again from the above link:
Quote:
The quickest and simplest option is to create a file in an existing filesystem, and use it as additional swap space. While accessing this will be slightly slower than dedicated swap partitions (due to fragmentation and filesystem overhead), it is ideal for solving a temporary swap shortage.
Quote:
Originally Posted by mgreen
Does NetBSD stripe swap across multiple swap areas ?
Yes, see bellow.
Quote:
Originally Posted by mgreen
Other Unix often says "always try to have two or more swap areas", whereas NetBSD seems to be suggesting you use the "priority" field which would cause normally the use of only one area even though you may have multiple swap areas.
What is the best advice on this?
Not sure if I understand it correctly, but you could have several swap partitions with different priorities. A quote from a swapctl(8) man page:
Code:
SWAP PRIORITY

     The NetBSD swap system allows different swap devices and files to be
     assigned different priorities, to allow the faster resources to be used
     first.  Swap devices at the same priority are used in a round-robin fash-
     ion until there is no more space available at this priority, when the
     next priority level will be used.  The default priority is 0, the high-
     est.  This value can be any valid integer, with higher values receiving
     less priority.
All best
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD
Reply With Quote
  #3   (View Single Post)  
Old 20th January 2010
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

The content of these new questions are not the same as the original thread. To preserve the direction of that thread (even if it was dead...), today's discussion has been separated into a new thread.
Reply With Quote
  #4   (View Single Post)  
Old 21st January 2010
mgreen mgreen is offline
New User
 
Join Date: Jan 2010
Posts: 6
Default Re: Advice on swap etc

Thank you for v helpfull reply. I well accept that i should have done more rtfm. I think the thing that threw me on DNS was the fact that the resolv.conf file was initially entirely empty, whereas other config files have examples.
Anyway thanks for the advice.
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
Two PF questions sparker OpenBSD Security 5 9th November 2009 08:01 AM
Some Questions ?? ultranothing OpenBSD Security 6 4th September 2009 04:59 PM
A few questions on OpenBSD? php111 OpenBSD General 24 1st November 2008 09:18 AM
rc.conf questions starbuck FreeBSD General 2 29th July 2008 06:16 PM
Some questions about installation of OpenBSD aleunix OpenBSD Installation and Upgrading 20 15th June 2008 11:57 AM


All times are GMT. The time now is 08:46 PM.


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