LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mount takes forever and Linux crashes? (https://www.linuxquestions.org/questions/linux-newbie-8/mount-takes-forever-and-linux-crashes-678160/)

alirezan1 10-21-2008 05:36 PM

Mount takes forever and Linux crashes?
 
hi guys,

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

Total-MAdMaN 10-21-2008 05:39 PM

Post the script.

alirezan1 10-21-2008 05:52 PM

Quote:

Originally Posted by Total-MAdMaN (Post 3318081)
Post the script.

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...

thanks

alirezan1 10-21-2008 06:05 PM

when I call this function, here's the output:

Quote:

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
}
Thanks!


All times are GMT -5. The time now is 03:54 PM.