linux - Ubuntu raid configuration lost after reboot

23
2014-04
  • axel22

    I have a JMicron raid controller on the motherboard, and I have a menu in which I can set RAID arrays when the system boots. I've set it to RAID-1 and added my two identical 2TB disks (the OS disk is separate).

    In Ubuntu, in the Disk Utility, I could see these 2 hard disks and I could see an additional entry under Peripheral devices which was a 2TB disk. I assumed that this is some sort of a virtual view over my RAID array.

    I used the Format Volume option to format (NTFS) the 2TB disk listed under Peripheral devices. It appeared as a mounted device in the /media/data_raid. I've copied most of the files there and it worked fine.

    I've rebooted the system, and now I suddenly see an additional 3 disks in peripheral devices, which doesn't make sense. Also, I can no longer mount the /media/data_raid - clicking on it in Gnome yields the following error message.

    "One or more block devices are holding /dev/dm-0"
    

    This is how things look in Disk Utility:

    the original drive

    the newly appeared drive

    There are additional 3 entries in /dev/mapper for some reason:

    ~$ ls -l /dev/mapper
    total 0
    crw------- 1 root root 10, 236 2012-05-01 20:01 control
    lrwxrwxrwx 1 root root       7 2012-05-01 20:15 isw_bjcjaghhjj_DATA -> ../dm-0
    lrwxrwxrwx 1 root root       7 2012-05-01 20:01 isw_bjcjaghhjj_DATA1 -> ../dm-1
    lrwxrwxrwx 1 root root       7 2012-05-01 20:01 isw_bjcjaghhjj_DATA2 -> ../dm-2
    lrwxrwxrwx 1 root root       7 2012-05-01 20:01 isw_bjcjaghhjj_DATA3 -> ../dm-3
    

    Can you help me resolve this issue and obtain access to my RAID array again?

    Thank you.

    EDIT:

    There is no mdadm.conf in /etc/.

    In /etc/fstab/:

    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    nodev,noexec,nosuid 0       0
    # / was on /dev/sda1 during installation
    UUID=8e466cac-6543-48dc-aedf-ce378375053b /               ext4    errors=remount-ro 0       1
    # swap was on /dev/sda3 during installation
    UUID=f80e449c-4212-45e6-939c-f16a55ae8ad5 none            swap    sw              0       0
    
  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    linux - In Ubuntu, how to get email notifications about (software) RAID problems?
  • Jonik

    I know getting email notifications should be possible, and perhaps even enabled by default... But how to make sure alerts are properly configured, and if, for any reason, they arent't, how to set them up?

    (I think it's not enabled on my machine, because earlier when I had some disk problems it turned out one of the disks had been long been off the RAID, and the one remaining in it got broken...)

    So, instead of periodically checking /proc/mdstat on my workstation to see that all RAID devices are nicely [UU]...

    $ cat /proc/mdstat
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] ...
    md1 : active raid1 sda3[0] sdb3[1]
          195310144 blocks [2/2] [UU]
    
    md0 : active raid1 sda1[0] sdb1[1]
          144448 blocks [2/2] [UU]
    

    ...how to set it up so that any irregularities are reported automatically by email? Specifically, I mean the situation that one disk "falls off" the RAID 1 array, for one reason or another, which shows up as something like [2/1] [U_] in /proc/mdstat. Also, instead of it sending email to local (root) user, can you configure an arbitrary email address?

    I'm using Ubuntu 8.04 (aka Hardy). Tell me if I should add more details about the workstation or RAID setup.


  • Related Answers
  • TRS-80

    Add MAILADDR [email protected] to /etc/mdadm/mdadm.conf, then /etc/init.d/mdadm restart or it'll just start on next boot. There's also a munin plugin if you're running munin with email alerts.

  • 8088

    I found a nice tip closely related to my question, and wanted to share it:

    TomTheGeek: Pop up notification of software RAID problems in Ubuntu

    It's not about email notifications, but as the blog post says, pop-up notifications (like in screenshot below) might be even better when we're talking about a workstation.

    alt text

    I'll summarise the main points here (in case that blog ever disappears). This uses notify-send, so you need to install notification-daemon package. Basically you add this in /etc/mdadm/mdadm.conf (along with MAILADDR):

    # display local notification
    PROGRAM /usr/sbin/mdadm-notify.sh
    

    ...and the mdadm-notify.sh script should be something like:

    #!/bin/bash
    
    #get dbus session
    eval `dbus-launch --sh-syntax --exit-with-session`
    
    #show alert
    /usr/bin/notify-send -u critical -c device.error -i /usr/share/icons/Human/32x32/status/dialog-warning.png -t 0 "RAID Status" "<b>$2</b>: $1" -h int:x:1250 -h int:y:20
    
  • Abhinav

    You could write a cron job to scrape the output above and send a mail if something is wrong.