LinuxQuestions.org
Review your favorite Linux distribution.
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 10-29-2006, 07:03 AM   #1
eRJe
Member
 
Registered: May 2005
Location: Netherlands
Distribution: Slackware 14.1 Kernel 3.12.1
Posts: 103

Rep: Reputation: 16
understanding RAID


Hello all,

OK, i'm trying to keep this as short and less boring as possible...

I know there are tons on HOW-TO's threads about getting a RAID configuration. But...


I created with lots of help a JBOD RAID config with two 320gb SATA drives connected to the SATA1 and SATA2 connectors on the MB. They show up as sda and sdb. /etc/raidtab looks like this:

raiddev /dev/md0
raid-level linear
chunk-size 128
persistent-superblock 1
nr-raid-disks 2
device /dev/sda1
raid-disk 0
device /dev/sdb1
raid-disk 1

This is/was working until I decided this wasn’t enough capacity for me. I wanted to swap them with two 500gb SATA drives. But first I needed to copy all data before taking the 320gb drives out. To do this I started creating a second JBOD RAID config with the two 500gb drives connected to SATA3 and SATA4 on the MB. These drives show up as sdc and scd. I did all the necessary things to config the second RAID and changed the /ect/raidtab to:

raiddev /dev/md0
raid-level linear
chunk-size 128
persistent-superblock 1
nr-raid-disks 2
device /dev/sda1
raid-disk 0
device /dev/sdb1
raid-disk 1

raiddev /dev/md1
raid-level linear
chunk-size 128
persistent-superblock 1
nr-raid-disks 2
device /dev/sdc1
raid-disk 0
device /dev/sdd1
raid-disk 1

But when I did mkreiserfs /dev/md1 I ereased the first (Md0) RAID configuration! In other words I lost all my data! Luckily I was able to get most of it back with:

reiserfsck --rebuild-tree -S -l /root/recovery.log /dev/md0

I now disconnected the recovered RAID (md0) drives and connected the 500gb drives to SATA1 and SATA2, the showed up as sda and sdb, configured the JBOD RAID (md0) and formatted with reiserfs. Now I wanted to connect the old 320gb drives to SATA3 and SATA4 (sdc and sdd) and config them as md1. But after rebooting, the 320gb drives didn’t show up as sdc and sdd but as sda and sdb. And because the /etc/raidtab had md0 configured with sda1 and sdb1, the old RAID configuration showed up with the recovered data?!?

Today I borrowed an empty 320gb SATA drive, disconnected the 500gb drives, connected the empty 320gb drive to SATA1 (sda), kept the two 320gb drives as RAID connected to SATA3 and SATA4 (sdc and sdd), partitioned, formatted and mounted the empty 320gb drive and copied all my data from the RAID to it. So my data is save!

I still don’t understand how md0 could be mounted even though the drives showup as sdc1 and sdd1 instead of sda1 and sdb1. What does /etc/raidtab do? Do drives hold all the necessary information about the RAID configuration and is raidtab just for the owners interest?

Well if anyone can make sense of this story… I would really like to know what happened.

Cheerz,
Robbert
 
Old 10-29-2006, 08:47 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
From the Software-Raid-howto document on www.tldp.org:
Quote:
5.9 The Persistent Superblock
Back in "The Good Old Days" (TM), the raidtools would read your /etc/raidtab file, and then initialize
the array. However, this would require that the filesystem on which /etc/raidtab resided was mounted.
This is unfortunate if you want to boot on a RAID.
Also, the old approach led to complications when mounting filesystems on RAID devices. They could not be
put in the /etc/fstab file as usual, but would have to be mounted from the init−scripts.
The persistent superblocks solve these problems. When an array is initialized with the persistent−superblock option in the /etc/raidtab file, a special superblock is written in the beginning of all disks participating in the array. This allows the kernel to read the configuration of RAID devices directly from the disks involved, instead of reading from some configuration file that may not be available at all times.
You should however still maintain a consistent /etc/raidtab file, since you may need this file for later
reconstruction of the array.
The persistent superblock is mandatory if you want auto−detection of your RAID devices upon system boot.
This is described in the Autodetection section.

Last edited by jschiwal; 11-02-2006 at 07:01 PM.
 
Old 11-03-2006, 04:15 AM   #3
eRJe
Member
 
Registered: May 2005
Location: Netherlands
Distribution: Slackware 14.1 Kernel 3.12.1
Posts: 103

Original Poster
Rep: Reputation: 16
Thanks for your reply! I'll keep that one in my bookmarks!
 
  


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
help understanding RAID readouts DJCF Linux - Hardware 0 03-03-2006 08:50 AM
A better understanding! nny0000 Slackware 1 04-14-2004 12:01 PM
Understanding X?? ++ bdp Linux - General 2 02-25-2004 05:47 PM
Understanding X?? nny0000 Linux - General 2 02-25-2004 02:07 AM
Understanding df -k itsjustme Linux - General 6 10-28-2003 12:08 PM

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

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