DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Installation and Upgrading

FreeBSD Installation and Upgrading Installing and upgrading FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 31st March 2009
eztiger eztiger is offline
New User
 
Join Date: Mar 2009
Posts: 4
Default FreeBSD 7 i386, PAE and kernel modules

Hi folks,

I've just got a new box with 4GB physical RAM.

I have an existing server running a bunch of jails that I want to migrate over to this new server - this existing server is running FreeBSD 6.2 i386.

As such the new server is also running i386 otherwise I'm going to run into problems running my 32 bit jail binaries on a 64 bit kernel.

Obviously I'm not seeing the full amount of RAM in the new server and won't do until I install a PAE kernel.

However the handbook advises (well actually flat out says not to!) against loading kernel modules into a PAE kernel and indeed the PAE template config file has

makeoptions NO_MODULES=yes

Which kindof gives that away. So far so good - unfortunately :

Id Refs Address Size Name
1 8 0xc0400000 97f830 kernel
2 1 0xc0d80000 164e8 geom_mirror.ko
3 1 0xc0d97000 6a2c4 acpi.ko
4 1 0xc6d0b000 22000 linux.ko

I need those modules. acpi is taken care of in the PAE config :

device acpi

How do I do the other two?

I need geom_mirror (for the root gmirror disk) before the kernel loads - its currently being loaded in /boot/loader.conf.

I also want the linux support.

How can I build them statically into the kernel such that they both work? Is it as simple as a device line in the kernel config? i.e

device linux
device geom_mirror

Also does geom_mirror depend on anything? I'm guessing not as nothing else seems to be loaded but :

# ls /boot/kernel/geom* | wc -l
64


There are an awful lot of geom modules in my existing kernel compile and some of them sound very generic - like they may be needed all the time (geom_label, geom_bsd for examples)

Any tips from someone whose done this before?
Reply With Quote
  #2   (View Single Post)  
Old 31st March 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Quote:
Also does geom_mirror depend on anything? I'm guessing not as nothing else seems to be loaded but :
No, if it would, then it would show up in kldstat.

Quote:
How can I build them statically into the kernel such that they both work? Is it as simple as a device line in the kernel config? i.e

device linux
device geom_mirror
It's:
options COMPAT_LINUX
options GEOM_MIRROR

See:
/usr/src/sys/conf/NOTES
/usr/src/sys/`uname -m`/conf/NOTES
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #3   (View Single Post)  
Old 31st March 2009
eztiger eztiger is offline
New User
 
Join Date: Mar 2009
Posts: 4
Default

Fantastic! Thanks very much.

Silly question but building the gmirror module into the kernel this way will still allow me to boot from the root filesystem - which is on the gmirror? (chicken and egg problem..)
Reply With Quote
  #4   (View Single Post)  
Old 31st March 2009
arch arch is offline
Port Guard
 
Join Date: Jun 2008
Posts: 38
Default

check this
__________________
Verbose mode can also be turned on for SSH2 with the (surprise!) VerboseMode keyword.
Reply With Quote
  #5   (View Single Post)  
Old 31st March 2009
eztiger eztiger is offline
New User
 
Join Date: Mar 2009
Posts: 4
Default

Quote:
Originally Posted by arch View Post
Thanks - but I've already done this.

The section of that article that looks relevant is :

Quote:
# echo geom_mirror_load="YES" > /boot/loader.conf
I think I read a while ago that this (entry in loader.conf) loads the gmirror module either before or very early on during the kernel boot cycle (this could be completely fabricated) to ensure the root filesystem on the gmirror is available when things need it.

At the moment this loads the kernel module.

However if I build gmirror into the kernel staticly I have no idea when it's initialised and so - will my system still boot? Or will the gmirror code not have been initialised by the time it's needed?

This could be a stupid or academic question but the box in question is on the end of an ssh connection so trial and error would be unwise
Reply With Quote
  #6   (View Single Post)  
Old 31st March 2009
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

/boot/loader is loaded off a single disk. This loads the kernel, off the same disk. The kernel enables gmirror support. The rest of the OS is loaded off the mirror.

When using modules, it works the same way. /boot/loader is loaded off a single disk. The gmirror module is loaded off the same disk. The kernel is loaded off the same disk. The kernel then enables gmirror support. And the rest of the OS is loaded off the mirror.

You only boot off a single disk. If that disk dies, you can't boot until you configure the other disk as the boot drive. That's the one downside to using software RAID. You aren't protected until the kernel has loaded, and the OS is booted. Until then, you are running off a single disk.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #7   (View Single Post)  
Old 31st March 2009
eztiger eztiger is offline
New User
 
Join Date: Mar 2009
Posts: 4
Default

Quote:
Originally Posted by phoenix View Post
/boot/loader is loaded off a single disk. This loads the kernel, off the same disk. The kernel enables gmirror support. The rest of the OS is loaded off the mirror.

When using modules, it works the same way. /boot/loader is loaded off a single disk. The gmirror module is loaded off the same disk. The kernel is loaded off the same disk. The kernel then enables gmirror support. And the rest of the OS is loaded off the mirror.

You only boot off a single disk. If that disk dies, you can't boot until you configure the other disk as the boot drive. That's the one downside to using software RAID. You aren't protected until the kernel has loaded, and the OS is booted. Until then, you are running off a single disk.
Thanks - that answers my kernel / module question

I didn't know that - I thought gmirror handled the boot sector as well - which I guess is a little naive when you actually think about it.

Do you have any resources on how to boot the other disk in the mirror should the above scenario happen?

Thanks for your help - very enlightening.
Reply With Quote
  #8   (View Single Post)  
Old 1st April 2009
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

Code:
# fdisk -B /dev/adX
Where adX is replaced with the correct device name for your harddrive. That will install the boot code into sector 0 of that harddrive. You want to do that for all the other drives in your mirror set (the primary drive already has it, obviously). That will enable the other drives to be used as boot drives.

Since the device names will be different, you will need to either:
* create a /boot.config file with the correct settings, or
* manually enter the correct settings at the boot: prompt when it fails

/boot.config is used/read before /boot/loader is run. It's part of the boot loader.

See the man page for all the details.

You want to create this on the mirror. Then if a drive dies, you can just edit it to point to the other drive, and it should survive a reboot. Worked on my home machine with a three-drive gmirror setup, before I moved over to using a USB flash drive to boot from.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
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
NetBSD New kernel modules in NetBSD-CURRENT (instead LKM) vermaden News 1 17th May 2015 11:06 PM
Directadmin on FreeBSD 7 Stable i386 issue Celestemmcknight FreeBSD Ports and Packages 1 7th June 2009 11:35 PM
kernel modules Mr-Biscuit FreeBSD General 0 2nd March 2009 06:18 AM
FreeBSD 8.0-CURRENT (amd64 & i386) VMware Virtual Appliances Available glarkin_at_FreeBSD FreeBSD Installation and Upgrading 1 3rd December 2008 08:49 AM
Are certain kernel modules permanent? davidgurvich FreeBSD General 3 6th June 2008 06:14 PM


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