# RAID-0 LANstep

## Vetsin

I created a bios RAID out of two sata drives a while back, and formated and used them in WinXP for a while. I recently got rid of windows and put gentoo on, but there is something weird about the RAID-0 setup.

The two drives are:

```
Disk /dev/sda: 250.0 GB, 250059350016 bytes

255 heads, 63 sectors/track, 30401 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1               2       60802   488384032+   f  W95 Ext'd (LBA)

/dev/sda5   ?       66904       84789   143656968+  fe  LANstep

Disk /dev/sdb: 250.0 GB, 250059350016 bytes

255 heads, 63 sectors/track, 30401 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table
```

I can't seem to find anywhere that will explain the LANstep, and i have no idea what it is. I tried using dmraid and mounting them as vfat, but of course it didn't see them as a fat drive. Any ideas on what might be up with these two drives?

----------

## Vetsin

Ah sorry, here is the updated fdisk... I misread it.

```
Warning: ignoring extra data in partition table 5

Warning: ignoring extra data in partition table 5

Warning: invalid flag 0x0002 of partition table 5 will be corrected by w(rite)

Disk /dev/sda: 250.0 GB, 250059350016 bytes

255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors

Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1           16065   976784129   488384032+   f  W95 Ext'd (LBA)

/dev/sda5   ?  1074810819  1362124755   143656968+  fe  LANstep

Disk /dev/sdb: 250.0 GB, 250059350016 bytes

255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors

Units = sectors of 1 * 512 = 512 bytes

Disk /dev/sdb doesn't contain a valid partition table
```

I guess maybe there is something wrong with it ~_~

----------

## phorn

First, I have never used SATA RAID before, only SCSI (but I believe they are similar)

First, what type of BIOS-level RAID is it? What brand motherboard, RAID controller, SATA controller -- you may want to reboot into Windows to find this information out, if you look at the Device Manager hard drive controller info.  Also, did you have to install a special driver in Windows to get it to see your RAID array?

Also, you said "got rid of windows and put gentoo on".  Does that mean that you already wiped the RAID drives?

I had a SCSI system with a MegaRAID controller, and I had to make sure to specifically install the related kernel module for it to correctly see the RAID drives.

Is it possible that the RAID setup is showing up as sdc, sde, or also as hda or hdb?  With the MegaRAID setup, I sometimes saw ghost hard drives when running from a LiveCD (It probably tried using SCSI drivers as well as the RAID drivers).  To find out, look at the /proc/partitions: That will show you all hard drives and partitions that are available.

You may also want to post your "dmesg" output, and try running "cat /proc/partitions", and the output of "lspci", and possibly "lsmod" to see what drivers are loaded.

I would also avoid making any changes to the partition table as they may render the whole setup unusable -- the "ignoring extra data" earning shows that maybe the BIOS hid data about the RAID setup within the partition table, and overwriting it may lose the data.  The BIOS may just tag its partitions as LANstep (0xfe) in order to keep any modern OS from accidentially touching the RAID data.

If the setup is RAID-0, this also means that the data is probably striped across two drives, and that it is virtually impossible to get your data off without using the same RAID setup.

Another option, if you want to wipe the drive is to go with Linux software RAID-0 (md), but of course, hardware/BIOS setup is usually faster if you can get it working.

It will be easier to find out what is going on if you give more information about the specific hardware setup.

----------

## Vetsin

I never had to install anything special to get the harddrives to work in windows, the drives have been completely untouched.

Mobo: ASUS P4P800-E Deluxe

Raid Controler: Promise PDC20378

And i used MBFastTrak378 to configure the RAID-0

The mobo book does say to copy the Promise FastTrak 378 Driver from the CD, but I don't beleive I ever did that (for windows).

I'm fairly certin that the RAID drives are /sda and /sdb, I know what all the other drives are and only my raid drives are sata. Your explination makes alot of sense, and I guess I just need specific drivers to get these to work. I'd rather not wipe the drives, alot of data on there I dont want to lose. I don't see what would look like the right drivers. And thankyou for the help!

Information:

```

major minor  #blocks  name

   3     0  120060864 hda

   3     1      40131 hda1

   3     2          1 hda2

   3     3     506047 hda3

   3     4   18988830 hda4

   3     5  100518673 hda5

   3    64  293036184 hdb

   3    65  293033601 hdb1

   8     0  244198584 sda

   8     1          1 sda1

   8    16  244198584 sdb

 253     0  488396544 dm-0
```

```
00:00.0 Host bridge: Intel Corporation 82865G/PE/P DRAM Controller/Host-Hub Interface (rev 02)

00:01.0 PCI bridge: Intel Corporation 82865G/PE/P PCI to AGP Controller (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 (rev 02)

00:1d.1 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2 (rev 02)

00:1d.2 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #3 (rev 02)

00:1d.3 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #4 (rev 02)

00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02)

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2)

00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge (rev 02)

00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)

00:1f.3 SMBus: Intel Corporation 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)

00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)

01:00.0 VGA compatible controller: ATI Technologies Inc RV350 NJ [Radeon 9800 XT]

01:00.1 Display controller: ATI Technologies Inc RV350 NJ [Radeon 9800 XT] (Secondary)

02:03.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80)

02:04.0 RAID bus controller: Promise Technology, Inc. PDC20378 (FastTrak 378/SATA 378) (rev 02)

02:05.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller (rev 13)
```

```
Module                  Size  Used by

raid0                   7296  0

ntfs                   83188  2

parport_pc             27972  0

parport                22984  1 parport_pc

floppy                 47204  0

pcspkr                  2948  0

skge                   28816  0

rtc                    10036  0

dm_mirror              15312  0

dm_mod                 37272  2 dm_mirror

pdc_adma                7172  0

sata_mv                13576  0

ata_piix                7812  0

ahci                   10116  0

sata_qstor              7428  0

sata_vsc                6404  0

sata_uli                5636  0

sata_sis                6148  0

sata_sx4               10884  0

sata_nv                 6916  0

sata_via                6660  0

sata_svw                5892  0

sata_sil24              8580  0

sata_sil                7560  0

sata_promise            8708  2

libata                 37132  15 pdc_adma,sata_mv,ata_piix,ahci,sata_qstor,sata_vsc,sata_uli,sata_sis,sata_sx4,sata_nv,

sata_via,sata_svw,sata_sil24,sata_sil,sata_promise

sbp2                   16516  0

ohci1394               26160  0

ieee1394               57656  2 sbp2,ohci1394

sl811_hcd              10368  0

ohci_hcd               15748  0

uhci_hcd               24976  0

usb_storage            50880  0

usbhid                 30432  0

ehci_hcd               23048  0

usbcore                82436  7 sl811_hcd,ohci_hcd,uhci_hcd,usb_storage,usbhid,ehci_hcd
```

----------

## phorn

According to /proc/partitions, you definitely have a 465GB /dev/dm-0 drive. That looks a lot like a RAID-0 array to me (unless you happen to have a 500GB drive in your system).  I think that maps to the  "LANStep" drive.

It's strange that it's only 488396544 kB, but that is twice 244198584, so it is the right size.

Aside from that, I would avoid the partition table... It looks bogus to me.

The kernel seems to not want to use SDA at all (sda1 looks incredibly small):

```
   8     0  244198584 sda

   8     1          1 sda1

   8    16  244198584 sdb 
```

Anyway, remember that the kernel knows best... even better than fdisk and userspace tools.

So I would avoid touching the partition layout on drives that are supposed to be RAID'ed together, as that may confuse the RAID array.

It also seems that Linux does need a separate driver for the RAID array, if you look at the "pdc_adma", which looks similar to the model number "PDC20378".

```
dm_mirror              15312  0

dm_mod                 37272  2 dm_mirror

pdc_adma                7172  0 
```

You say that the RAID drives are /sda and sdb, but you do not ever want to access the drives in a RAID aray directly... rather, you want to access the array itself, and that would be dm-0.

Ålso, I would not store any important data on a RAID-0 drive, because RAID-0 arrays will lose ALL data if either drive fails.

----------

## Vetsin

I checked up here about my controler, and enabled Promise SATA TX2/TX4 support.

I used dmraid, and going fdisk /dev/mapper/isw_dedcedige_RAID_Volume1

shows that on my raid drive:

```
Disk /dev/mapper/isw_dedcedige_RAID_Volume1: 500.1 GB, 500118061056 bytes

255 heads, 63 sectors/track, 60802 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

                                  Device Boot      Start         End      Blocks   Id  System

/dev/mapper/isw_dedcedige_RAID_Volume1p1               2       60802   488384032+   f  W95 Ext'd (LBA)
```

I thought it should be NTFS. Either dmraid isn't working, or i'm missing something. I also don't see how mdadm could work... Any ideas here?

----------

## phorn

I'm not sure why that is happening, but have you tried mounting it anyway, either as ntfs or vfat, to see if you can access the data? If you don't want to modify the data, the "-o ro" option for read-only should be safe.

/dev/mapper/isw_dedcedige_RAID_Volume1p1 looks like a partition of some sort.  It's possible that the type of partition is incorrect.

Also, if you run, as root,

```
head /dev/mapper/isw_dedcedige_RAID_Volume1p1 | file -
```

the file command will give you information about the partition type.

My FAT32 dirive on /dev/hda1 has:

 *Quote:*   

> /dev/stdin: x86 boot sector, Microsoft Windows XP Bootloader NTLDR, code offset 0x58, OEM-ID "MSWIN4.1", sectors/cluster 64, Media descriptor 0xf8, heads 255, hidden sectors 63, sectors 78156162 (volumes > 32 MB) , FAT (32 bit), sectors/FAT

 

If mounting that doesn't work, and file gives no indication of what is on the partition, you could try looking manually at the output of head /dev/DEVICENAME, and see what's actually at the beginning.  You should hopefully see some indicator of a NTFS or FAT32 partition in the output. If you get alot of garbage, less /dev/DEVICE, which should filter out the bad characters.

If you don't see any indicator that a filesystem exists there, you could also try looking directly at /dev/mapper/isw_dedcedige_RAID_Volume1, and see if that is actually the partition.

----------

## Vetsin

Yeah, I call shenanagins on my harddrive. Can't mount it as vfat or ntfs.

```
# head /dev/mapper/isw_dedcedige_RAID_Volume1 | file -

/dev/stdin: x86 boot sector
```

and

```
# head /dev/mapper/isw_dedcedige_RAID_Volume1p1 | file -

head: cannot open `/dev/mapper/isw_dedcedige_RAID_Volume1p1' for reading: No such file or directory

/dev/stdin: empty

```

Seems that partition doesn't even exist! I'm now convinced that fdisk is messed.

The driver is there, I know that. 

```
# lspci | grep Promise

02:04.0 RAID bus controller: Promise Technology, Inc. PDC20378 (FastTrak 378/SATA 378) (rev 02)
```

It *shouldn't* have any problem with reading the disks, should it? I'm reading an old post from 2003, and it says tha tno distro based on 2.6 kernel will have raid support. 

But this might be even more interesting:

```
# hdparm -tT /dev/mapper/isw_dedcedige_RAID_Volume1

/dev/mapper/isw_dedcedige_RAID_Volume1:

 Timing cached reads:   3620 MB in  2.00 seconds = 1810.07 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

 Timing buffered disk reads:  296 MB in  3.00 seconds =  98.56 MB/sec

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device
```

----------

## phorn

You may be interested in this thread:

http://www.redhat.com/archives/ataraid-list/2004-August/msg00030.html

According to this post:

https://www.redhat.com/archives/ataraid-list/2004-August/msg00027.html

You may have to use the -p option to dmraid in order to get the p1, p2, etc. nodes. (In this case, I guess fdisk is correct) -- It should be in the dmraid package, but device-mapper may also have some stuff.

Actually, I would recommend compiling the latest version of dmraid: 1.0.0-rc10

http://people.redhat.com/~heinzm/sw/dmraid/src/

The one in unstable Gentoo is a year old, so you would have a better chance of supporting the partitions with a later version.

You should try some debugging commnads like:

```
dmraid -v -ay
```

sounds like it may give information.

Paste the output of 

```
ls -l /dev/mapper
```

 to see what devices (and what numbers they point to) are actually there.

Another page with dmraid information is here:

http://tech.vault9.net/forums/Mounting_Ntfs_Partions_On_Raid_0_Device-t19791.html

Again, that seems to assume that you can see your partition devices so we will see how that goes.

If you can't get the partition created, you could use loopback devices as a last resort.

```
losetup -o 16450560 -f /dev/loop0 /dev/mapper/isw_dedcedige_RAID_Volume1
```

That will create a /dev/loop0 pseudo-device which would map to 2*8225280=16450560 (Start block * block size in FDISK) bytes into isw_dedcedige_RAID_Volume1.

Then, mounting /dev/loop0 should work as a partition (You can try the head | file thing I had above to test if it is a partition there).

Unfortunately, it may be slower, but it would still work as an option.

Anyway, good luck

----------

## phorn

You may also want to look at this dmraid-related post here:

https://forums.gentoo.org/viewtopic-p-3430582.html#3430582.

They seem to say that you should go for a later version, located in the tst directory:

http://people.redhat.com/~heinzm/sw/dmraid/tst/

There is also this post that it links to:

https://forums.gentoo.org/viewtopic-t-470335-start-0-postdays-0-postorder-asc-highlight-.html

----------

## Vetsin

Ah yes, updated to dmraid rc11, and worked things out a bit.

```
control  pdc_dicjjjaebg  pdc_dicjjjaebg5
```

```
                     Device Boot      Start         End      Blocks   Id  System

/dev/mapper/pdc_dicjjjaebg1               2       60802   488384032+   f  W95 Ext'd (LBA)

/dev/mapper/pdc_dicjjjaebg5               2       60802   488384001    7  HPFS/NTFS
```

then 

```
mount: /dev/mapper/pdc_dicjjjaebg already mounted or /mnt/storageraid busy
```

Dare I say i'm on the threshold of completion? Well as far as i know, /mnt/storageraid is not busy (I am not in the dir), so somehow the pdc_ must be busy. Any way to check what, and stop it?

fuser -m /dev/mapper/pdc_dicjjjaebg returns nothing. I'm in the process of reading http://www.linux-noob.com/forums/lofiversion/index.php/t2268.html, i'll update if i figure it out.

----------

## phorn

You should see what devices are actually there, run:

```
ls -l /dev/mapper
```

Will give you the list of devices available.

You said you ran

 *Quote:*   

> mount -o ro -t ntfs /dev/mapper/pdc_dicjjjaebg /mnt/storageraid

 

The problem is that this will mount the whole drive, not the NTFS partition.  You need to do the pdc_dicjjjaebg5, like this:

```
mount -o ro -t ntfs /dev/mapper/pdc_dicjjjaebg5 /mnt/storageraid
```

I suspect that the main drive is busy, because its partitions are accessing the main drive.

You may also want to use the output of dmraid, like I had above to see where a problem would be happening.

Also, try the 

```
head /dev/mapper/pdc_dicjjjaebg5 | file -
```

 to see if you can get useful information out of the partitions.

One strange thing is that fdisk sees a pdc_dicjjjaebg1, but that does not actually there, so I would use the 5.

If you mount the partition 5, then it should work, as according to your "ls" output, that device is there.

----------

## Vetsin

Oh my, it works. Thankyou for your help! What a thorn in my side that was. Have some caek and py

----------

