Very confused about RAID 1

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Charles_cz
Level 1
Level 1
Posts: 11
Joined: Thu May 08, 2014 9:29 am

Very confused about RAID 1

Post by Charles_cz » Sun Jun 08, 2014 10:40 am

Hi guys,
I thought simple that simple task like creating RAID array would be matter of minutes.. I've got to the point that I am not sure what is going on.
I have created RAID 1 as /dev/md0 from 2x 2TB drives.

What are these devices I see listed bellow after creating the RAID array? :oops: Also see the screen shot. Can someone help me with this, what looks like mess to me ? Please...

Thanks Charles

Device Boot Start End Blocks Id System
/dev/md0p1 ? 6579571 1924427647 958924038+ 70 DiskSecure Multi-Boot
Partition 1 does not start on physical sector boundary.
/dev/md0p2 ? 1953251627 3771827541 909287957+ 43 Unknown
Partition 2 does not start on physical sector boundary.
/dev/md0p3 ? 225735265 225735274 5 72 Unknown
Partition 3 does not start on physical sector boundary.
/dev/md0p4 2642411520 2642463409 25945 0 Empty


Here is how I created the RAID array

Code: Select all

charles@Charles-desktop ~ $ sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1 
[sudo] password for charles: 
mdadm: /dev/sdc1 appears to be part of a raid array:
    level=raid0 devices=0 ctime=Wed Dec 31 18:00:00 1969
mdadm: partition table exists on /dev/sdc1 but will be lost or
       meaningless after creating array
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
mdadm: /dev/sdd1 appears to be part of a raid array:
    level=raid0 devices=0 ctime=Wed Dec 31 18:00:00 1969
mdadm: partition table exists on /dev/sdd1 but will be lost or
       meaningless after creating array
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
charles@Charles-desktop ~ $ sudo mdadm --detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Sun Jun  8 09:28:46 2014
     Raid Level : raid1
     Array Size : 1953382208 (1862.89 GiB 2000.26 GB)
  Used Dev Size : 1953382208 (1862.89 GiB 2000.26 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Sun Jun  8 09:28:46 2014
          State : clean, resyncing 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

  Resync Status : 0% complete

           Name : Charles-desktop:0  (local to host Charles-desktop)
           UUID : 3dce25b3:cce121bf:d4fefa67:965f9c39
         Events : 0

    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       1       8       49        1      active sync   /dev/sdd1
charles@Charles-desktop ~ $ 
Now here is what I can see after fdisk -l

Code: Select all

charles@Charles-desktop ~ $ sudo fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000816e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   454998015   227497984   83  Linux
/dev/sda2       455000062   488396799    16698369    5  Extended
/dev/sda5       455000064   488396799    16698368   82  Linux swap / Solaris

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x82e682e6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63   234441647   117220792+   7  HPFS/NTFS/exFAT

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1  3907029167  1953514583+  ee  GPT
Partition 1 does not start on physical sector boundary.

WARNING: GPT (GUID Partition Table) detected on '/dev/sdd'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1  3907029167  1953514583+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/md0: 2000.3 GB, 2000263380992 bytes
2 heads, 4 sectors/track, 488345552 cylinders, total 3906764416 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x2052474d

This doesn't look like a partition table
Probably you selected the wrong device.

    Device Boot      Start         End      Blocks   Id  System
/dev/md0p1   ?     6579571  1924427647   958924038+  70  DiskSecure Multi-Boot
Partition 1 does not start on physical sector boundary.
/dev/md0p2   ?  1953251627  3771827541   909287957+  43  Unknown
Partition 2 does not start on physical sector boundary.
/dev/md0p3   ?   225735265   225735274           5   72  Unknown
Partition 3 does not start on physical sector boundary.
/dev/md0p4      2642411520  2642463409       25945    0  Empty

Partition table entries are not in disk order
charles@Charles-desktop ~ $ 
Attachments
Disks_002.png

User avatar
WharfRat
Level 21
Level 21
Posts: 13148
Joined: Thu Apr 07, 2011 8:15 pm

Re: Very confused about RAID 1

Post by WharfRat » Sun Jun 08, 2014 11:28 am

Charles,

I've never setup a raid array with a GPT partitioned set of disks so some the output looks strange to me too. Is there a reason you're gpt partitioning :?:

You have 2tb drives so gpt would not be necessary,

The messages about not being able to boot would not be relevant here since you're not installing mint to the array. Also don't use fdisk, use

Code: Select all

parted -l
The array itself looks ok, but as I said I can't be sure since it's gpt.

Check the /dev/mapper directory to see what the other devices look like

At this point I would try to format it with

Code: Select all

mkfs.ext4 /dev/md0
then mount it and see what happens.

Good luck
ImageImage

Charles_cz
Level 1
Level 1
Posts: 11
Joined: Thu May 08, 2014 9:29 am

Re: Very confused about RAID 1

Post by Charles_cz » Sun Jun 08, 2014 11:50 am

WharfRat, there is really no real reason for GPT. I understand that it's not over 2TB so it's is not technically needed. I did not know it would interfere in any way when creating and using RAID array.
I have used gparted to partition the disks as I am new to linux and I am sure I would mess it up trying to use fdisk (or parted ?) itself.

"Check the /dev/mapper directory to see what the other devices look like"

What should I see there? The only thing I see there right now is control: Not sure what that is.. :roll: So much to learn.

Code: Select all

charles@Charles-desktop /dev/mapper $ stat -f control 
  File: "control"
    ID: 0        Namelen: 255     Type: tmpfs
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 2040568    Free: 2040567    Available: 2040567
Inodes: Total: 2040568    Free: 2039968
Anyway:
1. is that ok to format the RAID array while it resyncing?
2. are these strange partition going to disappear once I use mkfs?
3.I want to be able to read that raid array in windows if that is possible should I decide to do dual boot in the future. I guess I should use ntfs instead of ext4?

Thank for your help so far.. 8) Charles

User avatar
WharfRat
Level 21
Level 21
Posts: 13148
Joined: Thu Apr 07, 2011 8:15 pm

Re: Very confused about RAID 1

Post by WharfRat » Sun Jun 08, 2014 12:18 pm

Charles,

I'm not near a raid setup at the moment, so I can't compare anything. Also I have a raid 0 so I'm not sure about problems with resyncing. It shouldn't though as it doesn't stop all throughput when the sync job kicks off. And, what do you stand to lose now :?:

As far as your other questions, I'm pretty sure those strange partitions are from the disks's metadata which is used to identify and control the mirrored devices and since you're using a linux software raid, not a bios fake, I highly doubt windows is going to recognize it. However, I've been wrong before :D

Good luck :wink:
ImageImage

Charles_cz
Level 1
Level 1
Posts: 11
Joined: Thu May 08, 2014 9:29 am

Re: Very confused about RAID 1

Post by Charles_cz » Sun Jun 08, 2014 12:27 pm

I see.. That's good point. I wonder if I should use "fake raid" .. That might be less headache too, maybe... :lol:

mintybits
Level 6
Level 6
Posts: 1123
Joined: Fri Jan 27, 2012 5:09 pm

Re: Very confused about RAID 1

Post by mintybits » Sun Jun 08, 2014 4:34 pm

Hi Charles,
This is an interesting problem. It seems mdadm set up a bunch of sub-partitions in the RAID array instead of just one partition. I would guess that it did this because it detected some pre-existing meta data on the disks that had it as a multi-partitioned raid at some time in the past, perhaps a fakeraid. It may be that mdadm is being too smart here and presuming you want to retain the previous partitions. I believe they changed madam recently so that it can be used for fakeraid. So perhaps this is it. Not very clear what it did and why as is the normal level of explanation that mdadm gives. :?

I would recommend starting afresh. First remove any old fakeraid metadata:

Code: Select all

sudo dmraid -rE
I would reformat the disks. Like Wharfrat I would also recommend using MS-DOS/MBR partitioning because linux tools support it better, eg: fdisk.
Then redo your original mdadm creat command.

Post Reply

Return to “Newbie Questions”