Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm running Debian Wheezy on an SSD, and in addition I have two 500GB hard disks in Intel software RAID 0 (fakeraid). Both the SSD and the RAID array have GPT partition layouts. I have set up my fstab to automatically mount one of the partitions on the RAID array, but the root filesystem is on the SSD.

During boot, dmraid finds the array but does not automatically discover the partitions on it. This causes the boot fsck to fail and dumps me at a recovery shell.

Running kpartx -a /dev/mapper/isw_xxx_Volume0 at the recovery shell automatically discovers the partitions and everything works great, but it's a bit irritating having to type it in every time I boot. Am I doing something wrong? Is there some way to make the partition probing automatic?

Partition layout of /dev/sda (the SSD)

Number  Start (sector)    End (sector)  Size       Code  
   1            2048          411647   200.0 MiB   EF00  EFI System Partition
   2          411648       117598207   55.9 GiB    0700  Debian root filesystem
   3       117598208       250068991   63.2 GiB    0700  Not used yet

Partition layout of /dev/mapper/isw_cddhbifacg_Volume0 (the RAID array)

Number  Start (sector)    End (sector)  Size       Code  
   1            2048       937502719   447.0 GiB   0700  Debian extra stuff
   2       937502720       976564223   18.6 GiB    8200  Swap
   3       976564224      1953535999   465.9 GiB   0700  Not used yet

Contents of /etc/fstab

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
UUID=7f894df3-49f4-4119-bda9-f4734780eaab /               ext4    errors=remount-ro 0       1
UUID=0B6C-A37C  /boot/efi       vfat    defaults        0       1
/dev/mapper/isw_cddhbifacg_Volume0p1 /mnt/data       ext4    defaults        0       2
/dev/mapper/isw_cddhbifacg_Volume0p2 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/sdd1       /media/usb0     auto    rw,user,noauto  0       0
/dev/sde1       /media/usb1     auto    rw,user,noauto  0       0
/dev/sde2       /media/usb2     auto    rw,user,noauto  0       0
share|improve this question
    
If I understand correctly, the OS in on the SSD. Is it listed in /etc/fstab? Can you paste it somewhere and tell us what your partition layout is? –  schaiba Feb 22 '13 at 13:29
    
The OS is indeed on the SSD, and yes it is listed in fstab. The system works fine if I skip running kpartx, it just doesn't let me access the RAID array. I'll update the question with the partition layouts in a moment. –  robinjam Feb 22 '13 at 13:35
add comment

3 Answers

This seems to be a bug in Debian. You need to fix the udev rules of kpartx.

Look here for the required steps.

For more details, see the whole bug report on Launchpad and the related bug report in the Debian BTS.

share|improve this answer
    
Hm... I saw that first bug report and poked around a bit, but the /lib/udev/rules.d/95-kpartx.rules file is significantly different on Debian so it's difficult to make the same changes without breaking things. I'll try out the suggestion on the BTS. –  robinjam Feb 22 '13 at 13:53
    
That worked after a small amount of tweaking. I'll put together a list of what I did in case anyone else runs into the same problem. Thanks very much for your help. –  robinjam Feb 22 '13 at 13:59
add comment
up vote 1 down vote accepted

Solution to the original problem

Install kpartx:

sudo aptitude install kpartx

Change these lines in /lib/udev/rules.d/60-kpartx.rules:

ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="dmraid-*", \
        RUN+="/sbin/kpartx -a -p -part /dev/$name"

to this:

ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="DMRAID-*", \
        RUN+="/sbin/kpartx -a /dev/$name"

Update the initramfs:

sudo update-initramfs -u

Restart and the partitions should have been detected properly.

Alternative solution

Use mdadm instead of dmraid. Set up the RAID array using the Intel configuration utility (Ctrl+I during boot), and Debian Installer 7 RC1 will detect and activate it automatically.

share|improve this answer
    
Why update Grub? –  Hauke Laging Feb 22 '13 at 16:48
    
@HaukeLaging: Probably not necessary, but I threw it in just in case... –  robinjam Feb 22 '13 at 20:45
add comment

You can simply install the Ubuntu version of the dmraid package, as it has a proper udev rule to do this, as well as having the initramfs tell dmraid not to even bother trying to activate partitions.

Or you might stop using dmraid entirely as recent versions of mdadm can activate intel fakeraids, or better yet, stop using the fakeraid at all and just switch to normal software mdadm based raid.

share|improve this answer
    
"stop using the fakeraid at all and just switch to normal software mdadm based raid" - Not really an option since I want to share the array with a Windows installation. "You can simply install the Ubuntu version of the dmraid package" - I might end up doing that at some point, but it's working alright for now. –  robinjam Feb 22 '13 at 15:00
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.