# No dmraid devices in /dev/mapper (fakeraid)

## Crocodil

Hi  :Smile: 

I've recently bought a pair of a very nice hard disk drives - Samsung HD103SJ. I've decided to use them in RAID0 configuration and because I will also use them in Windows, I've decided to setup dmraid. I'm not going to setup system on that raid just yet, but I wanted to be able to access it in Gentoo. Unfortunatelly I've run into a problem I'm not able to solve myself.

I've followed this howto as close as possible. I've configured my kernel, built initramfs and setuped grub2. When the system boots there are some messages (not errors) about dmraid and device mapper (I can write them down if needed) but there are no devices in /dev/mapper:

```
# ls -al /dev/mapper/

razem 0

drwxr-xr-x  2 root root     60 2010-09-23  .

drwxr-xr-x 15 root root   4360 09-22 22:31 ..

crw-------  1 root root 10, 62 2010-09-23  control
```

In dmesg things also look ok:

```
# dmesg | grep -i mapper

device-mapper: uevent: version 1.0.3

device-mapper: ioctl: 4.17.0-ioctl (2010-03-05) initialised: dm-devel@redhat.com

device-mapper: multipath: version 1.1.1 loaded

device-mapper: multipath round-robin: version 1.0.0 loaded

device-mapper: multipath queue-length: version 0.1.0 loaded

device-mapper: multipath service-time: version 0.2.0 loaded

device-mapper: dm-log-userspace: version 1.0.0 loaded
```

```
# dmesg | grep -i dmraid

Command line: BOOT_IMAGE=(hd0,10)/boot/kernel-2.6.35-gentoo-r7 root=/dev/sdc10 video=uvesafb:1280x720,mtrr:3,ywrap ro dodmraid

Kernel command line: BOOT_IMAGE=(hd0,10)/boot/kernel-2.6.35-gentoo-r7 root=/dev/sdc10 video=uvesafb:1280x720,mtrr:3,ywrap ro dodmraid
```

I really don't know what to do and I would be grateful for any help.

Best regards,

Crocodil

----------

## BradN

Those dmesg entries don't actually show that dmraid is finding your devices, only that device mapper loaded.  Are there any other related messages, possibly after those?

----------

## HeissFuss

Did you build the device mapper zero target as a module or built in?

If as a module, is it loaded (dm_zero)?

What is the output of:

dmraid -ay --debug

Are these drives separate from your boot drive?

----------

## Crocodil

Hi  :Smile: 

I'm sorry for the late response...

 *BradN wrote:*   

> Those dmesg entries don't actually show that dmraid is finding your devices, only that device mapper loaded.  Are there any other related messages, possibly after those?

 

I've looked through the entire "dmesg" output and unfortunately there are no more messages that I can find  :Sad: 

 *HeissFuss wrote:*   

> Did you build the device mapper zero target as a module or built in?
> 
> If as a module, is it loaded (dm_zero)?
> 
> What is the output of:
> ...

 

I have build everything into the kernel, here how my options look:

```
--- Multiple devices driver support (RAID and LVM)

<*>   RAID support

[*]     Autodetect RAID arrays during kernel boot

< >     Linear (append) mode

<*>     RAID-0 (striping) mode

< >     RAID-1 (mirroring) mode

< >     RAID-10 (mirrored striping) mode

< >     RAID-4/RAID-5/RAID-6 mode

< >   Multipath I/O support

< >   Faulty test module for MD

<*>   Device mapper support

[ ]     Device mapper debugging support

<*>     Crypt target support

<*>     Snapshot target

<*>     Mirror target

<*>       Mirror userspace logging (EXPERIMENTAL)

<*>     Zero target

<*>     Multipath target

<*>       I/O Path Selector based on the number of in-flight I/Os

<*>       I/O Path Selector based on the service time

<*>     I/O delaying target (EXPERIMENTAL)

[*]     DM uevents (EXPERIMENTAL)
```

Here is the dmraid output:

```
# dmraid -ay --debug                                                                                                                                                                                                                                         

DEBUG: _find_set: searching isw_iidhbcjaf                                                                                                                                                                                                                                      

DEBUG: _find_set: not found isw_iidhbcjaf                                                                                                                                                                                                                                      

DEBUG: _find_set: searching isw_iidhbcjaf_Volume0                                                                                                                                                                                                                              

DEBUG: _find_set: searching isw_iidhbcjaf_Volume0                                                                                                                                                                                                                              

DEBUG: _find_set: not found isw_iidhbcjaf_Volume0                                                                                                                                                                                                                              

DEBUG: _find_set: not found isw_iidhbcjaf_Volume0                                                                                                                                                                                                                              

DEBUG: _find_set: searching isw_iidhbcjaf                                                                                                                                                                                                                                      

DEBUG: _find_set: found isw_iidhbcjaf                                                                                                                                                                                                                                          

DEBUG: _find_set: searching isw_iidhbcjaf_Volume0                                                                                                                                                                                                                              

DEBUG: _find_set: searching isw_iidhbcjaf_Volume0                                                                                                                                                                                                                              

DEBUG: _find_set: found isw_iidhbcjaf_Volume0                                                                                                                                                                                                                                  

DEBUG: _find_set: found isw_iidhbcjaf_Volume0                                                                                                                                                                                                                                  

DEBUG: checking isw device "/dev/sda"                                                                                                                                                                                                                                          

DEBUG: checking isw device "/dev/sdb"                                                                                                                                                                                                                                          

DEBUG: set status of set "isw_iidhbcjaf_Volume0" to 16                                                                                                                                                                                                                         

DEBUG: set status of set "isw_iidhbcjaf" to 16                                                                                                                                                                                                                                 

RAID set "isw_iidhbcjaf_Volume0" already active                                                                                                                                                                                                                                

ERROR: opening "/dev/mapper/isw_iidhbcjaf_Volume0"                                                                                                                                                                                                                             

DEBUG: freeing devices of RAID set "isw_iidhbcjaf_Volume0"                                                                                                                                                                                                                     

DEBUG: freeing device "isw_iidhbcjaf_Volume0", path "/dev/sda"                                                                                                                                                                                                                 

DEBUG: freeing device "isw_iidhbcjaf_Volume0", path "/dev/sdb"                                                                                                                                                                                                                 

DEBUG: freeing devices of RAID set "isw_iidhbcjaf"                                                                                                                                                                                                                             

DEBUG: freeing device "isw_iidhbcjaf", path "/dev/sda"                                                                                                                                                                                                                         

DEBUG: freeing device "isw_iidhbcjaf", path "/dev/sdb"
```

Yes, these drives are separate from the boot/system drive.

It looks like this is a configuration issue because drives are setuped correctly - the RAID array works fine when I boot from LiveCD...

Best regards,

Crocodil

----------

## HeissFuss

You don't need to have an initrd at all unless your / exists on the dm device, so you could save a bit of complication by removing that.

It looks like it's detecting the device but not activating it.

Is there any additional entries in dmesg related to running the 'dmraid -ay' command?  

What version of dmraid are you on?

Is this a completely new kernel config, or did you upgrade from an older one?

----------

## BradN

This seems to be the operative error output:

RAID set "isw_iidhbcjaf_Volume0" already active

----------

## Crocodil

Hi  :Smile: 

 *HeissFuss wrote:*   

> You don't need to have an initrd at all unless your / exists on the dm device, so you could save a bit of complication by removing that.

 

Thank you, that's good to know - I will disable that initrd for now. Although when the raid finally works, I will probably install gentoo on it  :Wink: 

 *HeissFuss wrote:*   

> It looks like it's detecting the device but not activating it.
> 
> Is there any additional entries in dmesg related to running the 'dmraid -ay' command?  
> 
> What version of dmraid are you on?
> ...

 

There are no additional messages in dmesg when I run "dmraid -ay".

I'm using dmraid-1.0.0_rc14 the version that genkernel is configured for by default. I've tried to use 1.0.0_rc16-r2 but I've run into a bug

I have modified configuration of a kernel that I've already used (2.6.35-gentoo-r7), and then I've used the following command (described in the howto):

```
genkernel --dmraid --install --kernel-config=/boot/config-2.6.35-gentoo-r7 all
```

I guess I'm going to have to try if the raid array works with a genkernel built kernel.

 *BradN wrote:*   

> This seems to be the operative error output:
> 
> RAID set "isw_iidhbcjaf_Volume0" already active

 

I've tried googling that, but it seems that this message can appear even when there are no problems. I'm rather thinking why this message shows (why there are no /dev/mapper/isw_iidhbcjaf_Volume* nodes):

```
ERROR: opening "/dev/mapper/isw_iidhbcjaf_Volume0"
```

Best regards,

Crocodil

----------

## BradN

I wonder what happens if you create block device nodes manually.  You can get the major number for the device from /proc/devices - the minor number you might have to guess though.  Try 0, 1, 2, 64, 65, 128, 129, 192, 193, 253, 254, 255 for the minor.  Try fdisk on the created node until you find the main device (if there is a partition table on it already!), and then the next one that does anything should be able to mount the filesystem on it (if there is one!).

It seems to indicate that the raid is running already though...  Maybe it's saying that the data on the raid indicates that something else is already using it (BIOS)?? It's not clear.

----------

## Crocodil

 *BradN wrote:*   

> I wonder what happens if you create block device nodes manually.  You can get the major number for the device from /proc/devices - the minor number you might have to guess though.  Try 0, 1, 2, 64, 65, 128, 129, 192, 193, 253, 254, 255 for the minor.  Try fdisk on the created node until you find the main device (if there is a partition table on it already!), and then the next one that does anything should be able to mount the filesystem on it (if there is one!).
> 
> It seems to indicate that the raid is running already though...  Maybe it's saying that the data on the raid indicates that something else is already using it (BIOS)?? It's not clear.

 

Hi  :Smile: 

Thank you very much for this suggestion, I think it got me a step closer to solving this problem. When I create all the nodes manually:

```
# mknod /dev/mapper/isw_iidhbcjaf_Volume0 b 253 0

# mknod /dev/mapper/isw_iidhbcjaf_Volume0p1 b 253 1

# mknod /dev/mapper/isw_iidhbcjaf_Volume0p2 b 253 2

# mknod /dev/mapper/isw_iidhbcjaf_Volume0p3 b 253 3

# mknod /dev/mapper/isw_iidhbcjaf_Volume0p4 b 253 4

# mknod /dev/mapper/isw_iidhbcjaf_Volume0p5 b 253 5

# mknod /dev/mapper/isw_iidhbcjaf_Volume0p6 b 253 6

# mknod /dev/mapper/isw_iidhbcjaf_Volume0p7 b 253 7

# mknod /dev/mapper/isw_iidhbcjaf_Volume0p8 b 253 8

# mknod /dev/mapper/isw_iidhbcjaf_Volume0p9 b 253 9

# chown root:disk /dev/mapper/isw_iidhbcjaf_Volume*
```

```
# ls -al /dev/mapper/

razem 0

drwxr-xr-x  2 root root     260 09-25 01:40 .

drwxr-xr-x 15 root root    4360 09-25 01:32 ..

crw-------  1 root root  10, 62 09-25 03:32 control

brw-r--r--  1 root disk 253,  0 09-25 01:38 isw_iidhbcjaf_Volume0

brw-r--r--  1 root disk 253,  1 09-25 01:39 isw_iidhbcjaf_Volume0p1

brw-r--r--  1 root disk 253,  2 09-25 01:39 isw_iidhbcjaf_Volume0p2

brw-r--r--  1 root disk 253,  3 09-25 01:39 isw_iidhbcjaf_Volume0p3

brw-r--r--  1 root disk 253,  4 09-25 01:39 isw_iidhbcjaf_Volume0p4

brw-r--r--  1 root disk 253,  5 09-25 01:40 isw_iidhbcjaf_Volume0p5

brw-r--r--  1 root disk 253,  6 09-25 01:40 isw_iidhbcjaf_Volume0p6

brw-r--r--  1 root disk 253,  7 09-25 01:40 isw_iidhbcjaf_Volume0p7

brw-r--r--  1 root disk 253,  8 09-25 01:40 isw_iidhbcjaf_Volume0p8

brw-r--r--  1 root disk 253,  9 09-25 01:40 isw_iidhbcjaf_Volume0p9
```

I am able to view the partition table:

```
# fdisk -l /dev/mapper/isw_iidhbcjaf_Volume0                                                                                                                                                                                                                

                                                                                                                                                                                                                                                                               

Disk /dev/mapper/isw_iidhbcjaf_Volume0: 2000.4 GB, 2000404348928 bytes

255 heads, 63 sectors/track, 243201 cylinders, total 3907039744 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 131072 bytes / 262144 bytes

Disk identifier: 0x213a3d1f

                             Device Boot      Start         End      Blocks   Id  System

/dev/mapper/isw_iidhbcjaf_Volume0p1            2048      133119       65536   83  Linux

/dev/mapper/isw_iidhbcjaf_Volume0p2   *      133120   314705919   157286400    7  HPFS/NTFS

/dev/mapper/isw_iidhbcjaf_Volume0p3       314705920   629278719   157286400   83  Linux

/dev/mapper/isw_iidhbcjaf_Volume0p4       629278720  3907039743  1638880512    5  Extended

/dev/mapper/isw_iidhbcjaf_Volume0p5       629280768  1447671807   409195520    7  HPFS/NTFS

/dev/mapper/isw_iidhbcjaf_Volume0p6      1447673856  2266064895   409195520    7  HPFS/NTFS

/dev/mapper/isw_iidhbcjaf_Volume0p7      2266066944  3084457983   409195520   83  Linux

/dev/mapper/isw_iidhbcjaf_Volume0p8      3084460032  3902851071   409195520   83  Linux

/dev/mapper/isw_iidhbcjaf_Volume0p9      3902853120  3907039743     2093312   82  Linux swap / Solaris
```

to activate the raid:

```
# dmraid -ay --debug

DEBUG: _find_set: searching isw_iidhbcjaf

DEBUG: _find_set: not found isw_iidhbcjaf

DEBUG: _find_set: searching isw_iidhbcjaf_Volume0

DEBUG: _find_set: searching isw_iidhbcjaf_Volume0

DEBUG: _find_set: not found isw_iidhbcjaf_Volume0

DEBUG: _find_set: not found isw_iidhbcjaf_Volume0

DEBUG: _find_set: searching isw_iidhbcjaf

DEBUG: _find_set: found isw_iidhbcjaf

DEBUG: _find_set: searching isw_iidhbcjaf_Volume0

DEBUG: _find_set: searching isw_iidhbcjaf_Volume0

DEBUG: _find_set: found isw_iidhbcjaf_Volume0

DEBUG: _find_set: found isw_iidhbcjaf_Volume0

DEBUG: checking isw device "/dev/sda"

DEBUG: checking isw device "/dev/sdb"

DEBUG: set status of set "isw_iidhbcjaf_Volume0" to 16

DEBUG: set status of set "isw_iidhbcjaf" to 16

RAID set "isw_iidhbcjaf_Volume0" already active

DEBUG: _find_set: searching isw_iidhbcjaf_Volume01

DEBUG: _find_set: not found isw_iidhbcjaf_Volume01

DEBUG: _find_set: searching isw_iidhbcjaf_Volume02

DEBUG: _find_set: not found isw_iidhbcjaf_Volume02

DEBUG: _find_set: searching isw_iidhbcjaf_Volume03

DEBUG: _find_set: not found isw_iidhbcjaf_Volume03

DEBUG: _find_set: searching isw_iidhbcjaf_Volume05

DEBUG: _find_set: not found isw_iidhbcjaf_Volume05

DEBUG: _find_set: searching isw_iidhbcjaf_Volume06

DEBUG: _find_set: not found isw_iidhbcjaf_Volume06

DEBUG: _find_set: searching isw_iidhbcjaf_Volume07

DEBUG: _find_set: not found isw_iidhbcjaf_Volume07

DEBUG: _find_set: searching isw_iidhbcjaf_Volume08

DEBUG: _find_set: not found isw_iidhbcjaf_Volume08

DEBUG: _find_set: searching isw_iidhbcjaf_Volume09

DEBUG: _find_set: not found isw_iidhbcjaf_Volume09

RAID set "isw_iidhbcjaf_Volume01" already active

RAID set "isw_iidhbcjaf_Volume02" already active

RAID set "isw_iidhbcjaf_Volume03" already active

RAID set "isw_iidhbcjaf_Volume05" already active

RAID set "isw_iidhbcjaf_Volume06" already active

RAID set "isw_iidhbcjaf_Volume07" already active

RAID set "isw_iidhbcjaf_Volume08" already active

RAID set "isw_iidhbcjaf_Volume09" already active

DEBUG: freeing devices of RAID set "isw_iidhbcjaf_Volume0"

DEBUG: freeing device "isw_iidhbcjaf_Volume0", path "/dev/sda"

DEBUG: freeing device "isw_iidhbcjaf_Volume0", path "/dev/sdb"

DEBUG: freeing devices of RAID set "isw_iidhbcjaf"

DEBUG: freeing device "isw_iidhbcjaf", path "/dev/sda"

DEBUG: freeing device "isw_iidhbcjaf", path "/dev/sdb"

DEBUG: freeing devices of RAID set "isw_iidhbcjaf_Volume01"

DEBUG: freeing device "isw_iidhbcjaf_Volume01", path "/dev/mapper/isw_iidhbcjaf_Volume0"

DEBUG: freeing devices of RAID set "isw_iidhbcjaf_Volume02"

DEBUG: freeing device "isw_iidhbcjaf_Volume02", path "/dev/mapper/isw_iidhbcjaf_Volume0"

DEBUG: freeing devices of RAID set "isw_iidhbcjaf_Volume03"

DEBUG: freeing device "isw_iidhbcjaf_Volume03", path "/dev/mapper/isw_iidhbcjaf_Volume0"

DEBUG: freeing devices of RAID set "isw_iidhbcjaf_Volume05"

DEBUG: freeing device "isw_iidhbcjaf_Volume05", path "/dev/mapper/isw_iidhbcjaf_Volume0"

DEBUG: freeing devices of RAID set "isw_iidhbcjaf_Volume06"

DEBUG: freeing device "isw_iidhbcjaf_Volume06", path "/dev/mapper/isw_iidhbcjaf_Volume0"

DEBUG: freeing devices of RAID set "isw_iidhbcjaf_Volume07"

DEBUG: freeing device "isw_iidhbcjaf_Volume07", path "/dev/mapper/isw_iidhbcjaf_Volume0"

DEBUG: freeing devices of RAID set "isw_iidhbcjaf_Volume08"

DEBUG: freeing device "isw_iidhbcjaf_Volume08", path "/dev/mapper/isw_iidhbcjaf_Volume0"

DEBUG: freeing devices of RAID set "isw_iidhbcjaf_Volume09"

DEBUG: freeing device "isw_iidhbcjaf_Volume09", path "/dev/mapper/isw_iidhbcjaf_Volume0"
```

and to mount and use the partitions:

```
# mount /dev/mapper/isw_iidhbcjaf_Volume0p3 /mnt/new_gentoo

# mount -t ntfs-3g /dev/mapper/isw_iidhbcjaf_Volume0p2 /mnt/new_windows

# ls -al /mnt/new_windows

razem 2097513

drwxrwxrwx  1 root root       8192 09-20 19:53 .

drwxr-xr-x 11 root root       4096 09-25 07:54 ..

-rwxrwxrwx  1 root root          0 09-18 21:14 AUTOEXEC.BAT

-rwxrwxrwx  1 root root        211 09-18 21:11 boot.ini

-rwxrwxrwx  1 root root          0 09-18 21:14 CONFIG.SYS

drwxrwxrwx  1 root root       4096 09-18 21:16 Documents and Settings

-rwxrwxrwx  1 root root          0 09-18 21:14 IO.SYS

-rwxrwxrwx  1 root root          0 09-18 21:14 MSDOS.SYS

-rwxrwxrwx  1 root root      47564 06-15 14:00 NTDETECT.COM

-rwxrwxrwx  1 root root     250048 06-15 14:00 ntldr

-rwxrwxrwx  1 root root 2147483648 09-20 19:55 pagefile.sys

drwxrwxrwx  1 root root       8192 09-20 19:53 Program Files

drwxrwxrwx  1 root root       4096 09-18 21:16 System Volume Information

drwxrwxrwx  1 root root       4096 09-20 19:20 totalcmd

drwxrwxrwx  1 root root      32768 09-20 19:35 WINDOWS
```

The big BUT is that unfortunatelly after rebooting the system, the new nodes are gone again  :Sad:  All the time I was thinking that this is an issue with the kernel configuration but maybe it's something about the system? Maybe with udev?

Best regards,

Crocodil

----------

## BradN

I think you may be right on that, udev is definitely suspect in such a situation.  Might be time for a bug report.  

I think there is a way to create persistent devices with udev, but I don't know it offhand.  It's not the "right" way to do things in any event, and could make things difficult if you change your raid configuration.

----------

## chabo

I've had similar problem after device-mapper was merged into LVM2, "/etc/init.d/lvm start" solve it.

----------

## Crocodil

 *chabo wrote:*   

> I've had similar problem after device-mapper was merged into LVM2, "/etc/init.d/lvm start" solve it.

 

Oh my God!   :Shocked:   :Shocked:   :Shocked:  A single command thet solved the problem! I'm not sure if I'm happy or mad - I couldn't use the raid in linux for over a week   :Confused:   Thank you so very much chabo!

Where did you get the information from? Do you know why LVM is needed for dmraid to work? If yes, maybe you could update the howto on wiki so that other people don't have this problem?

Best regards,

Crocodil

----------

## chabo

I've got answer here forums.gentoo.org/viewtopic-t-843254.html

best regards

----------

## BradN

Wow, I didn't think anything device mapper related should have been in lvm2.

----------

