Jump to content

mandriva does not recognize my raid1.. [solved]


sermat
 Share

Recommended Posts

Hi to all. I would be very grateful if somebody could help me. Here's the scenario: I have two hard drives with raid1 filesystem on them. But when I boot the PC with Mandriva 2006, they do not appear in the /dev/ directory at all. Just for refernece, when I boot the same PC with a Fedora, they do show in the /dev/ directory without me having to do anything. The reason I want this to work on Mandriva is that I'm deciding that Mandriva is the best and most effortless Linux distro to work with, and I am thinking to adopt Mandriva as my only distro for the time being.

Many thanks,

serge.

 

 

[moved from Software by spinynorman - welcome aboard :)]

Edited by sermat
Link to comment
Share on other sites

This will be because Mandriva 2006 doesn't have the config from the raid1 drives that Fedora are using. You didn't mention, but I'm guessing you're using software raid that is part of the Linux featureset. Am I correct?

 

If so, you'd need to assemble the array within Mandriva 2006 to be able to access it. I need some more information from you. Please can you post the contents of the following files for me:

 

/etc/fstab

 

which will give me your boot info from Fedora, and also:

 

/proc/mdstat

 

You can use this from the console to do it:

 

cat /etc/fstab

 

and:

 

cat /proc/mdstat

 

I can then see what partition is a member of what array, and I can see the mount points within /etc/fstab to see what to tell you do to in Mandriva. All the above has to be done in Fedora where you can access the drives already.

Link to comment
Share on other sites

Hi ianw1974: Thank you so much for offering to help! Yes it's software RAID1 and here is the output that you requested ( this output is from SUSE 10.1 and not Fedora as I originally mentioned, the reason being that I replaced Fedora last nite with SUSE 10.1):

 

cat /etc/fstab

/dev/hda1 / reiserfs acl,user_xattr 1 1

/dev/hda2 swap swap defaults 0 0

proc /proc proc defaults 0 0

sysfs /sys sysfs noauto 0 0

debugfs /sys/kernel/debug debugfs noauto 0 0

usbfs /proc/bus/usb usbfs noauto 0 0

devpts /dev/pts devpts mode=0620,gid=5 0 0

/dev/fd0 /media/floppy auto noauto,user,sync 0 0

 

cat /proc/mdstat

Personalities : [raid1]

md1 : active raid1 hdc2[0] hdd2[1]

52660992 blocks [2/2] [uU]

 

md0 : active raid1 hdc1[0] hdd1[1]

146480512 blocks [2/2] [uU]

 

unused devices: <none>

 

Again, thanks a lot,

serge.

Link to comment
Share on other sites

You have to have root privileges to do all this, so get a command prompt up and do this:

 

su (enter root password when prompted)

 

now that you've done that, we can continue. Check that mdadm is installed:

 

rpm -qa | grep mdadm

 

if it is, great, if not install with:

 

urpmi mdadm

 

Now do:

 

mknod /dev/md0 b 9 0
mknod /dev/md1 b 9 1

 

This creates the devices in Mandriva, so that you can create the array. Now we need to create a /etc/mdadm.conf file. This is what the contents should be:

 

DEVICE /dev/hdc*
DEVICE /dev/hdd*
ARRAY /dev/md0 devices=/dev/hdc1,/dev/hdd1
ARRAY /dev/md1 devices=/dev/hdc2,/dev/hdd2
MAILADDR root@localhost

 

that gives you your config, so make sure this is saved as /etc/mdadm.conf. Now that you've done this, we need to assemble the array so that we can access them.

 

mdadm --assemble --scan

 

the scan parameter will scan the /etc/mdadm.conf and enable the array accordingly. Now you need to make sure mdadm is enabled as a service, so do this:

 

chkconfig --list mdadm

 

it should show on against all runlevels, as we need this service. If not, do:

 

chkconfig mdadm on

 

and you're done. Make sure you create the mountpoints for these partitions in your /etc/fstab, as these currently don't seem to exist in your /etc/fstab above. So make sure you know where you want them mounting, create the appropriate directory, and then the entry in /etc/fstab. You also need to know the filesystem that you created as well to make the /etc/fstab entries.

 

If you have any problems with the array assembly, try starting the mdadm service, and retry:

 

service mdadm start

 

and continue trying to assemble the array.

Link to comment
Share on other sites

WOW !!! Thanks. But before I do your procedure, just wanted to confirm that they will not destroy data on the RAID hard drives. (and just to explain about my relative "newbe" questions: I did not prepare those RAID drives, and the person who did it is not available at this time).

Link to comment
Share on other sites

No, it won't destroy, as you're assembling them ready to use. This is what normally happens during boot to give you access to the data.

 

Just never use the "--create" parameter, as that will lose all your data ;)

 

EDIT:

 

And if you don't know what file system, do this:

 

mkdir /mnt/md0
mkdir /mnt/md1

 

creates you two mount points, then just do:

 

mount /dev/md0 /mnt/md0
mount /dev/md1 /mnt/md1

 

this will mount them with defaults, and if you then just type:

 

mount

 

and post the results, we can help you choose how to edit the /etc/fstab accordingly. Note that /mnt/md0 and /mnt/md1 I've just used for simply seeing what data we have. We can use different and more permanent mount points later, once we know what is in each partition in terms of data.

Link to comment
Share on other sites

This is incredible: followed your instructions to the letter and ALL is perfect !!!!! I see data on my RAID1 hard drives without a problem. Here is the output of the mount command as you requested:

 

#mount [Enter]

/dev/hda5 on / type ext3 (rw)

none on /proc/bus/usb type usbfs (rw)

none on /sys type sysfs (rw)

/dev/md0 on /mnt/md0 type ext3 (rw)

/dev/md1 on /mnt/md1 type vfat (rw)

#

 

As you mentioned, you could suggest how to edit the /etc/fstab file. Would you, please.

 

serge.

Link to comment
Share on other sites

Hi ianw1974: As I reported above, I had complete success by following your instructions. But just one problem: when I reboot the PC. the /dev/md0 and /dev/md1 are gone. So I did the following, and it works: I added this to the /etc/rc.d/rc.local:

 

mknod /dev/md0 b 9 0

mknod /dev/md1 b 9 1

mdadm --assemble --scan

mount /dev/md0 /mnt/md0

mount /dev/md1 /mnt/md1

 

And all is perfect now, even after reboot.

Could you just comment weather this is the proper way to do it?

 

Many, many thanks,

serge.

Link to comment
Share on other sites

You shouldn't need to do this, just make sure the mdadm service is enabled and it should take care of it for you. If it's not, perhaps we need to recreate the initrd image to get it working at boot.

 

Doing what you did in rc.local is fine, but of course, we could generate an initrd easily enough.

 

This link of a howto on what I wrote to migrate from a normal filesystem to raid1 explains what you need to do to get the initrd created to support mounting normally during boot without the rc.local amendments:

 

https://mandrivausers.org/index.php?act=ST&...=22&t=36372

 

It has an example of how it looks in Mandriva 2007 so you can get an idea of what you need to do. If you've got any questions post back.

 

Now that we know that md0 = ext3, and md1 = vfat, we can create your fstab entries easily enough. What data did you have on each of these? Did you check in /mnt/md0 and /mnt/md1 after we accessed them to see? If you let me know, we can choose appropriate mount points. For example, if one of yours was music, then we could create a music directory and mount it to that.

Link to comment
Share on other sites

Hi again: Here are the answers/facts:

1) When I do not have my "fix" with rc.local, mdadm is still started OK. But as I mentioned, I do not get any "md" devices in /dev/. So I'll get reading on your article, and try to rebuild initrd.img. I'm just wondering as to why SUSE and Fedora do this "/dev/md business" automatically and Mandriva is not?

 

2) Regarding the fstab and the type of data I store on ext3 and vfat: it's everything, because, this is is going to be my main back-up system, so I'll be dumping all kind of stuff to md0 and md1: music, video, text, graphics, etc.

Link to comment
Share on other sites

Usually, if you installed Mandriva with software raid settings, the initrd would have all it needed to get raid going during boot.

 

Since you're system was installed without it, the initrd doesn't contain anything, and this is why you can do it manually, but not automatically. After you fix the initrd, all the /dev/mdx points will be created normally during boot. Or at least they did when I wrote that post about upgrading your file system from the standard to raid 1 anyhow.

 

As to your /etc/fstab, I guess we could have data1 and data2 for each of the drives. Or maybe even since one is vfat, to have this one labelled for sharing data with windows - as I presume is why you have vfat configured for this.

Link to comment
Share on other sites

Hi ianw1974: I'm extremely thankful and obliged for your help.

 

It doesn't look like /etc/fstab needs any adjusting to make accessing the RAID1 volumes (ext3 and vfat) work --- it's all perfect as is.

 

Just to let you know, I've just completed the setup of my little home server based on Mandriva 2007 and, with your help, it looks like a total success !!! I do not want to waste space on this forum, but feel so good about this, that will briefly summarize my setup:

 

1) Computer is an old PII-300 (300 MHz, 4 GB hard drive), that I picked up for free on my street during last week's garbage day.

 

2) OS is Mandriva 2007 that installed absolutely perfectly.

 

3) Main back up storage is RAID1 set of two 200 GB hard drives. This was one item that required a bit of "fiddling", but was solved with ianw1974's generous help. Note: applying the KISS principle, I'm leaving the RAID1 setup in /etc/rc.d/rc.local for now, and will try to fiddle with the initrd image later).

 

4) apache is configured to serve directories, so I can put Mandriva DVD "tree" on this server, so I can install Mandriva on my other PC's from this server, by just using the boot.iso CDRW and selecting the HTTP install method

 

5) It's also a print server - MCC was used to absolutely effortlessly configure and share the Konica-Minolta 1400W printer (new cost at Future Shop is CAN$ 69.95). No other Linux Distro I tried could do that !!!

 

6) Samba configuration took a bit of playing with but it's perfect now, and I can access this server from a client PCs running Linux or Windows.

 

Again, thanks a lot ianw1974 !!!

 

Best regards to all,

 

serge.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...