Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I imaged my win7 system disk via ntfsclone + dd (mbr) to one of my Win7 Dynamic Disk RAID1 disks from within the Ubuntu LiveCD instance (only wrote to one of the disks in the win7 RAID1 array). I did this with success and was then able to reload the image into Virtual Box after fully installing Ubuntu 11.10.

Now, I'm trying to setup the RAID1 software RAID in Ubuntu (installed over old win7 system drive) via mdadm and I'm wondering if I can do this and have it resync the data on both drives without destroying the Dynamic Disk RAID config and without any data loss (most important)?

I realize I should have probably done this from the get go (even in LiveCD)... if this isn't possible - perhaps, I can re-partition the second RAID disk that wasn't written to and then have it resync? Or should I use dd to re-image first RAID drive -> 2nd Drive and then run mdadm?

Goal here is to have a dual boot Ubuntu/Win7 system which can both read/write from the RAID1 array... also, don't want to use fakeRAID, rather, software RAID

share|improve this question
add comment

3 Answers 3

up vote 1 down vote accepted

After some hard searching found the answer to the solution....

Forum w/ solution: http://ubuntuforums.org/archive/index.php/t-1776909.html

--------- Content of Forum in case it disappears, etc.. ------

I have a computer that I'm dual booting between Ubuntu 11.04 and Win7 (Enterprise?)

I have a SDD that I've split up for the OSs, and a pair of HDD that I'd like to RAID0 together. I've read in a few places that Linux should be able to handle Win7's Software RAID and found this helpful post: http://ubuntuforums.org/showthread.php?t=833653&highlight=dynamic+disk

I ran through the instructions but got stuck in trying to mount the drives.

What I did: 1. Load Win7

  1. Set both drives to GPT

  2. Build the RAID0

  3. Format to NTFS

  4. Verify it works (copied some file to it)

  5. Boot Ubuntu

  6. Run: cat /proc/partitions major minor #blocks name

8 0 312571224 sda 8 1 1024 sda1 8 2 130048 sda2 8 3 312440118 sda3 8 32 312571224 sdc 8 33 1024 sdc1 8 34 130048 sdc2 8 35 312440118 sdc3 8 16 78150744 sdb 8 17 102400 sdb1 8 18 38972416 sdb2 8 19 1 sdb3 8 21 39072768 sdb5 8 48 156290904 sdd 8 49 156288000 sdd1 9 0 624880128 md0

  1. Run: sudo mdadm --build /dev/md0 --chunk=64 --level=0 --raid-devices=2 /dev/sd[c|a][1-3] /dev/sd[a|c][1-3] mdadm: array /dev/md0 built and started

  2. Run: sudo mount -t ntfs-3g /dev/md0 /media/raid0 NTFS signature is missing. Failed to mount '/dev/md0': Invalid argument The device '/dev/md0' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

I've swapped the devices around in all possible combos (8) and I get the same results each time.

Poking around via Google a bit more, I see that other have this working, so I'm hoping there's just something silly I'm missing.

Any suggestions?

---- Follow up post ----

So 'bout half way through posting that, I thought "Why not try MBR instead of GPT"?

I started over, used MBR on the disk and received a very different partition list: 8 32 312571224 sdc 8 33 312568832 sdc1 8 0 312571224 sda 8 1 312568832 sda1 8 16 78150744 sdb 8 17 102400 sdb1 8 18 38972416 sdb2 8 19 1 sdb3 8 21 39072768 sdb5 8 48 156290904 sdd 8 49 156288000 sdd1 9 0 625137664 md0

The right combo (for me) after that was: sudo mdadm --build /dev/md0 --chunk=64 --level=0 --raid-devices=2 /dev/sda1 /dev/sdc1

So it seems that Linux CAN handle GPT, and it can handle MS's Dynamic Disk (which Win uses for RAID), it just can't do both at once (at the moment!).

I'm currently mounting and creating files on both Ubuntu 11.04 and Win 7 and can access them on either OS! :popcorn:

I hope this helps someone out there.:D

share|improve this answer
add comment

There is libldm tool that can read Windows Logical Disks metadata:

# ldmtool scan
[
  "<GUID>"
]

# ldmtool show diskgroup <GUID>
{
  "name" : "LYZKOV-PC-Dg0",
  "guid" : "<GUID>",
  "volumes" : [
    "Volume2",
    "Volume1",
  ],
  "disks" : [
    "Disk1",
    "Disk2"
  ]
}

You can build your logical volumes by:

# ldmtool create all

New device nodes should now reside in /dev/mapper/:

# ls /dev/mapper/
/dev/mapper/ldm_vol_LYZKOV-PC-Dg0_Volume1  /dev/mapper/ldm_vol_LYZKOV-PC-Dg0_Volume2
share|improve this answer
add comment

Windows software raid is unsupported in Linux. By writing to it as you did, you already corrupted it. The only way to get both windows and Linux to recognize it is to use fakeraid, which is an unreliable crap shoot anyhow.

Since you are dual booting anyhow, I could suggest you forget about raid1 and just make regular backups to the second disk ( and preferably disconnecting it the rest of the time ). Remember, RAID is not a backup system. The purpose of raid is to increase performance and uptime, not to prevent data loss. You still need to make regular backups.

share|improve this answer
    
While I appreciate your time - It wasn't ever corrupted, just each disk had a very minordiff set of data. All is well now. And how non-redundant is making regular backups. RAID1 handles near real-time disk failures well. I never mentioned backups and that was not my concern. I have a backup system in place in addition to the RAID1 setup. Periodic backups do not and thus is completely useless re: the original question. –  bbqchickenrobot Mar 24 '12 at 20:52
    
@bbqchickenrobot, when each disk contains different data, that means it's corrupted. Since it has no idea which disk is more up to date, or even that they are out of sync, when reading it can return data from either disk at random, so you can end up getting some data from the older state, and some data from the newer state, which will severely confuse the filesystem driver. –  psusi Mar 25 '12 at 14:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.