LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Blogs > DrLove73
User Name
Password

Notices


Rate this Entry

About Linux software RAID - overview

Posted 06-02-2010 at 02:06 PM by DrLove73
Updated 06-02-2010 at 02:08 PM by DrLove73

Until not long ago, Linux was not able to boot from partitions under RAID. That meant that /boot partition can not be mirrored, but the rest of the data can. If that is how system was set-up, then all of the data was mirrored but there is no GRUB/boot setup on the spare HDD. You would need to copy data from /boot partition to "/boot2" (/boot partition on spare HDD) and install GRUB on spare HDD MBR. This can all be done from working system, no need to unplug anything.

You could buy IDE DiskOnModule (512MB is enough) or buy/use separate HDD (new or used) and use it just for boot partition. If done properly, separate HDD would always boot the fist visible HDD no matter which one it is.

Take notice that RAID1 mirroring is not so much to give you FAST HDD swap, but to preserve you data. When you need to replace the failed HDD, you need to initialize the new HDD so system will recognize it as a spare for failed HDD. This can be done before the actual HDD fail (you can buy spare HDD even when you buy active ones), initialize it and keep it disconnected for latter use.

When I wrote "HDD" in this text, this can also refer to separate partitions since Linux software RAID system can use separate partitions on same HDD's for separate RAID arrays. At the same time, first partitions can be in RAID1-mirroring for /root partition, second (swap) partitions on both HDD's can be in RAID0-stripping for faster speed, third again RAID1 for data safekeeping and fort partitions can be out of the RAID system for larger capacity (storing non-essential data like music, movies and already backuped data).


As for synchronization, Linux software RAID should keep automatic sync, as soon as you plug in again disconnected HDD.

To see if you have synced data, run this command:
Code:
cat /proc/mdstat
Output should be like this:
Code:
[root@kancelarija2 ~]# cat /proc/mdstat 
Personalities : [raid1] 
md2 : active raid1 sdb3[0] sda3[1]
      212347072 blocks [2/2] [UU]
      
md3 : active raid1 sdb2[1] sda2[0]
      31744320 blocks [2/2] [UU]
      
unused devices: <none>
[root@kancelarija2 ~]#
To show an example of different RAID systems on the same Linux system, compare all of my partitions with members above RAID partitions (md2=sdb3,sda3; md3=sdb2,sda3):
Code:
[root@kancelarija2 ~]# fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        3965    31744440   fd  Linux raid autodetect
/dev/sda3            3966       30401   212347170   fd  Linux raid autodetect

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   83  Linux
/dev/sdb2              14        3965    31744440   fd  Linux raid autodetect
/dev/sdb3            3966       30401   212347170   fd  Linux raid autodetect

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1          13      104391   83  Linux
/dev/sdc2              14       30407   244139805   83  Linux
/dev/sdc3           30408       60801   244139805    5  Extended
/dev/sdc5           30408       60801   244139773+  83  Linux

Disk /dev/md3: 32.5 GB, 32506183680 bytes
2 heads, 4 sectors/track, 7936080 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md3 doesn't contain a valid partition table

Disk /dev/md2: 217.4 GB, 217443401728 bytes
2 heads, 4 sectors/track, 53086768 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md2 doesn't contain a valid partition table
[root@kancelarija2 ~]#
Posted in Uncategorized
Views 1085 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 11:40 AM.

Main Menu
Advertisement
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