DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 20th May 2008
knasbas knasbas is offline
Port Guard
 
Join Date: May 2008
Posts: 25
Default adding new disk -> wrong node?

I recently bought myself a sata pcicard and 3 new harddrives. After inserting them into my box and booting my server doesnt work anymore and i noticed that somehow these new disks shows as wd0 wd1 and wd2.

Sounds like I found the problem but i dont know what to do. Been trying to find something on google and been looking into the bios if i could change the order they detect somehow, but nothing.

What do i need to do?
Reply With Quote
  #2   (View Single Post)  
Old 21st May 2008
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Disks are assigned numbers in the order found by the hardware. In the case of i386 or amd64 architecture, this is determined by the BIOS.

Assuming your system is i386 or amd64:

Your BIOS is in charge of picking the disk that is used to boot an OS. If you've told your BIOS to do that properly, you will get a boot> prompt.

At that boot> prompt, you can issue the "machine diskinfo" command to see what hard drives are detected, and then issue a "boot" command to select the specific device with a BSD disklabel partition and kernel. If you boot in single-user mode (hint: using a "boot" command at the boot prompt with the "-s" option), you can then mount enough of your partitions to be able to run an editor and edit your /etc/fstab as necessary, and add an /etc/boot.conf if necessary.

To understand both the commands you may type at the boot> prompt, and what an /etc/boot.conf file is used for, start with the boot(8) man page.

Last edited by jggimi; 21st May 2008 at 12:14 AM.
Reply With Quote
  #3   (View Single Post)  
Old 21st May 2008
knasbas knasbas is offline
Port Guard
 
Join Date: May 2008
Posts: 25
Default

So what you are saying is 2 options:
1: make bios boot the right disk. Well i got 3 idedrives connected to the "main" ide connectors, then the motherboard has a raidcontroller(ide) which i have 2 other disks and now i just added the sata pcicard with 3 additional drives, so unless i missing something i cannot tell bios which of these 3 controllers to use "first". Any logic would add disks as wdx where x is last and not before others but hey i guess that would be to conveniant.

2: edit fstab? is it just to change it to the new assigned drive?

Im very thankful for help but telling me to read manpages without telling me what i need understand/fix.
Reply With Quote
  #4   (View Single Post)  
Old 21st May 2008
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Let's step back, then, and first look at the boot process. Simplified:
  1. Your BIOS selects a drive to boot.
  2. The BIOS loads and executes a boot record from the drive, either a master boot record (MBR) or a partition boot record (PBR). OpenBSD uses a PBR. This is the "first stage" boot loader.
  3. The PBR program loads the "second stage" boot loader. For OpenBSD, the second stage boot loader is the program that issues the boot> prompt, allowing you to select and load a kernel, define your root partition, make kernel configuration changes, and transfer control to a kernel that has been loaded. The man page I pointed you to above describes this program in detail, and that is why I recommended it.
  4. When the second stage boot loader turns over control to a kernel, the kernel performs hardware discovery. It is at this point that device numbers are assigned to disk drives. This assignment is ordered by the order of drives returned by the discovery proces. This will not change, boot after boot, but will be affected by hardware or BIOS changes you make. As the kernel inspects the hardware configuration, it outputs information to the console in blue (your "dmesg"), then turns control over to init(8).
  5. The init(8) program will drop the console into a shell if booted in single-user mode. If in multi-user mode, it will run your /etc/rc script.
  6. /etc/rc will issue a mount -a, which will read your mount point configuration from /etc/fstab and attempt to mount every partition listed there that is not configured with "noauto" as an option.
With that background in mind:
  • You are responsible for figuring out how to tell your computer which physical drive to load an MBR/PBR program from. You may be able to select the device from a BIOS configuration menu. You have stated that you cannot. However, this has nothing to do with the OS you are running. You would have this same problem no matter if you were running Windows, Linux, or something else entirely.
  • If you are able to boot a drive containing a properly configured OpenBSD PBR pointing to a proper second stage boot loader, you should get a boot> prompt. It will not matter what drive type or drive number it is.
  • At that boot> prompt, you can type "machine diskinfo" to get a list of all the drives it knows about. It won't matter if they are SATA, PATA, SCSI... each can be addressed by a unique drive number: hd0, hd1, hd2, hd3, etc.
  • At that boot> prompt, you can issue a "boot" command which points to a particular kernel ... on the same drive or on any other drive listed by the "machine diskinfo" command. You can hunt for kernels and OpenBSD disklabel partitions with the "ls" command, if necessary.
  • By default, if you wait 5 seconds after seeing the boot> prompt, the boot loader will attempt to find a kernel: it will first try to find "/bsd" in the "a" partition of the drive that was booted ... regardless of number. If if fails, it will look for "/obsd" in the same paritition, then it will give up. If it finds a kernel, it will load it and boot it in multi-user mode.
  • I recommended booting in single-user mode because your disk numbers have changed. Your /etc/fstab entries will need to be changed, as your boot disk is no longer wd0, so all entries in /etc/fstab pointing to wd0 will need to be changed.
Assuming you can get to a boot> prompt, all you should need to do is type "-s" and press the Enter key. The second stage boot loader will look for /bsd in the "a" partition of your boot drive, load the kernel, and pass control to it. It will discover your hardware, pass control to init(8), which will ask you if the bourne shell ("sh") is ok, and you can press the Enter key again. It will ask you your terminal type, and you can type "vt220" and press the Enter key. You will have a super user shell prompt: "#"

At this point, you will need to figure out what device you have booted, and manually mount partitions, and then edit your /etc/fstab to point to that device. You will need to mount your root partition "/", and depending on how you have partitioned OpenBSD, you will need to mount "/usr" and perhaps "/var" in order to use a text editor such as vi(1) or mg(1).
Reply With Quote
  #5   (View Single Post)  
Old 22nd May 2008
knasbas knasbas is offline
Port Guard
 
Join Date: May 2008
Posts: 25
Default

Well its fun to realize after a couple of hours that i dont have /wd5* or higher under /dev/ so i assume solving how to add them will take a giant leap forward
Reply With Quote
  #6   (View Single Post)  
Old 23rd May 2008
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

# cd /dev
# sh MAKEDEV wd5
Reply With Quote
  #7   (View Single Post)  
Old 23rd May 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by jggimi View Post
# cd /dev
# sh MAKEDEV wd5
If this works for the OP, great! However, if there are errors generated when running the MAKEDEV script, the solution is to explicitly specify the path:
Code:
# cd /dev
# sh ./MAKEDEV
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
Disk geometry for Seagate disk phreud FreeBSD Installation and Upgrading 5 8th November 2008 10:51 PM
Adding drives annoys OpenBSD. diw OpenBSD General 4 4th September 2008 02:14 AM
Adding a separate /home JMJ_coder NetBSD General 2 29th August 2008 10:45 AM
Dump dates wrong? cwhitmore FreeBSD General 2 17th August 2008 08:49 PM
Having trouble adding 7.0 to GRUB 0.97 Arenlor FreeBSD General 4 26th June 2008 01:02 AM


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