LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-24-2012, 10:58 PM   #1
pherako
LQ Newbie
 
Registered: May 2012
Location: Houston
Distribution: Debian
Posts: 4

Rep: Reputation: Disabled
trouble after partitioning with linux raid


I had for a long time a degradedArray /dev/md127 from a linux "divorce" 1.5TB drive,

/dev/sdc1

I recently picked up a 3TB disk and partitioned it to two 1.5TB partitions, sdb1/sdb2.

After partitioning and formatting (mkfs.ext3), I added sdb1 into the raid array, and moved a couple hundred gigs of data out of the array and into /dev/sdb2 (mounted in a directory inside md127, just to keep things confusing.

A single reboot later, and md127 does not show up. Even more, sdb1 and sdb2 dont show up either.
mdadm --assemble --scan found two unlinked arrays.

I think I have two problems, but possibly more.
1. Linux is not finding my partitions on sdb.
2. My mdadm.conf is empty, I don't know what to put in it.

Can anyone help me dig my head out of my ***?

---------- Post added 05-24-12 at 10:58 PM ----------

Here is some debugging info:
================================================================================
root@king:/# fdisk -l /dev/sdb

Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000f2982

Device Boot Start End Blocks Id System
/dev/sdb1 1 182402 1465144033+ 83 Linux
Partition 1 does not start on physical sector boundary.
/dev/sdb2 182403 364802 1465121792 83 Linux
root@king:/# fdisk -l /dev/sdc
================================================================================
Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000349c

Device Boot Start End Blocks Id System
/dev/sdc1 1 182401 1465136001 fd Linux raid autodetect
================================================================================
TestDisk 6.11, Data Recovery Utility, April 2009
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sdb - 3000 GB / 2794 GiB - CHS 364801 255 63
Partition Start End Size in sectors
P ext3 0 1 1 182400 252 59 2930271872
P Linux md 0.9 RAID 182400 81 18 364801 80 15 2930272000 [md126]
P ext3 182401 3 3 364801 66 1 2930259968
================================================================================
 
Old 05-25-2012, 07:47 AM   #2
gillbertiddio
Member
 
Registered: Sep 2009
Posts: 33

Rep: Reputation: 6
You may want to post the results of "cat /proc/mdstat" and "mdadm --detail --scan" as helpful "debugging info" for raid arrays. You may also want to use "code" tags to make reading posts easier.

What level is your raid? I am guessing 1 at this point. From the enformation posted I can see that your device you are attempting to add is not a type "fd" (Linux raid autodetect) partition its a type "83" (Linux) which is problematical - you must first create the array (done) and to add devices to the array you use mdadm THEN you format the array/array partition with mkfs. If at some point you did actually "add" /dev/sdb1 you may have a raid signature on it but it will never assemble correctly without the proper partition typing.

Maybe you should read tldp's howto or some other howto first on how to set up and add a device to an array.
 
Old 05-25-2012, 08:32 AM   #3
pherako
LQ Newbie
 
Registered: May 2012
Location: Houston
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks, I'll look into it.

Code:
root@king:/# mdadm --detail --scan
ARRAY /dev/md/127_0 metadata=0.90 UUID=408a49b3:05d96036:1a80cf78:7bc555ad

root@king:/# cat /proc/mdstat
Personalities : [raid1]
md127 : active raid1 sdc1[1]
      1465135936 blocks [2/1] [_U]

unused devices: <none>
 
Old 05-26-2012, 10:15 AM   #4
gillbertiddio
Member
 
Registered: Sep 2009
Posts: 33

Rep: Reputation: 6
Great. So reading your post you have a raid level 1 with a missing device so all you need to do is change your partition to type "FD", add it:

Quote:
4. Add a disk to an existing array

We can add a new disk to an array (replacing a failed one probably):
mdadm --add /dev/md0 /dev/sdb1
After it syncs yer in business. You can monitor resyncing via "read /proc/mdstat".
 
Old 06-02-2012, 05:39 PM   #5
pherako
LQ Newbie
 
Registered: May 2012
Location: Houston
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: Disabled
In between posts I've had some other hardware failures. But I got the system back up into a good state, so back to the data problem.

I went ahead and stopped all raid ops (mdadm --manage --stop /dev/md*).

Just trying to get the data back at this point. The old 1.5TB drive [sdc] decided to fail. There is a recently synced copy of all the data on sdb with the messed up partition table. I have tried changing the partition type to fd but cannot see any of the data. It appears there are 3 partitions. Perhaps md decided when it synced the drive to do something weird like write the partition between the two. Just to state the obvious, a 3TB drive can't physically contain 3 1.5TB partitions...

Code:
 
Disk /dev/sdc - 3000 GB / 2794 GiB - CHS 364801 255 63
     Partition               Start        End    Size in sectors
P ext3                     0   1  1 182400 252 59 2930271872
P Linux md 0.9 RAID    182400  81 18 364801  80 15 2930272000 [md126]
P ext3                 182401   3  3 364801  66  1 2930259968
Since I can't read md126 out with testdisk, is there a way to make mdadm manually pick @offset 182400?

Should I be concerned that this new drive is 4kb sectors and the old one was 512b?
 
Old 06-02-2012, 06:11 PM   #6
pherako
LQ Newbie
 
Registered: May 2012
Location: Houston
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: Disabled
As you can see, sdc contains a valid superblock. The crc claims to be ok.

Code:
root@king:/# mdadm --examine /dev/sdc
/dev/sdc:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 408a49b3:05d96036:1a80cf78:7bc555ad
  Creation Time : Tue Jan 12 07:28:19 2010
     Raid Level : raid1
  Used Dev Size : 1465135936 (1397.26 GiB 1500.30 GB)
     Array Size : 1465135936 (1397.26 GiB 1500.30 GB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 126

    Update Time : Thu May 24 17:14:48 2012
          State : clean
 Active Devices : 1
Working Devices : 1
 Failed Devices : 1
  Spare Devices : 0
       Checksum : 78401bde - correct
         Events : 384224


      Number   Major   Minor   RaidDevice State
this     0       8       16        0      active sync   /dev/sdb

   0     0       8       16        0      active sync   /dev/sdb
   1     1       0        0        1      faulty removed
However, the partition sdc1 seems to contain a bonk superblock
Code:
root@king:/# mdadm --examine /dev/sdc1
/dev/sdc1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 06e44dbb:283cc978:ad14177a:829baa08
           Name : king:0  (local to host king)
  Creation Time : Sat Jun  2 11:07:58 2012
     Raid Level : raid1
   Raid Devices : 1

 Avail Dev Size : 2930286019 (1397.27 GiB 1500.31 GB)
     Array Size : 2930285746 (1397.27 GiB 1500.31 GB)
  Used Dev Size : 2930285746 (1397.27 GiB 1500.31 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
          State : active
    Device UUID : e24b71df:58963288:436acdaf:202e6ee5

    Update Time : Sat Jun  2 11:07:58 2012
       Checksum : c136d03f - correct
         Events : 0


   Device Role : Active device 0
   Array State : A ('A' == active, '.' == missing)
root@king:/# mdadm --examine /dev/sdc2
mdadm: No md superblock detected on /dev/sdc2.
Code:
root@king:/# fdisk -l /dev/sdc

Disk /dev/sdc: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000f2982

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      182402  1465144033+  83  Linux
Partition 1 does not start on physical sector boundary.
/dev/sdc2          182403      364802  1465121792   83  Linux
Is there a way to repair the superblock so that it points to the correct region of the hdd as detected in testdisk?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Partitioning a RAID drive? djspits Linux - Newbie 1 11-19-2010 01:46 AM
Trouble installing SuSE Linux 10 on Dell XPS workstation with nForce Raid Janssen_J Linux - Hardware 1 01-12-2007 03:50 AM
Linux on Dell Axim - Trouble partitioning SD card cyberaxe Linux - Laptop and Netbook 3 08-11-2005 05:01 AM
Partitioning: Where to mount raid 0 musicman_ace Linux - Hardware 1 05-11-2004 05:34 PM
raid partitioning guest Linux - Newbie 1 03-15-2004 11:02 AM

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

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