Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks for the suggestions, but it hasn't helped. I did add a line to /proc/readitab that said:
chunk-size 8
That made mkraid do something. (But in my kernal log, I then see a warning that a RAID1 array doesn't need a chunk-size. So, I took the line out to get rid of the warning.) But during boot, the system tells me that there is a problem with hde and hdg and it can't import them, so it doesn't use md0. (Sorry I'm not at that machine, so I don't have exact text)
The filesystem I put on the drives is ext3. Should I have an ext2 filesystem to do RAID1?
AFAIK the kernel supports RAID. It is RH9 and I can see from the kernel log that it is checking for auto RAID and other RAID things, so I assume all the support is there. Is there a way to check for sure?
One other thing - these two drives are on a SIIG PCI controller. I believe it is being correctly identified and used (I can fdisk the drives, add a fs, etc). I can send the kernel log if that would be any help.
[dev 9, 0] /dev/md0 955E5224.08C9D222.1A09677B.BBCFE189 online
[dev 3, 2] /dev/hda2 955E5224.08C9D222.1A09677B.BBCFE189 good
[dev 3, 67] /dev/hdb3 955E5224.08C9D222.1A09677B.BBCFE189 good
now if it looks ok then run this to update your /etc/raidtab file
lsraid -R -a /dev/md0 > /etc/raidtab
the output goes to /etc/raidtab and looks like this..
lsraid -R -a /dev/md0
# This raidtab was generated by lsraid version 0.7.0.
# It was created from a query on the following devices:
# /dev/md0
for someone with multiple devices use it like this
lsraid -R -a /dev/md0 -a /dev/md1
# This raidtab was generated by lsraid version 0.7.0.
# It was created from a query on the following devices:
# /dev/md0
# /dev/md1
Thanks again for the help. Seems like I found the lsraid command and used it but I don't remember what it did (or even where in the process I used it...) I'll give it a try tonight.
It seems like when I used it, it told me that /dev/md0 was not online. And then I think I did a raidstart and tried it again and got an ok response. But at that point, the kernel still had a problem with - what would the term be, starting? - md0. But I'm not sure of that so I'll post again when I can try it again.
Ok, I played around some more last night. I think the array is actually working. Here's what I did:
====================================================
[root@ServerPress root]# lsraid -a /dev/md0
lsraid: md device [dev 9, 0] /dev/md0 is offline: Please specify a disk to query
[root@ServerPress root]# mdadm --create /dev/md0 --chunk=64 --level=raid1 --raid-devices=2
/dev/hde1 /dev/hdg1
bash: mdadm: command not found
[root@ServerPress root]# /sbin/mdadm --create /dev/md0 --chunk=64 --level=raid1 --raid-devices=2 /dev/hde1 /dev/hdg1
bash: /sbin/mdadm: No such file or directory
[root@ServerPress root]# man mdadm
No manual entry for mdadm
[root@ServerPress root]# cat /proc/mdstat
Personalities :
read_ahead not set
unused devices: <none>
[root@ServerPress root]# mkraid /dev/md0
handling MD device /dev/md0
analyzing super-block
disk 0: /dev/hde1, 78148161kB, raid superblock at 78148096kB
disk 1: /dev/hdg1, 78148161kB, raid superblock at 78148096kB
[root@ServerPress root]#
[root@ServerPress root]# lsraid -a /dev/md0
[dev 9, 0] /dev/md0 83EBB493.4B4C15DB.28AAF54B.EA0920B8 online
[dev 33, 1] /dev/hde1 83EBB493.4B4C15DB.28AAF54B.EA0920B8 good
[dev 34, 1] /dev/hdg1 83EBB493.4B4C15DB.28AAF54B.EA0920B8 good
[root@ServerPress root]#lsraid -R -a /dev/md0 > /etc/raidtab
# This raidtab was generated by lsraid version 0.7.0.
# It was created from a query on the following devices:
# /dev/md0
[root@ServerPress root]# mke2fs -j /dev/md0
mke2fs 1.32 (09-Nov-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
9781248 inodes, 19537024 blocks
976851 blocks (5.00%) reserved for the super user
First data block=0
597 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
As you can see, no mdadm program :,(
Also, I did cat /proc/mdstat and finally realized that it was resyncing, and that that process would take a long time (don't know why, there were no files on the disks)
Now after a reboot I get this:
(this message shows on the screen but does not show in any log file I can find)
Starting up RAID devices: md0(skipped)
[root@ServerPress root]# cat /proc/mdstat
Personalities :
read_ahead not set
unused devices: <none>
[root@ServerPress root]# lsraid -a /dev/md0
lsraid: md device [dev 9, 0] /dev/md0 is offline: Please specify a disk to query[root@ServerPress root]# raidstart /dev/md0
[root@ServerPress root]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 hdg1[1] hde1[0]
78148096 blocks [2/2] [UU]
unused devices: <none>
[root@ServerPress root]# mount /dev/md0 /SharedDocs
[root@ServerPress root]# ls /SharedDocs
lost+found
[root@ServerPress root]#
So, it looks like the RAID isn't starting during boot, but can be started manually. Any ideas as to how to get it start automatically? (and then once that works then I just put the mount info in /etc/fstab right?)
mdadm is not really necessary anyway, mkraid does basically the same thing except it requires a raidtab file, where all parameters are given with mdadm so no raidtab file is necessary to create the raid device.
I have this script in /etc/rc.d/rc.sysinit file, that's were your error is coming from...
# Add raid devices
if [ ! -f /proc/mdstat ]; then
modprobe md >/dev/null 2>&1
fi
if [ -f /proc/mdstat -a -f /etc/raidtab ]; then
echo -n $"Starting up RAID devices: "
rc=0
for i in `grep "^[^*]*raiddev" /etc/raidtab | awk '{print $2}'`
do
RAIDDEV=`basename $i`
RAIDSTAT=`grep "^$RAIDDEV : active" /proc/mdstat`
if [ -z "$RAIDSTAT" ]; then
# First scan the /etc/fstab for the "noauto"-flag
# for this device. If found, skip the initialization
# for it to avoid dropping to a shell on errors.
# If not, try raidstart...if that fails then
# fall back to raidadd, raidrun. If that
# also fails, then we drop to a shell
RESULT=1
NOAUTO=`grep "^$i" /etc/fstab | grep -c "noauto"`
if [ $NOAUTO -gt 0 ]; then
RESULT=0
RAIDDEV="$RAIDDEV(skipped)"
fi
if [ $RESULT -gt 0 -a -x /sbin/raidstart ]; then
/sbin/raidstart $i
RESULT=$?
fi
if [ $RESULT -gt 0 -a -x /sbin/raid0run ]; then
/sbin/raid0run $i
RESULT=$?
fi
if [ $RESULT -gt 0 -a -x /sbin/raidadd -a -x /sbin/raidrun ]; then
/sbin/raidadd $i
/sbin/raidrun $i
RESULT=$?
fi
if [ $RESULT -gt 0 ]; then
rc=1
fi
echo -n "$RAIDDEV "
else
echo -n "$RAIDDEV "
fi
done
echo
# A non-zero return means there were problems.
if [ $rc -gt 0 ]; then
echo
echo
echo $"*** An error occurred during the RAID startup"
echo $"*** Dropping you to a shell; the system will reboot"
echo $"*** when you leave the shell."
PS1=$"(RAID Repair) \# # "; export PS1
sulogin
echo $"Unmounting file systems"
umount -a
mount -n -o remount,ro /
echo $"Automatic reboot in progress."
reboot -f
fi
fi
It looks like you just need to add the entry to /etc/fstab and it should work ok.
Last edited by DavidPhillips; 11-05-2003 at 12:30 PM.
That looks like that script will handle all types of RAID. I haven't done any scripts yet, so I can follow what you are doing but I'll have to look up all the command to see exactly what is going on.
Uh, is this PERL?
Also, when I last did fdisk I did not set the RAID flag on either HD. If I set the flag, will the auto function start the RAID? Or what benefit is having the flag set?
Thanks again for your help. I'll try this out tonight, and I think it will get me going.
(Now, about the remote administration from a WinXP desktop....)
Now that it is working, I have a couple of questions regarding use.
In /etc/fstab I have the entry:
/dev/md0 /SharedDocs ext3 rw 0 0
Previously I had:
/dev/md0 /SharedDocs ext3 defaults 0 0
which did not seem to work. Should it? Would I need to define the defaults somewhere?
Also, I want to make the /SharedDocs folder available to WinXP machines on the network. I have Samba running properly and have another folder (/tmp) shared. So I used the Samba config app to add /SharedDocs/Frank to the Samba shares, made it r/w, set it to only be available to frank.
I can see this directory and read it from my XP machine when logged in as Frank. But I can't write it. Do I have to set permissions somewhere?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.