# [Workaround] Using RAID1 with BIOS, sharing Linux and XP

## lyallp

I have a dual boot to XP and Gentoo. (XP to play games)

I have just setup RAID1 using my Motherboard BIOS raid on 2x750G SATA disks.

I setup the 3 partitions as RAID1 (/, /boot and a LVM2 partition).

I then established my filesystems within LVM, no problems.

I have restored my system from backup, tweaked the kernel to have RAID1 built in, updated the GRUB config and everything is running sweet.

Now, I have a 650G partition I would like to format as NTFS-3g and have it RAID1 as well.

The final icing on the cake is to have Windows XP also recognise that this partition is RAID1.

I booted up XP, formatted the parition and it thinks it's all sweet.

I booted up Linux, did the mdadmin to create the RAID1 on the partition. As soon as I did that, NTFS-3g doesn't recognise the partition.

I can mount it using plain old ntfs, but not ntfs-3g.

Of course, mounted as plain old ntfs, it's read-only, which is not quite what I had in mind.

Maybe, after my next XP re-boot, things might be fixed.

I was wondering if anyone else has had a similar experience.

----------

## MassimoM

I have a working configuration similar to yours (RAID0 on nForce5 controller - Gentoo and Vista. Both can access all partitions thanks to ntfs-3g on Gentoo and ext2fsd on Vista.)

 *Quote:*   

> 
> 
> I have just setup RAID1 using my Motherboard BIOS raid
> 
> 

 

 *Quote:*   

> I booted up Linux, did the mdadmin to create the RAID1 on the partition

 

If you create the array using Motherboard BIOS, on linux you use dmraid (and not md raid). dmraid is the program created to access motherboard bios raid, which is a mix between hardware and software raid. It writes on disks with the format defined by your motherboard BIOS, which is also known by the windows driver.

md raid is a pure software raid, whose on-disk format is known only to Linux.

Summing up: if you have created the array in motherboard bios, just install both OS. Their partitions will be automatically on RAID1 and accessible by both OS. You don't need mdadmin at all.

----------

## NeddySeagoon

lyallp,

Your post shows some confusion between BIOS software raid, which is what you want to share a raid set between Windows and Linux and linux kernel raid, which is a better raid solution but useless for windows.

You will probably have to reinstall - I'm not sure exactly what you have done.

BIOS raid does not use any in kernel raid support nor does it use mdadm ... thats all for kernel raid.

BIOS raid needs dmraid which is a third party kernel module. If your want root on a BIOS raid volume, you must use an initrd to house dmraid, since it cannot be built into the kernel.

Start the liveCD with the dodmraid option if you want it to be BIOS raid aware. Do not perform any operations on the underlying discs or partions, although fdisk may see them.

----------

## lyallp

It's curious, because things seem to be working, except that I cannot use ntfs-3g to mount the NTFS partition.

Even the BIOS seems to think the RAID is healthy, which, in this case, it sounds like it shouldn't.

I will fiddle a bit longer, otherwise, I may have to break the bios RAID - rebuild the partitions and restore from backup again.

...Lyall

----------

## irgu

 *lyallp wrote:*   

> I can mount it using plain old ntfs, but not ntfs-3g.
> 
> 

 

ntfs-3g is much more strict for rw mounts then the kernel driver which never changes NTFS metadata. If ntfs-3g finds any corruption then it denies mount because you could lose data otherwise.

Does it work for 'ro' mount? What's error message during mount? The error messages usually explain what's the problem and how to solve it.

----------

## lyallp

ntfs-3g gives the following for R/W or RO

```

# mount -t ntfs-3g -o defaults,ro,gid=ntfs,umask=0,umask=007,exec,nls=utf8 /dev/md4 /mnt/win_mirror

Failed to read last sector (1214385479): Invalid argument

Perhaps the volume is a RAID/LDM but it wasn't setup yet, or the

wrong device was used, or the partition table is incorrect.

Failed to mount '/dev/md4': Invalid argument

The device '/dev/md4' doesn't have a valid NTFS.

Maybe you selected the wrong device? Or the whole disk instead of a

partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?

# mount -t ntfs-3g -o defaults,gid=ntfs,umask=0,umask=007,exec,nls=utf8 /dev/md4 /mnt/win_mirror

Failed to read last sector (1214385479): Invalid argument

Perhaps the volume is a RAID/LDM but it wasn't setup yet, or the

wrong device was used, or the partition table is incorrect.

Failed to mount '/dev/md4': Invalid argument

The device '/dev/md4' doesn't have a valid NTFS.

Maybe you selected the wrong device? Or the whole disk instead of a

partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?

```

----------

## lyallp

Well, I gave up on that idea.

I simply 

booted to Linux and deleted the RAID1 for partition 4

rebooted and went in to the BIOS RAID management and deleted the RAID info blocks (which did not clear all the data, contrary to what the BIOS told me it would do)

rebooted to WinXP

formatted both partitions, instead of the one RAID1 I had before

re-booted to Linux

tweaked my /etc/fstab to mount both NTFS partitions

mounted the two NTFS partitions

my /boot, root and LVM partitions are still RAID1

So, I now have twice as much NTFS storage as I was expecting, but it's not RAID.

Oh well, the NTFS stuff is not important.

----------

## irgu

 *lyallp wrote:*   

> ntfs-3g gives the following for R/W or RO
> 
> ```
> 
> # mount -t ntfs-3g -o defaults,ro,gid=ntfs,umask=0,umask=007,exec,nls=utf8 /dev/md4 /mnt/win_mirror
> ...

 

This is an NTFS file system corruption detected by ntfs-3g which means the end of the file system is missing. It holds for both RW and RO mounts. 

The kernel ntfs driver accepts this because it doesn't have this sanity check. The ntfs-3g driver is the actively developed legacy of the the ntfs kernel driver with major new functionalities (full writes support) and fixes by the old and new ntfs developers. They had to fork the ntfs code when the maintainer got hired by Apple and stopped caring about the project. It's somehow funny that Apple still doesn't have read/write NTFS support but ntfs-3g already works fine on Linux, OS X, FreeBSD and even on NetBSD. Open source rulez!  :Smile: 

By some googling I found this info for your problem: 

http://forum.ntfs-3g.org/viewtopic.php?t=124

And apparently the reason was that you built the raid device with the --create, not the --build option: 

http://forum.ntfs-3g.org/viewtopic.php?p=1912#1912

----------

## lyallp

Awesome, thanks, I will have to try again, when I feel inclined.

It's over an hour just to do the initial backups, then another 2 hours if the RAID setup in BIOS 'blows' my disk contents away.

Sheesh, I kinda expected Windoze to get it right.

----------

## NeddySeagoon

lyallp,

I don't think you can make a ntfs file system on /dev/mdX  /dev/md is kernel raid, which Windows cant read/write.

You need to start you raid install again, using BIOS raid, which is transparent to Windows and dmraid in Linux.

Your raid partitions will appear as /dev/mapper/...

Depending on your BIOS, you may see the underlying drives and partitiions too but you must never use them.

----------

## lyallp

Well, I setup BIOS RAID (I have an old P4 mobo - to be precise, a Gigabyte 8IK1100).

Windows found it and used it just fine.

My setup in linux seemed to keep the BIOS RAID setup happy - the BIOS never complained about the RAID being unhealthy.

My only problem was NTFS - which appears to have been addressed in the post, kindly provided by Michael.

I will let everyone know, if I get around to trying again, what my results are.

----------

