LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 07-23-2007, 01:54 AM   #1
ravinandans
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Rep: Reputation: 0
Problem in re-creating RAID-1 array


Hello Folks,

I'm having problem in re-creating RAID-1 array.

Here is the background to my problem.
(Sorry it's bit long)
I had two scsi disks with raid-1 setup on them.
I replaced them with new ones.

Before adding to RAID-1 array I formatted them.
mkfs.ext3 /dev/sdb
mkfs.ext3 /dev/sdc

After which I created partitions on them.(intermediate commands excluded)
'fdisk /dev/sdb' to create /dev/sdb1.
'fdisk /dev/sdc' to create /dev/sdc1.

After removing old scsi disks, I had accidentally deleted /dev/md0.
So I had to recreate it once again.

mdadm --create -a /dev/md0 --level=raid1 --raid-devices=2 /dev/sdb1 /dev/sdc1
'-a' option created /dev/md0 for me.

Now the problem is
#mdadm --query /dev/md0
Line1 excluded(Sorry I'm not sitting on the same machine)
/dev/md0: No md super block found, not an md component.

#mdadm --examine /dev/md0
mdadm: No super block found on /dev/md0

And the strange thing is RAID-1 is working fine.
'cat /proc/mdstat' gives out normal messages.

So when I restart the system, mounting of /dev/md0 fails saying super block number is invalid and it is expecting ext2 file system.

The matter is quite urgent so any help is welcome.

Thank you,
Ravinandan
 
Old 07-23-2007, 02:45 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Did you create a filesystem on /dev/md0?

mkfs -t ext3 /dev/md0

... or something...
 
Old 07-23-2007, 03:57 AM   #3
ravinandans
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Original Poster
Rep: Reputation: 0
No..I have not run that command.

One silly doubt.
Should I run this command before adding the scsi disk to array or after adding the scsi disks.

There is already data written on this disks.
I stopped the RAID array and then tried to run this command.
Here is what I got.

#umount /dev/md0
#mdadm -S

#mkfs -t ext3 /dev/md0
mkfs.ext3: Device size reported to be zero. Invalid partition specified, or partition table wasn't reread after running fdisk, due to a modified partition being busy and in use. You may need to reboot to re-read your partition table.

Please suggest how should I proceed...

Ravinandan
 
Old 07-23-2007, 04:26 AM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
There is already data written on this disks.
... that's a problem. mkfs will overwrite that data. Good thing it didn't work.

#mkfs -t ext3 /dev/md0
mkfs.ext3: Device size reported to be zero
... looks like you need to add the drives to md0.

# cat /proc/mdstat
... explicitly remove anything that shouldn't be there. (mdadmin -r)

This is just md0 of a RAID1 that is being rebuilt right? You want to mirror partitions on the existing drive to the new one and their geometery is identical and everything?

So the trick is to try adding the mirror partitions like normal:

$ sudo mdadm -a /dev/md0 /dev/sda1
$ sudo mdadm -a /dev/md0 /dev/sdb1
$ sudo mdadm -a /dev/md1 /dev/sdb2
... etc

http://www.heronforge.net/redhat/node14.html
 
Old 07-23-2007, 09:29 AM   #5
ravinandans
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Original Poster
Rep: Reputation: 0
>So the trick is to try adding the mirror partitions like normal:
This is where the problem started.
After removing the failed disk with a new one, I added it to the raid array.
Unfortunately the resync(mirroring) failed at 34% due to I/O read error from the old scsi disk.
resync was restarted automatically but kept failing at 34%.

So I just copied all the files from old scsi disk thru 'cp' command in preserve mode.
Removed the old scsi disk and added a new one.

Now I recreated the RAID-1 array.
mdadm --create -a /dev/md0 --level=raid1 --raid-devices=2 /dev/sdb1 /dev/sdc1

The sync was successful.

But the only problem is I can't reboot since /dev/md0 has different magic number.

I'm going to rebuild the RAID from scratch I hope that will solve the problem.

Ravinandan
 
Old 07-24-2007, 02:46 AM   #6
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Yep... that'll do it.
 
  


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
problem installing Fedora 7 on existing nvidia raid 5 array cbann Fedora - Installation 0 06-04-2007 12:45 PM
* sriley problem creating RAID partitions Steve Riley Linux - General 2 05-29-2007 07:40 AM
Problem with superblock when creating a software raid 5 array halfjack Linux - Server 0 10-18-2006 08:06 AM
Problem with bad inodes on Raid 1 Array abefroman Linux - Hardware 1 08-13-2006 06:08 AM
Problem Accessing Large RAID Array FlyingPenguin128 Debian 1 05-16-2005 10:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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

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