Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Is it possible to install + boot int raid 5 device in linux?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
remix
l33t
l33t


Joined: 28 Apr 2004
Posts: 797
Location: hawaii

PostPosted: Fri Feb 05, 2010 7:08 pm    Post subject: Is it possible to install + boot int raid 5 device in linux? Reply with quote

if not gentoo, then does anyone know if it works with any other distro/kernel?

or does every linux system boot into a real physical device?

https://forums.gentoo.org/viewtopic-t-814245.html
_________________
help the needy
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Fri Feb 05, 2010 8:07 pm    Post subject: Reply with quote

remix,

The booting rules are as follows.
1. The BIOS must be able to read the boot loader.
2. The boot loader must be able to read the kernel and initrd, if there is one
3. The kernel (with the aid of the initrd) needs to be able to mount the root filesystem
4. With root mounted you can do anything.

Now to your specific question. There are four sorts of raid5 that linux knows about.
Hardware raid - the raid controller hides the phyisical structure of the raid - it appears as a single device and you use it that way.
Everything just works as the raid card takes care of things.

Fakeraid - the raid is provided partly by the BIOS and partly by the dmraid kernel module. This looks like real hardware raid, hence the name but the kernel can see the underlying devices too. This is the raid you get with onboard SATA controllers.

Windows Dynamic Disk - the kernel supports Windows software raid - I'm not sure if you can boot from it, nor why you would want to

Kernel software raid. Grub1 ignores any raid, which is ok if /boot is not raided or is raid1 but grub fails totally on other kernel raid levels as it does not decode the raid.
I think grub2 understands other raid levels but I've not tested it.

Once you get the kernel loaded, root can be anything. I have root on kernel raid5 and /boot on raid1.
I would have had root inside LVM but that needs an initrd to get LVM up before root can be mounted.

In short, the answer to your question is "Maybe"
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
remix
l33t
l33t


Joined: 28 Apr 2004
Posts: 797
Location: hawaii

PostPosted: Fri Feb 05, 2010 11:06 pm    Post subject: Reply with quote

heh, thanks!

well i got 1, and 2 working, failing at 3 where my kernel doesn't know how to mount the root filesystem.

i do have FakeRaid via NVRaid. when i turned it on in bios, livecd (or maybe it's just me) did not know how to see the fake physical device. of course it saw sd[a,b,c,d] but /dev/mapper/ only had control in it. then i fiddled with dmraid, it did "show" me the physical raid named something like nvidia_abiccada, however i was not able to get the device to activate in /dev/mapper/nvidia_abiccada

i also heard from another user that dmraid is not as good as software raid using mdadm.
_________________
help the needy
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sat Feb 06, 2010 11:01 am    Post subject: Reply with quote

remix,

dmraid does work but it has several drawbacks compared to kernel raid.
Its not as robust as kernel raid. If you need to move the raid set to another machine, you need the same hardware and BIOS.
Kernel raid just works.

The only reason to choose dmraid over kernel raid is that Windows must share the raid set.

It sounds like you have a problem in your initrd, not getting dmraid going properly.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
remix
l33t
l33t


Joined: 28 Apr 2004
Posts: 797
Location: hawaii

PostPosted: Mon Feb 08, 2010 10:24 pm    Post subject: Reply with quote

i wasn't able to recompile my kernel, kept getting kernel panics.
even when i wanted to emerge a new kernel version, it would crash out on emerge. (python fails)

so i decided to start all over again and reformat my raids. and now everytime i use mdadm to assemble my raids, i get kernel panics, i'm still in livecd mode, my raids are totally empty now so there's nothing to chroot into.

so i create my raids again using mdadm --create and even before i finish formatting, i get kernel panic and livecd system hangs.

i don't know what else i can do now, i feel pretty stuck cause i don't know how to check disk if there is no filesystem to check. it really feels like either the livedvd or my hard drives are broken... isn't that the point of raid5 though? if one fails, it uses the parity of the last to repair? these are brand new disks, brand new everything actually, got each piece new and fresh from newegg.

any other suggestions? i'm going to burn another livedvd now.
_________________
help the needy
Back to top
View user's profile Send private message
remix
l33t
l33t


Joined: 28 Apr 2004
Posts: 797
Location: hawaii

PostPosted: Mon Feb 08, 2010 10:27 pm    Post subject: Reply with quote

oh and since my ssh connection died on kernel panic, i can show you only the last messages before it disconnected me

Code:
livecd ~ # mke2fs -j /dev/md3
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
4923392 inodes, 19669536 blocks
983476 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
601 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
   32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
   4096000, 7962624, 11239424

Writing inode tables: 265/601


meanwhile, i get kernel panic stack trace errors on the monitor next to me, lots of hex characters.
the only thing readable is Pid:7102, comm: md3_raid5 Not tainted 2.6.30-gentoo-r5 #1 System Product Name
_________________
help the needy
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Wed Feb 10, 2010 6:27 pm    Post subject: Reply with quote

remix,

Lets take it easy. Do a standard install on a single drive, if you can.
That may help the diagnostics. If it fails in the same way, try another driver. if that fails too, you have a hardware problem.
Maybe RAM ?
Try memtest from the liveCD. A failure indicates a problem related to the motherboard, not just RAM.
You then need the failure symptoms to narrow down the failure.

If the single drive install works, create your raid sets in degraded mode, with a drive missing.
Copy the single drive install to the degraded raid set. Install grub on the raid, test you can boot the raid.
Lastly, add your single drive install into the raid sets to bring the raids up to strength. This destroys the single drive install.

There - some diagnostics and if it works you yet to practice failed drive replacement too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
remix
l33t
l33t


Joined: 28 Apr 2004
Posts: 797
Location: hawaii

PostPosted: Thu Feb 18, 2010 3:22 am    Post subject: Reply with quote

Hi Neddy,

I brought in an ATA hd to see if i can just get gentoo to install like normal on one disk, then i wouldn't even mind running everything(boot/root/swap) on that small 160GB and just have /home and /var/www on raid5 disks... failed terribly with Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block(0,0)

very weird cause that's so similar to what i was getting on the non-autodetecting raid setup.

anyway, i found out that the problem wasn't that i didn't enable ext3 fs support in the kernel, cause when i redid the install from scratch again, i found mke2fs -j /dev/sda3 say something about Warning bad superblock or something. and i'm currently running badblocks on that drive, it's riddled with badblocks. so i'm going to decorate my walls with the old ATA harddrive.

now, about this degraded mode... can you go into a bit more detail of how to accomplish this?
step by step, i'm guessing i will reformat (not repartition) the first disk of the 4 disk SATA array.
like normal, ext2 boot, swap, ext3 root, reiserfs home, etc.. and all these partition sizes still mirror the other disks.

so now, i should get the install to work and boot first, correct?

then how do i proceed with copying the drive/partitions to a 'degraded array' (how do i even make a degraded array?) and then add that first drive back in?

i'm very grateful that you have taken the time to help me out with this. this is just beyond my experience and may need a bit of hand holding >.<

thanks!
_________________
help the needy
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Thu Feb 18, 2010 7:20 pm    Post subject: Reply with quote

remix,

Try to fix your 160G PATA drive by writing to the entire surface
Code:
dd if=/dev/zero of=/dev/hda
if its /dev/hda

Choose one of your SATA drives and do a standard install. Partition sizes don't matter. You can change them when you copy things to the degraded raid setup.

Once the standard install works,
Code:
emerge smartmontools
and read the error log for for 160G drive. That will tell if its any good or not.

Partition the remaining drives identically, with the layout you want.
A raid5 is capable of operating with any single drive missing. You can also create a raid set (except raid0) with its redundancy missing.
Code:
man mdadm
says CREATE MODE
Code:
       Usage: mdadm --create md-device --chunk=X --level=Y
                   --raid-devices=Z devices
...
       To  create a "degraded" array in which some devices are missing, simply
       give the word "missing" in place of a device  name.   This  will  cause
       mdadm  to leave the corresponding slot in the array empty.  For a RAID4
       or RAID5 array at most one slot can be "missing"; for a RAID6 array  at
       most  two  slots.   For a RAID1 array, only one real device needs to be
       given.  All of the others can be "missing".


Having created your raid sets, with one element missing, made your filesystems on the /dev/mdx devices you can mount them.
Borrow the mount point /mnt/cdrom for this.

Code:
mount /dev/mdA /mnt/cdrom
mkdir /mnt/cdrom/boot
mount /dev/mdB /mnt/cdrom/boot
and so on
/boot must be raid1 or not raided.
You now have your blank degraded raid filesystem tree attached to your single drive install at /mnt/cdrom

Copy the directories in / to /mnt/cdrom one at a time, omitting /dev /proc and /sys as they are not real filesystems. Use cp -a to preserve permissions.

Next, chroot into the degraded raid install so you can install grub to the MBR
Mount /proc and /dev as the handbook describes, then chroot, following the handbook except that you need to
Code:
chroot /mnt/cdom /bin/bash
not /mnt/gentoo

Install grub to the MBR of two drives in the degraded raid set. Thats
Code:
grub
root (hd0,0)
setup (hd0)
root (hd1,0)
setup (hd0)
quit
fix the drive numbers - your (hd0) may be your single drive install, so be careful here.

Lastly edit grub.conf to boot from either of the two drives that you installed grub on and your single drive install, so just add to grub.conf.
Code:
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

#2.6.32-gentoo-r3
title=Kernel 2.6.32-gentoo-r3 (hd0)
root (hd0,0)
kernel (hd0,0)/2.6.32-gentoo-r3 root=/dev/md5 vga=0x317 video=vesafb:mtrr:3,ywrap

title=Kernel 2.6.32-gentoo-r3 (hd1)
root (hd1,0)
kernel (hd1,0)/2.6.32-gentoo-r3 root=/dev/md5
is what I have.

Exit the chroot and add identical boot stanzas to the single drive installs /boot/grub.

Restart. Choose one of the raid boot options, if it works restart and choose the other raid boot option
If it fails, choose the single drive install and fix it.
When all three options work and /proc/mdstat shows the raids in degraded mode, you are ready to destroy the single drive install and bring the raid sets up to strength.

Partition but do not format the drive (make sure you get the right one) then use
Code:
mdadm -a /dev/mdA  /dev/sdXY
to add the partitions to the existing /dev/mdA ... fill in A, X and Y.
This will be a slow operation as the entire drive will be written with the redundant data. However, mdadm limits the IO bandwidth used for synching the raid set so you can still use the system.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
remix
l33t
l33t


Joined: 28 Apr 2004
Posts: 797
Location: hawaii

PostPosted: Thu Feb 18, 2010 10:51 pm    Post subject: Reply with quote

thanks! so i've run across a couple weird things. one, is that my PATA drive is /dev/sda and all my sata drives are b,c,d,e now (instead of a,b,c,d)
i don't think that's a problem, i just think it's odd cause i remember before, PATA drives are always /dev/hd*

and so i started to write to the 160G drive with dd if=/dev/zero of=/dev/hda off the LiveDVD. and i got a general protection fault.

so i think the next step right now would be to get an older x86_84 livecd/dvd cause i know those worked, this one has been giving me kernel panics (off liveDVD environment AND chroot)

then i'll continue with what you wrote step by step.
_________________
help the needy
Back to top
View user's profile Send private message
remix
l33t
l33t


Joined: 28 Apr 2004
Posts: 797
Location: hawaii

PostPosted: Thu Feb 18, 2010 11:18 pm    Post subject: Reply with quote

oh, and i'm running Memtest86 right now, it doesn't look too good

http://i49.tinypic.com/2hyjukj.jpg
_________________
help the needy
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Fri Feb 19, 2010 7:25 pm    Post subject: Reply with quote

remix,

That has all the hallmarks of a RAM problem as it happens at a fixed addrss.
Memtest errors that cannot be repeated are normally not RAM related. However, more diagnostics are called for.

1/ Remove each stick of RAM and replace in in the same slot. The idea is to 'wipe' the contacts, which often works wonders for about 18 months. If you get the same error at the same address continue with 2.

2/ Rotate Your RAM sticks, i.e. move them all round one slot without bringing any spare slots into play.
Hopefully this will have at least changed the failing addess.

If the failing address has changed - the problem is with a stick of RAM, if not, its something motherboard related.
To isolate a RAM issue, try removing one stick at a time. When memtest runs clean, the not fitted RAM may be faulty.
Test every stick like this. Its not unknown for all combinations of RAM-1 to pass.

If the failing address is unchanged when you rotate the RAM, try abandoning one RAM slot at a time and bringing a spare slot into use, if you have some.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
remix
l33t
l33t


Joined: 28 Apr 2004
Posts: 797
Location: hawaii

PostPosted: Wed Feb 24, 2010 12:18 am    Post subject: Reply with quote

ok so i fixed my RAM problems by reseating it.

and by using an older kernel version, i'm now able to boot off of my raid1 boot partitions and even autodetect the raid arrays, it automatically creates md0,md1,md3,md4,md5 devices (very close to what i had, md1,md2,md3,md4,md5 setup in mdadm.conf so i just adjusted my fstab accordingly)

however, it pauses for a looong time during boot up process, then fails.

here are the errors

before long pause:
http://i48.tinypic.com/2j32np0.jpg

after long pause:
http://i50.tinypic.com/2iuqp82.jpg


any ideas?
_________________
help the needy
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Wed Feb 24, 2010 7:48 pm    Post subject: Reply with quote

remix,

Unable to open initial console is a bad sign on its own. I can think of three causes.
There is no console configured in the kernel. You have a choice of two sorts but its not an error to leave them both out.
The system still works.

You have a udev that is too old/new for your kernel and its not making /dev/console

You have an older udev that requires a static /dev/console and its missing

For the panic
At the the grub splash screen press e.
Follow the on screen instructions to edit the kernel line.
Append options like noapic noapci both separately and together.

Please post your kernel .config somewhere. You may email it to me and I'll post it for you.
Its the file at /usr/src/linux/.config
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
remix
l33t
l33t


Joined: 28 Apr 2004
Posts: 797
Location: hawaii

PostPosted: Wed Feb 24, 2010 9:13 pm    Post subject: Reply with quote

here is my kernel config. http://pastie.org/841219

what does noapic and noapci do?

and i should boot up with them with a kernel that has a console configured, yes?
_________________
help the needy
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Wed Feb 24, 2010 9:58 pm    Post subject: Reply with quote

remix,

One turns off the Advanced Peripheral Interrupt Controller, the other turns off the Advanced Power Control Interface, which are good thinks to have working but can cause issues if the kernel is not set up right.

I'll look at your kernel tomorow
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Thu Feb 25, 2010 8:31 pm    Post subject: Reply with quote

remix,

There is a lot of junk in your kernel but I don't see anything that should prevent it booting.

You have two drivers built the your PATA interface, the old IDE one and the new libata one, so its unlikely that PATA will work at all.
There are a few of my kernel config files here, all for gentoo-sources.

My lspci looks like
Code:
00:00.0 Host bridge: Advanced Micro Devices [AMD] RS780 Host Bridge
00:02.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (ext gfx port 0)
00:05.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 1)
00:06.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 2)
00:07.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 3)
00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode]
00:12.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller
00:12.1 USB Controller: ATI Technologies Inc SB700 USB OHCI1 Controller
00:12.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller
00:13.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller
00:13.1 USB Controller: ATI Technologies Inc SB700 USB OHCI1 Controller
00:13.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller
00:14.0 SMBus: ATI Technologies Inc SBx00 SMBus Controller (rev 3a)
00:14.1 IDE interface: ATI Technologies Inc SB700/SB800 IDE Controller
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA)
00:14.3 ISA bridge: ATI Technologies Inc SB700/SB800 LPC host controller
00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge
00:14.5 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI2 Controller
00:18.0 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] HyperTransport Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Miscellaneous Control
00:18.4 Host bridge: Advanced Micro Devices [AMD] K10 [Opteron, Athlon64, Sempron] Link Control
01:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 9800 GT] (rev a2)
02:00.0 Multimedia video controller: Conexant Systems, Inc. CX23885 PCI Video and Audio Decoder (rev 02)
03:00.0 Ethernet controller: Attansic Technology Corp. Atheros AR8121/AR8113/AR8114 PCI-E Ethernet Controller (rev b0)
04:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. Device 3403

If yours is similar, you could start from one of my configs, otherwise try one of Pappys Seeds see the link in Pappys sig and post in that thread for help. You will need the seed, then add support for raid and your hardware.
The site explains it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum