LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-31-2007, 01:17 PM   #1
isync
Member
 
Registered: Feb 2007
Posts: 32

Rep: Reputation: 15
SoftwareRaid1 (mdadm) and LVM setup. Working, but is it ok?


Hi there!

I have setup a two disk software raid on my amd64 machine running ubuntu 6.06.
I have plugged in the two sata disks right out of the box and they were recognized by the system after boot as sdb and sdc.

After that I started building the software raid 1 array:
sudo mdadm --create /dev/md0 -a -l 1 -n 2 /dev/sdb /dev/sdc

then on with lvm:
sudo pvcreate /dev/md0
sudo vgcreate datavg /dev/md0
sudo lvcreate -L 250G -n somelv datavg
sudo mkfs.ext3 /dev/datavg/somelv

after that I mounted the array successfully. But when I call up the ubuntu disk manager application it shows no info about the lvm or md0 disk. Is that normal? sdb and sdc are identified as "nopartition or partition not readable"...

And an fdisk -l /dev/md0 for the array notes "Disk /dev/md0 doesn't contain a valid partition table". And inspecting the beast with gparted also indentifies /sdb and /sdc as not partitioned(greyed) drives. But gparted also lists /dev/mapper/datavg/somelv1 with correct sizes but an warning symbol beneath the entry saying I havent the right plugin installed.

Now- is my md0/lvm beast alive and save to use or did I do something wrong?
 
Old 05-31-2007, 02:27 PM   #2
wendea
Member
 
Registered: Mar 2007
Distribution: Fedora
Posts: 81

Rep: Reputation: 15
Try testing it and unplug one harddrive while comp is running and see if the raid kicks in
 
Old 05-31-2007, 03:39 PM   #3
isync
Member
 
Registered: Feb 2007
Posts: 32

Original Poster
Rep: Reputation: 15
Ok, I opened the box and pulled the power plug on drive /sdc
After that I could continue accessing data. Which I did: I deleted a file on the array (in fact only disc /sdb)

Then I powered the drive up again and the following commands gave these outputs:
$ cat /proc/mdstat
Code:
  Personalities : [raid1]
  md0 : active raid1 sdb[0] sdc[2](F)
      488386496 blocks [2/1] [U_]

  unused devices: <none>
$ sudo mdadm --detail /dev/md0
Code:
  /dev/md0:
        Version : 00.90.03
  Creation Time : Thu May 31 14:53:39 2007
       Raid Level : raid1
       Array Size : somedata
      Device Size : somedata
     Raid Devices : 2
    Total Devices : 2
  Preferred Minor : 0
      Persistence : Superblock is persistent

    Update Time : Thu May 31 22:22:13 2007
          State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 1
  Spare Devices : 0

           UUID : somedata
         Events : 0.81

    Number   Major   Minor   RaidDevice State
       0       8       16        0      active sync   /dev/sdb
       1       0        0        -      removed

       2       8       32        -      faulty   /dev/sdc
Does this seem right?? Is my raid working??

But now, after the test, how do I resync the array? It does not seem to detect by itself that both drives are online again...
$ sudo mdadm --assemble -U resync /dev/md0
sais: "mdadm: /dev/md0 not identified in config file."

My config file (about which I learned here: http://www.devil-linux.org/documenta...x/ch01s05.html) is empty...
 
Old 05-31-2007, 03:41 PM   #4
wendea
Member
 
Registered: Mar 2007
Distribution: Fedora
Posts: 81

Rep: Reputation: 15
That looks right now all you have to do is run the raid script again

mkraid -R etc.... and it should be running
 
Old 05-31-2007, 04:14 PM   #5
isync
Member
 
Registered: Feb 2007
Posts: 32

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by wendea
That looks right now all you have to do is run the raid script again

mkraid -R etc.... and it should be running
Easier said than done...
As I said, running ubuntu, "mkraid anything" gives me "bash: mkraid: command not found"
And being not a raid-pro, I do actually not know what you mean with "running the raid script etc"...

Can you talk me through?
 
Old 06-01-2007, 04:26 AM   #6
isync
Member
 
Registered: Feb 2007
Posts: 32

Original Poster
Rep: Reputation: 15
How do I get my raid resync'ed / working again??

Anyone?

How do I run "the raid script" again on ubuntu?

I tried:
$ sudo mdadm --assemble --update=resync /dev/sdc
Code:
mdadm: /dev/sdc does not appear to be an md device
do I need to use the "--force" option (to hook-in /dev/sdc as if I changed it for a new one?)

Reminds me a bit of the status I described earlier - that gparted still identifies drive /dev/sdb and /dev/sdc as unpartitioned...

Last edited by isync; 06-01-2007 at 05:14 AM.
 
Old 07-16-2008, 08:02 PM   #7
iseeuu
LQ Newbie
 
Registered: Jun 2007
Location: Missouri, USA
Distribution: Debian / Ubuntu / Slackware
Posts: 22

Rep: Reputation: 15
Quote:
Originally Posted by isync View Post
$ sudo mdadm --assemble --update=resync /dev/sdc
mdadm: /dev/sdc does not appear to be an md device
By posting here, I am telling on myself. I hope this will save someone else the hours of frustration I endured. What is most embarrassing is this is the second time I had to figure this out:

The simple solution to the mdadm error above, ie - does not appear to be an md device - is that between --update=resync and /dev/sdc the "md device" ie: /dev/md0 or /dev/md1 etc, is missing. Since /dev/sdc is not a "md device", the code returns the error.

Dogh!

:})
 
Old 05-17-2011, 08:48 PM   #8
bobpaul
LQ Newbie
 
Registered: Aug 2005
Posts: 14

Rep: Reputation: 0
You need to give mdadm a raid device when using manage. So

Code:
mdadm --manage /dev/md0 --add /dev/sdc
I did the same thing for about 15 minutes here. madam --manage --help doesn't indicate this is the case. Of course it's in man mdadm.
 
  


Reply

Tags
amd64, disk, fileserver, lvm, md0, raid, ubuntu, volume



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
New OS with a already setup LVM sendas Linux - Software 1 11-23-2006 06:10 PM
LVM + MDADM...help carve81 Debian 2 08-25-2006 03:17 AM
Growing RAID5 with mdadm not working in 2.6.17? Fredde87 Linux - Software 1 08-24-2006 03:45 AM
mdadm (get my array working again) dadriver Linux - Software 1 01-20-2006 06:56 PM
help me setup software raid 1 on slackware with mdadm xrado Slackware 2 03-02-2005 05:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:03 PM.

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