View Single Post
Old 14th December 2005, 05:35
crushton crushton is offline
Junior Member
Join Date: Dec 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Step 4 – Setting up the RAID and restoring the new SUSE installation onto it

Make sure you have a running wired Internet connection, place the Gentoo LiveCD into your drive, reboot and change the BIOS accordingly to boot from CD and setup your RAID in it's BIOS to configure your RAID disks. At the boot: prompt just hit Enter and for every option thereafter until you get to the Gnome desktop.
Download the dmraid source, like you did before, to the Gnome desktop. Extract it to the desktop, navigate to the extracted directory via a command terminal window using root permissions. This is done by typing sudo su – at the command prompt in the terminal window.
Compile the source in the same manner as before (you will have to modify the ~tools/ file once again, you can use vi this time, now that you know how):
vi extracted-dmraid-directory/tools/
After editing the line in type:
modprobe dm-mod
tools/dmraid -ay -i
ls /dev/mapper
Your output should resemble something like:
control via_ebfejiabah
The important file (or more correctly known as a device node) is the one that begins with via_. It will have a different prefix depending on your RAID hardware. Make note of it, but for simplicity I will use via_ebfejiabah and you should substitute it with yours. Now type:
fdisk /dev/mapper/via_ebfejiabah
Setup at least 2 partitions with fdisk, one type 82 for your swap and the other type 83 for your main SUSE installation. Refer to the fdisk help (m for help) for info on what to do. Afterwards and before writing the partition tables and exiting fdisk, type p to get the partition tables. Your output might look something like this:
Command (m for help): p

Disk /dev/mapper/via_ebfejiabah: 163.9 GB, 163928603648 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                     Device Boot      Start         End      Blocks   Id  System
/dev/mapper/via_ebfejiabah1               1         125     1004031   82  Linux                     swap / Solaris
/dev/mapper/via_ebfejiabah2             126       19929   159075630   83  Linux
The important parts of the output have been bold typed in the above listing, make note of them on your output (i.e. heads=?, sectors=? and cylinders=?). We will need them later.
You may now write the partition table and quit fdisk. You must now reboot and start the LiveCD again following everything in this step again excluding the initial RAID BIOS setup and upto the point of where we begin to use fdisk. We don't need to setup the partitions again. Gain access to your-new-suse-installation-archive.tar.gz by either mounting the spare disk, mount the CD drive or using ftp etc etc. Remember to mount a volume type:
mkdir /mnt/your-mount-point
mount -t your-volumes-filesystem /dev/your-device /mnt/your-mount-point
If using ftp, like I had to, use Gnome to Connect to Server and it will mount the ftp directory on the desktop. Now we must format the new partitions and extract our new installation onto the root partition. Type the following:
mkswap /dev/mapper/via_ebfejiabah1
mkreiserfs /dev/mapper/via_ebfejiabah2
mkdir /mnt/suse10
mount -t reiserfs /dev/mapper/via_ebfejiabah2 /mnt/suse10
Of course you'll want to replace anything listed in bold above to your specific settings/info. Copy your-new-suse-installation-archive.tar.gz to /mnt/suse10. Extract, using tar at the command prompt.
For example:
cd /mnt/suse10
tar --preserve -xf your-new-suse-installation-archive.tar.gz
This will take a while...then:
rm your-new-suse-installation-archive.tar.gz
vi etc/fstab
In vi change your root device to /dev/mapper/your-root-partition and your swap device to /dev/mapper/your-swap-partition. (i.e. mine were via_ebfejiabah2 and via_ebfejiabah1 respectively)

Step 5 – Making GRUB work with RAID

First we need to modify some files in the /mnt/suse10/boot/grub directory using vi. Type the following:
cd /mnt/suse10/boot/grub
The structure of the file is fairly simple. Just make sure that each entry corresponds to your new drive layout. For example:
(hd0) /dev/mapper/your-raid-device
Save the changes then edit the Grub menu:
vi menu.lst
My menu reads as follows:
# Modified by YaST2. Last modification on Sun Dec 11 20:40:40 UTC 2005

color white/blue black/light-gray
default 0
timeout 5
gfxmenu (hd0,1)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE LINUX 10.0
    root (hd0,1)
    kernel /boot/vmlinuz root=/dev/mapper/via_ebfejiabah2 vga=0x31a selinux=0    resume=/dev/mapper/via_ebfejiabah1  splash=silent showopts
    initrd /boot/initrd

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- SUSE LINUX 10.0
    root (hd0,1)
    kernel /boot/vmlinuz root=/dev/mapper/via_ebfejiabah2 vga=normal showopts ide=nodma apm=off acpi=off noresume selinux=0 edd=off 3
    initrd /boot/initrd
The necessary changes have been bold typed, change to your configuration appropriately. Now we install the grub MBR on our disk so it finds and boots SUSE – or more correctly the kernel and initrd/ramfs.
When using grub, we must know the partition layout of our disks. In the example I am about to express, my partitions were setup as displayed by the fdisk output mentioned above in step 4. My root partition for Linux/SUSE was my second partition, thus, when using grub, I have to refer to that partition as (hd0,1), whereas, (hd0,0) would refer to the first rather than the second. Also, (hd0) refers to the first disk assuming you installed your RAID as the first 2 or more disks. I assume you get the idea. Just make sure the numbers correspond to your particular setup when typing in the details below. Type the following in a terminal with root permissions (i.e. sudo su -):
At the grub prompt type:
device (hd0,1) /dev/mapper/via_ebfejiabah2
device (hd0) /dev/mapper/via_ebfejiabah
This is where we need the fdisk info recorded earlier. Replace the numbers bold typed with yours:
geometry (hd0) 19929 255 63
root (hd0,1)
setup (hd0)
You should now get an output saying some stuff, but nothing referring to errors. Thus all is well so far.

Step 6 – Booting the new SUSE installation

At this point the new installation is ready to be booted. Just make sure your BIOS settings are configured for booting from your RAID disk setup and you should probably disable boot from CD. Assuming everything worked, a familiar SUSE boot screen should appear and naturally SUSE should begin the boot process. On first boot, SUSE will start YaST. We selected this option earlier during the installation of SUSE and is required to properly setup the new system. Just follow the instructions and do what you normally would during SUSE installation. The only significant difference is YaST is displayed in terminal mode, rather than GUI. Otherwise, it is identical to the GUI counterpart. Once YaST has completed, the system defaults to terminal mode.
You will need to edit the /etc/inittab file in order to to boot into graphical mode by default. This is rather simple, at the command prompt type the following:
vi /etc/inittab
And then find the line that says:
Change the bold typed number to a 5, save the file, exit and reboot.

DONE...Have fun!

Last edited by crushton; 14th December 2005 at 07:22.
Reply With Quote