LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Raid is not working (https://www.linuxquestions.org/questions/fedora-35/raid-is-not-working-811736/)

mpr.mktg 06-02-2010 12:17 PM

Raid is not working
 
Dear Sir,

I am new to raid, I had my Linux server setup by some guy and now he is no more available.

When installation of Fedora 8 he has setup Raid by software, because my server dont have Raid 5 card.

Now problem is that main HDD is working okay and the another HDD I check by removing main HDD cable that it is working or not, but not working because it is not getting mirror by software.

Now how can I re-sync or mirror it back.

this is very important issue for my company, any urgent help in this will be highly appreciate.

DrLove73 06-02-2010 02:04 PM

Hi, welcome to LQ forums.

It all depends on how he has set up your system. And Fedora 8 is very old, so you will have problems with support.

Since you have no Linux experience, and this is business environment, I suggest you pay some professional to install you CentOS 5.5 and set it up all with RAID. You could also do that by buying new hardware/PC so you get more RAM, more storage room and system supported (fixes) for next couple of years. CentOS is free of pay RHEL.


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.

If you are not going to reinstall or swap your Fedora 8, then 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 ~]#


mpr.mktg 06-03-2010 05:49 AM

My Command achieved below result
 
[root@scitex ~]# cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md0 : active raid1 sdb1[0]
3068288 blocks [2/1] [U_]

md1 : active raid1 sdb3[0]
151685632 blocks [2/1] [U_]

unused devices: <none>
[root@scitex ~]#

============
fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9c069c06

Device Boot Start End Blocks Id System
/dev/sda1 * 1 382 3068383+ fd Linux raid autodetect
/dev/sda2 383 573 1534207+ 82 Linux swap / Solaris
/dev/sda3 574 19457 151685730 fd Linux raid autodetect

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000e6843

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 382 3068383+ fd Linux raid autodetect
/dev/sdb2 383 573 1534207+ 82 Linux swap / Solaris
/dev/sdb3 574 19457 151685730 fd Linux raid autodetect

Disk /dev/md1: 155.3 GB, 155326087168 bytes
2 heads, 4 sectors/track, 37921408 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

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

Disk /dev/md0: 3141 MB, 3141926912 bytes
2 heads, 4 sectors/track, 767072 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table
++++++++++++++++++++

so are this incorrect.

because when I unplugged mda1 (different hdd) than it works with mda0
but when i unplugged mda0 than it dosn't works that way.

so need help how can I replicate it.

thanks

alli_yas 06-03-2010 07:20 AM

My advice:

1. Get professional support - either RHEL or CentOS

2. Stop using such an old distro (Fedora 13 is now out)

3. Upgrade your hardware, software RAID is cool but for business continuity I recommend a hardware RAID controller.

DrLove73 06-04-2010 03:35 AM

First buy additional HDD and then seek professionals help. Either have him make a backup of your data, or you do it before you find a professional.

I am reluctant to advise since any error I make or you misunderstand or do not do correctly can make your server a unresponsive and destroy all of your data. And I am in no sense "expert" to be confident I will not make a mistake. I have done a replacement before when my HDD controller would power down one of my HDD's, but always very carefully and making sure I will not make a mistake.

That is why I will not post a single command for you to potentially destroy your data. Sorry, but this IS for your own good.


All times are GMT -5. The time now is 01:28 AM.