WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: howto install mdraid?  (Read 8438 times)

Offline Ztoragefool

  • Newbie
  • *
  • Posts: 27
Re: howto install mdraid?
« Reply #15 on: November 09, 2010, 04:45:19 PM »
ok, took out 2> suppression from rcS, now i got my error message on console
Code: [Select]
modprobe: can´t load module md_mod (kernel.tclocal/drivers/md/md-mod.ko.gz): No such file or directory
funny: md_mod IS loaded, directly after booting i see it via lsmod. this is the case since i inserted it in rcS, so ... ??? when and why does it get loaded, when it fails during init?

however, this path "kernel.tclocal/" is a symlink to modules installed under tce, i.e. in /usr/local/lib/..., which definitely isn´t there at boot time. so for now i´ll trick depmod by temporarily taking the link away...

yup, got my module. now lets see to get the raid up during boot.
« Last Edit: November 09, 2010, 04:48:59 PM by Ztoragefool »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: howto install mdraid?
« Reply #16 on: November 09, 2010, 07:36:49 PM »
This is an interesting project.
Once you assemble the array, you will need to modify the the rules
so that the RAID members are not scanned, and the new array is scanned
for the tce directory.

Offline Ztoragefool

  • Newbie
  • *
  • Posts: 27
Re: howto install mdraid?
« Reply #17 on: November 10, 2010, 07:38:32 AM »
gerald, sounds like wetted appetite!

yeah, suppose you´re talking about udev rules? i´ve been afraid they would get involved - man, i see those rules and scare my *** off...

for now i just see 3 different versions of etc/udev/rules.d/64-md-raid.rules :
one contained in initrd
one in /
one in /usr/local

EDIT: sorry, the latter two are identical, so theres one for runtime and a -slightly- different inside initrd. seems like it only differs in commenting out one rule dealing with raid members.
 
the initrd version should be relevant for boot time, but... nnnah, messy... first gotta read more stuff about udev. cya   >:(
« Last Edit: November 10, 2010, 05:00:29 PM by Ztoragefool »

Offline Ztoragefool

  • Newbie
  • *
  • Posts: 27
Re: howto install mdraid?
« Reply #18 on: November 14, 2010, 10:59:46 AM »
hi,

let´s take a look at what i´ve got:
  - sda1 partition type FD
  - md1 raid level 1 (one missing), formatted with ext4., contains boot/* and tce/* directories.
  - called extlinux -ir /mnt/md1/boot/extlinux to make it boot
  - oh yeah, microcore64.gz and bzImage64 - wanna have full memory support

in fact, the microcore64 initrd is modified:
  - added raid1 and md-mod kernel modules to load at boot time
  - updated via depmod
  - 64-md-raid.rules: uncommented first rule (describing raid members)
  - rcS (i.e. tc-config) calls modprobe raid1 in line 107 - this is before udev is called

now tc64 boots but still ignores my partition at boot time, so there´s solely the command line but nothing installed in tce. i immediately can sudo mdadm -As and get my raiddrive, so - be it the rules like gerald suggested or a wrong placement of modprobe raid1 - it´s all there, but something´s  still wrong...

i read a lot and tried hard... anyone for assistance?

Offline gutmensch

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: howto install mdraid?
« Reply #19 on: November 14, 2010, 11:10:35 AM »
FWIW: The included 64-md-raid.rules in tinycore base is not very sense- or helpful since it calls /sbin/mdadm, which is not in the base and even when mdadm.tcz is loaded the rules will not work, because it's /usr/local/sbin/mdadm. That's why atm the install script of mdadm overwrites the base version... actually I'd say it should go out of the base because there's no use for it.
If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)

Offline Ztoragefool

  • Newbie
  • *
  • Posts: 27
Re: howto install mdraid?
« Reply #20 on: November 14, 2010, 12:02:37 PM »
ah right,

forgot to mention i copied mdadm to /sbin inside the initrd. (so you guys call it base, right?)

so your next try would include different rules? would be an idea to compare ours to the xenserver rules, where i got it booting.

just for brainstorming i blast out some more questions i got:

 a) dmesg still mentions raid1 quite late, looks to me like if harware detection still happens before, is there any place other than tc-config (rcS) to load the raid1 module? my guessing is, it should be loaded when udev recognises disks, clever udev rules provided...

 b) maybe kernel configuration lacks something needed for md disks at boot time? can it work with the current image?

again, thanks for spending your time!

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: howto install mdraid?
« Reply #21 on: November 15, 2010, 01:17:10 AM »
FWIW: The included 64-md-raid.rules in tinycore base is not very sense- or helpful since it calls /sbin/mdadm, which is not in the base and even when mdadm.tcz is loaded the rules will not work, because it's /usr/local/sbin/mdadm. That's why atm the install script of mdadm overwrites the base version... actually I'd say it should go out of the base because there's no use for it.
Agreed. It is supplied in the mdadm.tcz extensions. Will be removed from base.
10+ Years Contributing to Linux Open Source Projects.

Offline Ztoragefool

  • Newbie
  • *
  • Posts: 27
Re: howto install mdraid?
« Reply #22 on: November 24, 2010, 07:10:35 AM »
WOW!

just updated from 3.2 to 3.3 (microcore64) out of curiosity and... yay! default kernel/base files boot tc from my partitioned (!) raid drive. so whoever took care of this running smoother...

THANK YOU!

however, later on i'd like to list some small issues i still encounter, taking the whole solution apart from real tranparency. i take care of them within bootlocal.sh, so i've got it running, but i want to give this feedback for the case you stumble upon some lines of code which just need to be swapped to achieve this during boot/init phase.

mainly, i observe that my raid partition /dev/md1p1 gets mentioned in fstab and /mnt directory, which makes me very happy. but it doesn'd get completely preferred over /dev/sda1 since this is the one still being mounted and presented in the .backup_device and .tce_dir files.

ok, could give more details on this and my fancy vision of tranparency, if needed.


Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: howto install mdraid?
« Reply #23 on: November 24, 2010, 11:01:33 PM »
Regarding the "preference" of TC to use '/dev/sda1': During the boot process TC will search in the 'root' of all detected storage devices for a 'tce' directory and unless "guided" otherwise will pick the first one it comes accross. This "guidance" to choose a particular one can be achieved via the 'tce=DEV' boot code. Possible values for DEV are things like device names (e.g. 'hda1') or file system identifiers (e.g 'LABEL=...' or 'UUID=...').

Yours is certainly a special case as I don't know whether your target filesystem is already "known" at the time this scanning is performed. But maybe the 'waitusb=X' boot code can be used for your situation as well. I'm thinking that maybe in its 'waitusb=X:UUID=....' form it might be just what you need.