Linux on RAID [Archive] - Glock Talk

PDA

View Full Version : Linux on RAID


biblefreak
01-22-2005, 13:29
Question for all you techies:

Until recently I dual booted Win2k and some version of Linux (whatever I was playing around with though usually Suse).

I recently upgraded my box to take advantage of the on board RAID the Gigabyte mobo I am using by slapping in a couple of 120gig Maxtor 7200rpm drives, and also upgraded Windows to XP Pro in the process. Now when I go to install Linux, I am told at the installation prompt that the 2.6.x kernel doesnt support RAID!! How on earth can a current Linux kernel not support RAID? I would really like to get a Linux OS back on my box, but I also want to keep my drives mirrored.

Any suggestions? Edited to add:

If the RAID isn't a feasible option, would it be possible to leave Windows on the RAID, install a third hard drive on one of the IDE channels, install Linux on the third hard drive and have GRUB boot Windows off the RAID or Linux off the IDE?

fastvfr
01-22-2005, 16:45
You bet. Check my sig. I'm doing exactly what you want to do!

biblefreak
01-22-2005, 20:38
Edited to change post:

I just re-read your sig, and you are doing exactly what my last thought was! How did you set it up? Can I leave Win XP installed, add a Linux OS on the third HDD and let GRUB auto detect the Windows install during the Linux install? Or do I need to customize the GRUB files?

fastvfr
01-22-2005, 21:40
I hate Grub. It doesn't play nice with my installs most of the time.:(

At any rate, try this:

Unplug the power for your RAID drives (prevents accidental reformatting of XP!) and install the IDE HDD by running the XP disk to partition the whole thing into a bunch of virtual drives.

Then shut down, plug the RAID drives back in, and use XP to format the partitions as FAT32 if you want; this step isn't necessary, though.

I usually use a Knoppix LiveCD to format some partitions and install Debian, or the Slackware installer if you have plenty of time to devote to the project!;) Unstable Sid or Sarge seem to be the best way to a smooth, functional Linux desktop in a hurry.

Plus, APTGet is a winner in my book!!

Then I install GAG Bootloader into the MBR and configure it to see all OSes, setting XP to Default/20 Seconds.

All there is to it. Good luck.

Furant
01-22-2005, 22:17
What a timely post! I actually just recently installed Slackware on my home computer to dual boot. Since then, I found out that my company was about to throw away an old(er) HP Netserver LH3 in my office. This thing has 6 18 GB drives in it on a RAID controller (I'm hoping it's 0+1). It's HUGE, but it has 2 550MHz PIIIs and 1 GB RAM, so I figured it would make a great Linux box. I've always worked on machines with RAID arrays, but I've never had to configure or manage them. From my limited understanding, I think HW RAID is the easiest to manage since the computer's doing all of the heavy lifting. I just need to figure out whether it's striped and mirrored with a parity bit or what.

Unfortunately, the NT Server password was gone. So, I used the Nordahl utility to reset the password just to sniff around a bit, and now I want to put Slackware on it. I actually posted with an issue I'm having on Linuxquestions.org, but I think I know what the problem is.

Anyway, just rambling, but I'll let you know how all goes.

Joey

biblefreak
01-23-2005, 14:25
I have always stuck to mainstream stuff, mostly Suse. Have messsed around with Xandros, Lycoris, Drake, Yoper, and a whole list of others, but keep coming back to Suse. It is not the fastest, but it is usually the cleanest. I am thinking maybe Libranet this go around, possibly straight Debian.

Furant
01-23-2005, 22:48
Slackware's my first attempt at Linux. I'm doing it mainly to learn, so I'm trying to avoid all of the GUI configs and do it slowly by learning what's going on behind the scenes.

So far, I love it. I have a limited background on SGI Irix, HP-UX and SunOS/Solaris and Linux is by far the easiest to get a hang of IMO. It's probably due to the great information resources that I find online that I'm actually starting to digest what I'm learning. I've worked as an implementation consultant for a software company, so I've had to at least know how to get around in various OSes.

I just installed MySQL and I'm working my way through some tutorials. I hope to setup a simple webserver and database with either Mambo or PHP-Nuke or something similar driving it. Next, I plan to dust off some of my programming skills and delve in to some Object-oriented stuff.

I usually feel pretty smart about computers 'til I hop on the web and read posts by real nerds ;). It makes me realize just how much I have to learn.

Washington,D.C.
01-24-2005, 04:15
A friend just got Fedora Core 3 to work on his Asus P4C800-E by downgrading the bios from 1017 to 1016.

biblefreak
01-30-2005, 22:52
How did you configure your grub, or lilo, or gag? I am trying to use grub on Suse 9.1, installed on the MBR of the IDE drive. Grub boots Suse fine, but no matter what configuration I try in grub.conf, I can't get it to boot to my Windows install on the on board RAID.

Any idea's?

Washington,D.C.
01-30-2005, 23:39
If your system has a hardware mix that includes both IDE and SCSI disks, GRUB tries determine the boot sequence according to a certain algorithm. However, GRUB is not able to access the BIOS setup to obtain this information. GRUB stores the result of this check in the file /boot/grub/device.map. For a system where the BIOS is set up to boot IDE devices before any SCSI devices, the file could look like this:

(fd0) /dev/fd0
(hd0) /dev/hda
(hd1) /dev/hdb
(hd2) /dev/sda
(hd3) /dev/sdb

If GRUB boots with a given device.map file and encounters any problems, check the order of the devices in the file and use the GRUB shell to change it if necessary. Once you have successfully booted your Linux system, you can change the device.map file with the boot loader module of YaST or with any editor.

Any manual change to the device.map file requires that you update your GRUB installation. This is done with the following command:


grub -batch < /etc/grub.conf


The File /etc/grub.conf

In addition to menu.lst and device.map, GRUB stores another important part of its configuration in the file grub.conf. This file defines the parameters and options needed by the grub command to correctly install the boot loader:

root (hd0,4)
install /grub/stage1 d (hd0) /grub/stage2 0x8000 (hd0,4)/grub/menu.lst
quit

The individual entries have the following meaning:

root (hd0,4)
This tells GRUB that all the following commands should be applied to the first logical partition on the first hard drive, where the boot files are located.
install <parameter>
This tells grub to run its internal install command, specifying that it should install the first stage of the boot loader in the MBR of the first hard disk (/grub/stage1 d (hd0)) and that the memory address at which to load stage2 is 0x8000 (/grub/stage2 0x8000). The last parameter ((hd0,4)/grub/menu.lst) tells GRUB where to look for the menu file.

The GRUB Shell

GRUB actually consists of two parts: the boot loader and a normal Linux program (/usr/sbin/grub). This program is also called the GRUB shell. The functionality to install the boot loader on a hard disk or floppy is integrated into the GRUB shell through the internal commands install and setup. In other words, these commands can be executed using the GRUB shell on a running Linux system. However, these commands are also available while the system is booting with GRUB-- before Linux is even running. This makes the repair of a defective system much easier.

The device mapping algorithm as mentioned above only matters when GRUB runs its shell. It then reads the file device.map to map GRUB device names to Linux devices as indicated by each line. Given that the order in which the BIOS addresses IDE, SCSI, and other hard drives depends on several factors and given that Linux cannot reliably determine this order, GRUB uses the device.map file where the correct order can specified by hand. If you have difficulties booting your machine, check that the order in this file is in line with your BIOS settings. The file is found in the directory /boot/grub.

Washington,D.C.
01-30-2005, 23:43
http://www.gnu.org/software/grub/ f you have texinfo installed on your system, you can view the GRUB info pages from a shell prompt by entering info grub. You can also look up "GRUB" as a keyword in the support database at http://sdb.suse.de/en/sdb/html/index.html to obtain information about special issues.

Washington,D.C.
01-31-2005, 01:01
If you update from a previous version of SuSE Linux where LILO was the boot manager, the new system will continue to use LILO. If you install SuSE Linux from scratch, the system will use GRUB, except where the root partition is installed on a RAID system of the following types:

* CPU controlled RAID controllers (such as many Promise and Highpoint controllers)
* software RAID
* LVM

Washington,D.C.
01-31-2005, 01:04
GRUB does not distinguish between IDE, SCSI, or RAID devices. All hard disks as detected by the BIOS or other disk controllers are counted according to the boot sequence as set in the BIOS itself.

The fact that BIOS device names do not correspond to Linux devices is a problem that exists for both LILO and GRUB. Both use similar algorithms to establish a mapping. GRUB, however, stores the result in a file (device.map) which can be edited.

For GRUB, a path name must be specified as a device name written in parentheses, followed by a file name together with its full path on that device or partition. The path must always start with a slash. For example, on a system with a single IDE disk and Linux on the first partition, the bootable kernel might be specified with:

(hd0,0)/boot/vmlinuz

A Sample Menu File

The following example shows how the GRUB menu file works. This imaginary machine has a Linux boot partition on /dev/hda5, a root partition on /dev/hda7, and a Windows installation on /dev/hda1.

gfxmenu (hd0,4)/message
color white/blue black/light-gray
default 0
timeout 8

title linux
kernel (hd0,4)/vmlinuz root=/dev/hda7 vga=791
initrd (hd0,4)/initrd
title windows
chainloader(hd0,0)+1
title floppy
chainloader(fd0)+1
title failsafe
kernel (hd0,4)/vmlinuz.shipped root=/dev/hda7 ide=nodma \
apm=off acpi=off vga=normal nosmp maxcpus=0 3
initrd (hd0,4)/initrd.shipped

The first part defines the splash screen configuration:

gfxmenu (hd0,4)/message
The background image is located on /dev/hda5 and has the name message.

color
The color scheme: white as normal foreground, blue as normal background, black for the foreground of selected items, and light gray as the selection background. These colors do not affect the graphical splash screen as defined under gfxmenu, but the standard GRUB interface. On a SuSE Linux system, this interface can be accessed from the splash screen by pressing .

default 0
The first menu entry title linux shall be booted by default.
timeout 8
After 8 seconds without user input, GRUB automatically boots the default entry.

The second, larger part defines the different operating systems to boot:

* The first entry (title linux) is responsible for booting SuSE Linux. The kernel (vmlinuz) is located on the first hard disk on the first logical partition (which is the boot partition in this case). The appended arguments are kernel parameters to specify the root partition and the video mode. The root partition is specified according to Linux conventions (/dev/hda7), because this is a parameter to be interpreted by the Linux kernel (and not by GRUB). The initrd image is located on the same logical partition of the first hard drive.
* The second entry is responsible for booting Windows, which is installed on the first partition of the first hard drive (hd0,0). The command chainloader +1 causes GRUB to read and execute the first sector of the specified partition.
* The next entry enables booting from the floppy drive without changing any BIOS settings.
* The failsafe entry boots a Linux kernel with a number of specific kernel parameters to make it possible to boot on systems where the hardware is causing problems.

The menu file can be modified at any time. GRUB automatically reads the changes on the next boot. To make changes to the boot procedure that should be permanent, modify this file with the corresponding YaST module or with your favorite editor. To change the GRUB behavior on a temporary basis only, use the interactive edit function provided by GRUB.

Editing the Menu Entries

The graphical interface of GRUB not only allows selection of the system to boot (moving the cursor with the arrow keys), but also allows kernel parameters to be appended at the boot prompt (provided that the selection represents a Linux system). This was already possible with LILO, but GRUB takes this one step further. If you press to leave the splash screen then E, GRUB enters editing mode, allowing you to directly change individual menu items. Changes made in this way are valid for the current boot action only. They are not be written to the configuration file.

Washington,D.C.
01-31-2005, 01:09
The main obstacle for booting an operating system is the fact the kernel usually is a file within a file system on a partition on a disk. These concepts are unknown to the BIOS. To circumvent this, "maps" and "map files" were introduced. These maps simply note the physical block numbers on the disk that comprise the logical files. When such a map is processed, the BIOS loads all the physical blocks in sequence as noted in the map, building the logical file in memory.

The main difference between LILO and GRUB is that LILO relies almost entirely on maps, whereas GRUB tries to get rid of fixed maps during boot as early as possible. This is accomplished by integrating file system code to the boot loader, so that files can be found by their path names rather than block numbers.

This difference has historical reasons: in the early days of Linux, many file systems were competing for dominance. Werner Almesberger wrote a boot loader that did not need to know in what kind of file system the kernel to boot actually resided. The idea behind the GRUB approach, however, is even older, from the ages of traditional Unix and BSD. These usually had a single file system of choice and often had a reserved space at its beginning in which to embed a boot loader. This boot loader knew the data structures of the file system in which it was embedded and kernels could be found by name in the root directory of that file system.

SamBuca
01-31-2005, 03:38
What the heck is all that nonsense? ;g

My GRUB conf for Linux:

<pre>default 0
timeout 3
title=Gentoo Linux 2.6.10
root (hd0,0)
kernel /kernel-2.6.10 root=/dev/hda3</pre>

<i>default 0</i> - It loads that entry by default, starting at 0.
<i>timeout 3</i> - Timeout before it loads the default entry in seconds
<i>title=Gentoo ...</i> - "Title" starts an entry...it can be called anything
<i>root (hd0,0)</i> - Sets where the boot information is by the hard drive, a comma, and the partition....all starting at 0.
<i>kernel ...</i> - Specifies the kernel file to use and then whatever info you want to pass to the kernel.

To dual boot in XP, add this:

<pre>title=Windows XP
rootnoverify (hd0,3)
makeactive
chainloader +1</pre>

In this setup, XP is on the 4th partition (remember, it's starting at 0). To install grub to the MBR (so it works), type 'grub-install --root-directory=/boot /dev/hda', where root-directory is where your kernel and grub into resides and then your hard drive (a/b on IDE bus0 and c/d on UDE bus1).

Washington,D.C.
01-31-2005, 07:10
The problem is installing the root partition on a RAID drive.A friend finally got Fedora Core 3 to work by changing to a previous bios version. http://elibrary.fultus.com/technical/index.jsp?topic=/com.fultus.suse.guides/guides/9_0/suselinux-adminguide_en/node8.html

SamBuca
01-31-2005, 14:16
Originally posted by Washington,D.C.
The problem is installing the root partition on a RAID drive.A friend finally got Fedora Core 3 to work by changing to a previous bios version. http://elibrary.fultus.com/technical/index.jsp?topic=/com.fultus.suse.guides/guides/9_0/suselinux-adminguide_en/node8.html
How is RAID a problem with grub?

<pre>grub --device-map=/dev/null
device (hd0,0) /dev/mapper/sil_whatever
device (hd0) /dev/mapper/sil_whatever
root (hd0,0)
setup (hd0,0)</pre>

Washington,D.C.
01-31-2005, 14:46
It's not a grub problem.It's a booting linux problem.

SamBuca
01-31-2005, 18:32
Originally posted by Washington,D.C.
It's not a grub problem.It's a booting linux problem.
That's what grub does ;)

Of course, if the kernel doesn't support it then it won't work regardless.

Washington,D.C.
02-04-2005, 04:45
You can try change the BIOS to 'Compatability' mode if that is a option.More info here http://www.linuxmafia.com/faq/Hardware/sata.html

Washington,D.C.
02-04-2005, 06:14
http://penguincares.no-ip.org:9090/archives/000045.html

Washington,D.C.
02-04-2005, 07:47
http://www.samag.com/documents/s=1155/sam0101g/0101g.htm

Washington,D.C.
02-04-2005, 07:59
http://linas.org/linux/raid.html