LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 06-08-2010, 10:51 PM   #1
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Rep: Reputation: 15
Question mdadm RAID 0 Recovery?


Hi,

I have this problem that my system (it's not mine actually, I'm not the one who installed it but the one who should recover it) and it has two SATA disks that was configured as a RAID 0 using software RAID.

The person who installed said he RAID-ed it using webmin so I assume that was mdadm. Okay, so yesterday suddenly one of the drive is 'dead'.. it became undetected in BIOS and I can't boot to the system (Centos 5.3).

Is it possible to recover the disk / array? Because all I know RAID 0 doesn't have any 'mirroring' but I am sure that the second disk is in a good shape.

I tried to mounted the second drive using Ubuntu livecd but it said wrong fs type. I tried ext3. Perhaps it is a software raid file system. If that so, how could I possibly read the files inside it?

Thanks.
 
Old 06-09-2010, 12:44 AM   #2
Jerre Cope
Member
 
Registered: Oct 2003
Location: Texas (central)
Distribution: ubuntu,Slackware,knoppix
Posts: 323

Rep: Reputation: 37
You'll want to mount /dev/md0, not /dev/sda1 (md0 and sda1 being generic examples)

It sounds like grub was not set on both drives, so that when one drive failed, the other had no boot record.

You can probably boot off a live CD, mount the drive and fix the grub.

The following was taken from

http://www.texsoft.it/index.php?c=ha...grubraid1&l=it

and shows how to set the grub on both physical drives.



Quote:
# grub

GNU GRUB version 0.95 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]

grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 15 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/boot/grub/stage2
/boot/grub/grub.conf"... succeeded
Done.

grub> root (hd1,0)
Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd1)"... 15 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+15 p (hd1,0)/boot/grub/stage2
/boot/grub/grub.conf"... succeeded
Done.

grub> quit
Use mdadm to examine the array and add the new drive to the array.
 
Old 06-09-2010, 01:09 AM   #3
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 727

Rep: Reputation: 75
Hello.

RAID0 stores literally half of every piece of data on each drive, and accesses both places simultaneously in order to put the data back together in memory and make it usable. This increases both the practical speed of the volume, and makes it twice as large. The problem is that since each piece of data is split up and dispersed over two drives, if one of the drives fails, the rest of the data is unrecoverable (unless you manage to somehow get the other drive working again).

If the drive doesn't show up in BIOS, it's probably the circuit board on the hard drive that is bad. It could also be a mechanical problem. Either way, it requires one to replace the damaged/unusable parts. So far as I know, a clean room (dust-free workshop) is required to fix anything that would expose the platters to the outside air (such as taking screws out of the hard drive and opening it up). There are professional companies that can do this for you, but it's VERY expensive (over a thousand dollars, usually). I've also seen instructions online for making a homemade, inexpensive clean room-like environment for doing this type of work. I'm not sure how effective or expensive the latter is.

Sorry to be the bearer of bad news! I hope what I've written helps at least a little.

--Dane
 
Old 06-09-2010, 01:13 AM   #4
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 727

Rep: Reputation: 75
Edit: @Jerre Cope: the original poster indicated that this a RAID0 (stripe) configuration, whereas the instructions you gave are for RAID1 (mirror). The information is good, and would would work on the right setup, but unfortunately it won't help the OP. Sorry!
 
Old 06-09-2010, 03:15 AM   #5
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Original Poster
Rep: Reputation: 15
@Jerre Cope
I've tried using LiveCD but no md drives shown at all. It only displayed a /dev/sda1 and /dev/sda2 in the Ubuntu live CD and I cannot mounted it because of the wrong fs type.

@DaneM
Yes let's say that we wouldn't want to restore the data in the first hard drive because of the price.

What I want to know is whether the data in the disk 2 could be saved or not.
In other words, could the RAID 0 data in the disk2 be read in any ways?

Thanks for the input Sirs
 
Old 06-09-2010, 03:31 AM   #6
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 727

Rep: Reputation: 75
romeo_tango,

Because the working drive only contains half of every block written to the array, the data on that drive is completely useless and unrecoverable. Please note that what you have is NOT "the first half" or "the second half" of the data, but rather it is a disk of nothing but half-pieces of the data. (It's like reading an entire book, but having only half of each word in the book - unintelligible.)

The jist of it is that unless you can get the failed drive to work again (including keeping the filesystem and data intact), the data on the remaining drive is effectively unreadable.

Sorry!

--Dane
 
Old 06-09-2010, 04:26 AM   #7
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Original Poster
Rep: Reputation: 15
Ah okay then.
Lucky us to have backup although we still loss 3 days data.

Thanks a lot Sir.
 
Old 06-09-2010, 09:05 AM   #8
strick1226
Member
 
Registered: Feb 2005
Distribution: CentOS, Fedora, OS X, SLES, Ubuntu
Posts: 273

Rep: Reputation: 51
I can't really add much to DaneM's explanations here but, if you're already going to be rebuilding the server from scratch and then restoring the data, I definitely recommend using a RAID 1 mirror if at all possible... just in case you have another drive failure in the future.

Good luck!
 
Old 06-09-2010, 09:14 AM   #9
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 727

Rep: Reputation: 75
Good call, strick1226!

If you need more space than a single drive can allow, you should also look into RAID0+1 (a mirrored stripe), or RAID5 (a stripe with parity that allows you to rebuild the array if only 1 drive fails). RAID6 is like a beefier version of RAID5 that still works if 2 drives fail, and allows you to have even bigger arrays. Cost-wise, RAID5 is probably your best option. (You get to use the space on all but one drive; RAID6 requires 2 extra drives, and RAID0+1 requires twice the number of drives that you want to actually use.)
 
Old 06-09-2010, 11:43 PM   #10
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Original Poster
Rep: Reputation: 15
Well this might be already out of topic, but I wondered.. I always setup my servers using RAID1 but it was also always on branded servers such as IBM and DELL which support hot-swap. I remembered once experienced the disk broken and we just simply swap it.

My question is if you were using a software RAID such as mdadm in RAID 1 and the disk is not hot-swappable, do we use the same way to restore the disk? I mean by simply just turning the machine off and replace the broken drive and then turn on the power? Does it worked that way?

Thanks.
 
Old 06-10-2010, 01:23 PM   #11
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 727

Rep: Reputation: 75
Yes, to my knowledge, it does work that way.
 
Old 06-10-2010, 08:19 PM   #12
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Original Poster
Rep: Reputation: 15
alright then. Thanks again
 
  


Reply


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
Software Raid 5 (md) recovery using mdadm fakeroot Linux - Server 24 04-15-2013 09:19 AM
Raid 5 - mdadm - superblock recovery - please help! pasha_suse Linux - Server 3 06-11-2010 01:42 PM
mdadm raid 5 recovery / reassemble Ciesko Linux - Server 1 04-15-2010 12:53 PM
mdadm: no such device: md0 -- RAID doesn't work after system recovery jlinkels Linux - Server 1 11-30-2009 08:14 PM
mdadm RAID 5, 6 disks failed. recovery possible? ufmale Linux - Server 10 10-20-2008 08:24 AM


All times are GMT -5. The time now is 05:41 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