Link to home
Start Free TrialLog in
Avatar of socom1985
socom1985

asked on

Software RAID 5

We have an existing raid 5 from a snap nas server which brock down that we must connect with ubuntu. In this server we have only a raid controller for raid 1,2. So we have to make a software raid. We can see all the discs but not the partitions.
Is it possible to connect this raid 5 with ubuntu without losing data?
How can we do that?
Avatar of bummerlord
bummerlord
Flag of Sweden image

I know nothing about the "snap nas server" in this case, but if it is built around linux and utilizes software raid 5 inside, then your chances increase.

If the "snap nas server" used a hardware raid controller you are not likely (not without writing drivers to emulate the controller anyway) going to be able to read the data using software raid.

What more can you tell us about the original "snap nas server" setup?
Avatar of socom1985
socom1985

ASKER

Snap server is a nas type server with linux. Im not completly sure but I think the raid 5 was also handled by linux on the server. How can add the array to ubuntu?
Do you have the disks attached to the ubuntu server already?
Try this command (as the root user):

mdadm --examine --scan

Open in new window


It should list the arrays you have attached (if recognized) in a format suitable for adding to /etc/mdadm.conf

Then to start the array you can do:
mdadm --assemble --scan

Open in new window


edit: this is not specific to Ubuntu, and there may be ways to achieve the same using a GUI of some sort. I'm not using Ubuntu myself though.
The disks are attached to ubuntu.

The first command returns: No devices to examine
??
(assuming you have restarted the server since attaching the disks) there is nothing more I can suggest on this approach unfortunately.
After reboot we could see the arrays and attend them to the mdadm conf file and also the second command seems to work but where can we find the disk now?
oh.. great.
Let's see the output from
# cat /proc/mdstat

In the rightmost column you will see the meta device name
e.g md0

You will have a corresponding device file as /dev/md0

If the snap nas created a file system ontop of this device then you can mount it as is..
e.g mount /dev/md0 /mountpoint

If on the other hand there is logical volumes defined on this device you may need to activate them.
If the md device is shown when you run "pvscan" then this is probably the case. More about that later if necessary.
For the first command we have this output (# cat /proc/mdstat)

Personalities : [raid1] [raid6] [raid5] [raid4]
md0 : inactive sde4[1] sdc4[2] sdd4[0] sdb4[3]
      1949109760 blocks super 0.91
     
md101 : active raid1 sde5[1] sdd5[0] sdc5[2] sdb5[3]
      273024 blocks [4/4] [UUUU]
     
md100 : active raid1 sde2[1] sdd2[0] sdc2[2] sdb2[3]
      819200 blocks [4/4] [UUUU]

second comman we have this output

can't read superblock :(


Some additional information..

administrator@snapserver:/etc$ sudo mdadm -D /dev/md0
/dev/md0:
        Version : 0.91
  Creation Time : Tue Feb 20 13:07:19 2007
     Raid Level : raid5
  Used Dev Size : 487277440 (464.70 GiB 498.97 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Sun Feb  5 21:50:36 2012
          State : active, Not Started
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

      New Level : raid0
  New Chunksize : 0K

           UUID : 8c4707de:35781ade:d371f49d:65ac14b1
         Events : 0.26137743

    Number   Major   Minor   RaidDevice State
       0       8       52        0      active sync   /dev/sdd4
       1       8       68        1      active sync   /dev/sde4
       2       8       36        2      active sync   /dev/sdc4
       3       8       20        3      active sync   /dev/sdb4
The array was not started it seems (may need entries in mdadm.conf for that to happen - not sure)

Try
# mdadm --run /dev/md0
mdadm: failed to run array /dev/md0: Invalid argument

am I missing something?
I also tried this:

 sudo mdadm --assemble /dev/md0 /dev/sdd4 /dev/sde4 /dev/sdc4 /dev/sdb4
mdadm: Failed to restore critical section for reshape, sorry.
      Possibly you needed to specify the --backup-file
ASKER CERTIFIED SOLUTION
Avatar of bummerlord
bummerlord
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial