LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-17-2008, 03:22 PM   #1
javaholic
LQ Newbie
 
Registered: Jun 2007
Posts: 25

Rep: Reputation: 15
[sorted]rebuilding a raid5 array for file server.


I have come to a point where i may need to reinstall debian 4.11 hosting a samba and file server with a 1.8TB raid 5 setup. I would normally be happy to just install on the operating system disk a 4.3GB drive. I would like to be able to make sure that i don't harm this raid5 with the reinstalling of debian and or if a better restore rebuild of debian is possible or which method/methods would be best suited to making sure i keep this raid5 and its data intact with minimum upset. I would get really upset if i lost this data.

debian installed on 4.3GB drive.

two 200Gb drives for /home and /var/www

and three 1TB drives for software raid5 using MD with drive named md0.

Any ideas on what to do or what you would do would be greatly appreciated. How can i avoid this situation in the future. This all came about because i restarted computer using the reset button on case.

i have already rewritten /etc/inittab which i had lost completely.

Last edited by javaholic; 04-21-2008 at 09:02 AM. Reason: sorted
 
Old 04-18-2008, 06:40 PM   #2
cdbunch
LQ Newbie
 
Registered: Mar 2008
Posts: 13

Rep: Reputation: 0
I don't know about reinstall options for debian. I have not done that. But it does not seem like this should not be a big problem. If you save a copy of your /etc/mdadm.conf file which should specify the set up info for the RAID array and restore it after you restore the OS the array should come up with the same configuration as long as the devices it is built from still have the same device names. mdadm --assemble option should be able to re-assemble the array if there were a problem.

If you do not have mdadm.conf you can generate the info needed for it with:

mdadm --detail --scan

You might also want to run:

mdadm --examine /dev/xxx

for each of the drives that are members of the array and keep that information handy. If you are really paranoid you could disconnect the array drives while you rebuild the OS to avoid any possibility of them getting damaged and reconnect them after you are satisfied that everything is ok.

The following link is a little old but still has good info on mdadm that you might find useful:

http://www.networknewz.com/2003/0113.html

Cameron Bunch
 
Old 04-19-2008, 08:02 AM   #3
javaholic
LQ Newbie
 
Registered: Jun 2007
Posts: 25

Original Poster
Rep: Reputation: 15
Does the follow contents look about right?

Code:
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
DEVICE partitions

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays
DEVICE /dev/sd??*
ARRAY /dev/md0 auto=yes level=raid5 num-devices=3 UUID=7e2fc55c:b3416bf4:7b403d38:22f8ac8c

# This file was auto-generated on Thu, 22 Nov 2007 10:32:43 +0000
# by mkconf $Id: mkconf 261 2006-11-09 13:32:35Z madduck $


you mentioned how to restore my array am i right in thinking i need to the following: with mdadm intact replacing one i get by installing md again after restart?

am i right?
 
Old 04-19-2008, 10:38 AM   #4
cdbunch
LQ Newbie
 
Registered: Mar 2008
Posts: 13

Rep: Reputation: 0
Your mdadm.conf looks ok. Be sure that the specification of the disks that are members of the array (DEVICE /dev/sd??*) does refer to correct disks. It should already but it never hurts to check.

After you re-install the OS (I assume that is what you intend to do) you should be able to copy this mdadm.conf into your new /etc and the array should be automatically assembled at boot up. You will have to put the appropriate entry in fstab to get the array mounted at boot. You might want to copy the entry you currently have to update your new fstab being sure you have the same mount point in the new system.

I would try first just copying the mdadm.conf into place and rebooting. Then check the output of:

cat /proc/mdstat

to see if the array has been recognized. If so you should be able to mount /dev/md0 to the appropriate mount point (manually or via fstab) and things should be good.

If the automatic mount does not work you can test if mdadm can manually assemble the array. In any event doing all of this should not negatively impact the array or its data if the drives are intact. Avoid using mdadm to create a new array using these same disks. That could be necessary but can also cause some problems you do not want to have to deal with.

Cameron Bunch
 
Old 04-19-2008, 11:59 AM   #5
cdbunch
LQ Newbie
 
Registered: Mar 2008
Posts: 13

Rep: Reputation: 0
One other thing that might be the case for Debian:

Is your mdadm.conf in /etc/ or /etc/mdadm/ ?

It will need to be in the right directory.
 
Old 04-21-2008, 09:01 AM   #6
javaholic
LQ Newbie
 
Registered: Jun 2007
Posts: 25

Original Poster
Rep: Reputation: 15
thanks guys you have been a great help.
 
  


Reply

Tags
mdadm, raid


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
rebuilding RAID5 array logical volumes yello Linux - Server 0 11-21-2007 04:50 PM
Removed RAID5 array and now no boot Child of Wonder Ubuntu 2 07-27-2007 09:58 PM
RAID5 Array Recovery after OS upgrade hazmatt20 Linux - Server 25 04-19-2007 08:41 AM
rebuilding a drive kicked from RAID1 array ocularbob Linux - Software 1 02-12-2007 10:12 PM
Secure Deletion with RAID5 array neilschelly Linux - Security 2 12-05-2004 06:25 PM


All times are GMT -5. The time now is 06:44 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration