LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-19-2010, 07:17 AM   #1
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707

Rep: Reputation: 55
Raid device /dev/md2 not sustaining


Dear All,

I am trying to configure RAID 1 on Fedora12 Virtual Machine.

Initially I had two drives /dev/sda and /dev/sdb which are configured with RAID 1.

Now I have attached two more hard drives /dev/sdc and /dev/sdd in which I am trying to configure RAID1. I have followed following steps to mount newly created Raid array on /var

1. Created /dev/sdc1 and /dev/sdd1 as Linuxraid (ID:fd) with 200MB of space

2. Created raid array
Code:
# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/hdc1 /dev/hdd1
3. Created ext3 filesystem
Code:
# mkfs.ext3 /dev/md2
4. Mount it on a test directory
Code:
# mount /dev/md2 /mnt/var
5. Copy the files of /var to /mnt/var/
Code:
cp -ar /var/. /mnt/var/
6. Unmount the volume
Code:
umount /mnt/md2
7. mount on /var
Code:
mount -t ext3 /dev/md2 /var
Now I could see all the files in side /var and /dev/md2 is properly mounted on /var

Also I added following line to /etc/fstab
Code:
/dev/md2   /var   ext3  defaults 1 2
Even after mount -a I can see the /dev/md2 mounted on /var

But when I reboot the machine system goes to maintainance mode and asks for root password, because created raid arrary /dev/md2 is not sustaining after reboot.

What additional command I have to execute to make /dev/md2 permanent after reboot ?

Thanks in advance.

Last edited by vinaytp; 05-19-2010 at 07:18 AM.
 
Old 05-19-2010, 08:50 AM   #2
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Hi Vinaya

Think everything you did is 100% - except i think you missed one step.

I've done this before and I remember that you need an mdadm.conf file that stores your RAID set information for persistence.

Similar to the example below (taken from a good RHCE tutorial I found online)

Code:
 Create the mdadm.conf Configuration File

Your system doesn't automatically remember all the component partitions of your RAID set. This information has to be kept in the mdadm.conf file. The formatting can be tricky, but fortunately the output of the mdadm --detail --scan --verbose command provides you with it. Here we see the output sent to the screen.

[root@bigboy tmp]# mdadm --detail --scan --verbose
ARRAY /dev/md0 level=raid5 num-devices=4 
UUID=77b695c4:32e5dd46:63dd7d16:17696e09
   devices=/dev/hde1,/dev/hdf2,/dev/hdg1
[root@bigboy tmp]#


Here we export the screen output to create the configuration file.

[root@bigboy tmp]# mdadm --detail --scan --verbose > /etc/mdadm.conf
Check out this link where I found the above (it's pretty much doing everything you've done except for the part I've highlighted above):
http://www.linuxhomenetworking.com/w..._Software_RAID

Hope this solves your problem

Cheers
Yas

Last edited by alli_yas; 05-19-2010 at 08:52 AM.
 
Old 05-19-2010, 11:57 AM   #3
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707

Original Poster
Rep: Reputation: 55
Hi Yas,

You are simply awesome. It worked, I added /etc/mdadm.conf file.

Thanks a looot !!!
 
Old 05-20-2010, 02:04 AM   #4
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
No problemo

Mark the thread as SOLVED so that other peeps can use it as well
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Software raid1 missing md0 and md2 dbj Linux - Software 2 09-18-2009 02:53 AM
How To Clone Single Drive To Raid 1+0 (copy /dev/sde to /dev/md0)? alfista Linux - Server 5 03-18-2008 10:57 PM
using flash drive changes device /dev/sr0 to /dev/sr1 for mapping to /dev/pktcdvd/0? lugoteehalt Linux - Software 3 10-24-2007 10:27 AM
/dev/tty0, /dev/tty1, /dev/tty10...and so on...which should be used for a device ??? b0nd Slackware 2 04-02-2006 08:14 AM
difficulty sustaining configuration of printer using KDE 273chris Linux - Newbie 6 10-25-2004 07:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration