Rich Mingin (PLUG) on 17 Mar 2015 06:15:08 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Writing to Windows 7 software RAID volumes


As a previous heavy user of dmraid, I'd also like to point out that none of the Win/Lin shared RAID solutions are what I'd consider robust. It's not a failing of dmraid in any way, it's more a complication from dual booting. Windows is just plain not a good neighbor, and will take unilateral action that breaks your other OSes without notice or concern.

Unless dual booting is your long term plan, I'd advise against using something like this for important data.

I'm sure this has already been said to you, so I apologize for repeating it, but I felt it needed to be disclaimed.

On Tue, Mar 17, 2015 at 3:55 AM, brent timothy saner <brent.saner@gmail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 03/16/2015 10:56 PM, Josh Zenker wrote:
> I have a pair of disks mirrored using the software RAID implementation
> built into Windows 7. Ideally I would like to be able to mount them
> read-write from the Linux side, but I'm afraid of corrupting the dynamic
> disk. The general consensus on the Ubuntu Forums is that it's a bad
> idea. (I have been mounting them read-only without issues.) Still, I'm
> wondering if anyone here has tried it.
>
> JZ

Little-known fact, md (and mdadm, etc.) can work with windows software
raid as they use compatible superblocks (at least, they did in windows
XP- haven't tested on Win7 but I can't imagine this changing).

There are two ways- the dmraid way (easy) and the mdadm way (more
difficult). Both are definitely easy compared to what you thought may
have been the case, however. Try the dmraid way first- if it reports no
found RAID devices, then continue to the mdadm way. dmraid is designed
to work with "fakeraid"- e.g. motherboard-assisted software RAID (I
guess this technically would be "firmware RAID" since it's neither
hwraid nor swraid). I have included both methods just in case Win7 makes
some hooks into the motherboard for determining how a RAID should be
assembled.

Make sure you make backups first. As always. This has worked before, but
as I said, untested in Win7.


EASY WAY (dmraid):

Install dmraid if it isn't already installed.

Then:

dmraid -r

This will list any devices found that can be assembled. If it finds
devices, great! You have your work cut out for you. You can run:

dmraid -ay

And they'll automatically be assembled. It should assign a name to the
array (for instance, WIN_RAID) and then should be accessible via
/dev/mapper (e.g. /dev/mapper/WIN_RAID). You can then mount it as a
normal NTFS volume (read or, if your driverset/modules support it, write
as well): mount -t ntfs /dev/mapper/WIN_RAID /mnt/WINDOWS

If it *doesn't* find any devices it can assemble into a RAID, well....
read on.


HARD WAY (mdadm):

Install mdadm if it isn't already installed.

Let the following be representative:

N=some unused number for an array in /dev/md*.
X=RAID level in your windows array- 0 for RAID0, 1 for RAID1, etc.
Y=number of disks in the array
Z[0-9]=hardware devices in the windows array
A=partition number of Z[0-9] that houses the RAIDed partition

WARNING:
Do ****not*** use ---create in mdadm. I'll say it again: DO NOT USE
- --create IN MDADM FOR WINDOWS ARRAYS. It will destroy the data on the
drives, along with the existing superblocks. This is why we specify
- --build- --assemble does not work, but --build does.

USAGE:

mdadm --build /dev/md*N* --chunk=64 --level=*X* --raid-devices=*Y*
/dev/sd*Z1*A* /dev/sd*Z2*A*
(whiout the *'s. repeat the last /dev/sdZ[0-9]'s for all
devices/partitions in the array.)

EXAMPLE:

Let's say in Windows you have drive A, B, and C in a RAID5. They each
have 2 partitions, with the second being the member of the RAID array.

drive A in linux maps to /dev/sda
drive B in linux maps to /dev/sdb
drive C in linux maps to /dev/sdc

You already have /dev/md0 present (for whatever reason), so you want to
assemble into a new array- /dev/md1.

mdadm \
  --build /dev/md1 \
  --chunk=64 \
  --leevl=5 \
  --raid-devices=3 \
  /dev/sda2 \
  /dev/sdb2 \
  /dev/sdc2


Then, to mount,

mount -t ntfs /dev/md1 /mnt/WINDOWS

Make sure windows had a clean shutdown. Sometimes you'll get an error
when you try to build the array- if that's the case, try futzing with
the order of the drives as it does matter (but improper ordering
shouldn't be destructive).

watch cat /proc/mdstat
is useful for watching the progress of the build. You should be able to
mount and write to it safely while (re)buildiing, but just don't
shutdown or (goodness.) power off before it finishes rebuilding. If
you've written to the array while it's (re)building, for good measure
I'd do a sync(1) as soon as it finishes (re)building but that probably
isn't necessary.





Hope this helps. Please report back with results.



FURTHER READING:
http://superuser.com/questions/694050/how-to-create-a-software-raid-1-array-on-windows-7-not-spanning-whole-disks
https://help.ubuntu.com/community/FakeRaidHowto
http://www.chrysocome.net/virtualvolumes
http://ubuntuforums.org/showthread.php?t=833653&page=4
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCgAGBQJVB932AAoJEIwATC+TSB9rj4gP/1JZ1Q4XQLATJ0cO+jsfUwVx
B0SV26WVWhCvzrZk2kKFQeZjnxm2TlwoiSY1KWD0tyecjmCPnRd/9YAalgoLNAmn
pHJjEowON1xGB9cn9f1wEV+sddfmBFP7JaFvAWDRKvBefsdhozc88OmQVaWaoCFI
C2DyprAtb3uszYpnA61hZv1qzXJjwlOVPx1zVnlJ9myLM3Oh8hEBT4l3sVDgQkrf
xBA/ceY4mOv4aKMwA6RRWfO7OkYpOKcd9K/GfsjAtw8WcwMyW3dXwH+QyH0CL6P5
aib1q8HfpjeQR3aG+1I6Ud3QsnFMGF4yzGizLqoeoA3RjCwIcTdqH1DlhfT3dhe0
Wh2S31ZbjDujJj/esklVjKXEmo0QNFcbhzGTllAvUWOVHvLdVYgLJtbYANj+r3Hc
VdI/1dwVyxL5Df30R0svnsY3Il39Fk3R9OgdOdvYeb0x8mnmQQrLl3cgoFZJiwWH
M9d1F19LSFt0/6XAuaKfaISldQT4+jTMzVrB0VFvZfMZqunfgNwBsFaLjtyu3I4+
vktInnaXmiz1wvdlBRVJBVORdTY/hLze1QmcDR7j8iN1yE3CnB5v+wrvF6gtADuZ
iDEczP/gucCRTe/HLlDPnWFya+7x03WVd/5Cpsu/pLb7RTvT4g2gpIvIuotKfIRo
f8YlbOvHQAwYSMQFv1Nf
=WzwK
-----END PGP SIGNATURE-----
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug