Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
okay, am creating a RAID0 array though a BASH script. After the RAID is created, I want to mount the md device created but as soon as I try to do this, mount takes forever, and when I look at the "top", my script keeps duplicating like crazy and eventually the machine goes down. dmesg doesn't show much except once and only once it said: ./script1: Out of Memory or something along that line...
But funny thing is, I can mount it manually with no problem. Any ideas?
Thanks for the reply. The script is huge and I can't post it here. Here's the function that does what I just said:
Quote:
function create_raid0 {
md_dev="/dev/md$6"
command=`$S_PATH/redundancy -setup $md_dev 0 2 /dev/$vgname_a/$1 /dev/$vgname_b/$1`
if [ $? -eq 0 ]; then
echo "RAID 0 array started successfully with /dev/$vgname_a/$1 /dev/$vgname_b/$1"
echo "Checking the MOUNT"
mnt=`mount $md_dev /mnt/raid`
if [ $? -eq 0 ]; then
echo "Mounted successfully"
else
echo "Not mounted"
fi
exit
else
echo "Unable to start RAID 0 array with /dev/$vgname_a/$1 /dev/$vgname_b/$1"
exit 1
fi
}
It sets up RAID0 on top of LVM.
It sets up the raid successfully and it even prints "Checking the MOUNT" but then it goes crazy after that. One more thing, I tried doing: mnt=`mount /dev/md1 /mnt/raid` just to see if it just doesn't like variables, but still same thing...
CREATING RAID
mdadm: /dev/RBkJ6XJ4/rbn1 appears to contain an ext2fs file system
size=2097152K mtime=Thu Jan 1 00:00:00 1970
mdadm: /dev/RBkJ6XJ4/rbn1 appears to be part of a raid array:
level=raid0 devices=2 ctime=Sat Jan 1 00:42:18 2000
mdadm: /dev/RBbKfhEz/rbn1 appears to contain an ext2fs file system
size=2097152K mtime=Thu Jan 1 00:00:00 1970
mdadm: /dev/RBbKfhEz/rbn1 appears to be part of a raid array:
level=raid0 devices=2 ctime=Sat Jan 1 00:42:18 2000
Continue creating array? mdadm: array /dev/md1 started.
RAID 0 array started successfully with /dev/RBkJ6XJ4/rbn1 /dev/RBbKfhEz/rbn1
Checking the MOUNT
and then it freezes and goes all crazy...
I replaced my other function call with correct MDADM call:
Quote:
md_dev="/dev/md$6"
# command=`$S_PATH/redundancy -setup $md_dev 0 2 /dev/$vgname_a/$1 /dev/$vgname_b/$1`
echo "CREATING RAID"
command=`echo y | mdadm --create $md_dev --level=0 --raid-devices=2 /dev/$vgname_a/$1 /dev/$vgname_b/$1`
if [ $? -eq 0 ]; then
echo "RAID 0 array started successfully with /dev/$vgname_a/$1 /dev/$vgname_b/$1"
echo "Checking the MOUNT"
mnt=`mount /dev/md1 /mnt/raid`
if [ $? -eq 0 ]; then
echo "Mounted successfully"
else
echo "Not mounted successfully"
fi
exit
else
echo "Unable to start RAID 0 array with /dev/$vgname_a/$1 /dev/$vgname_b/$1"
exit 1
fi
}
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.