Find the answer to your Linux question:
Results 1 to 7 of 7
Hey, everyone - I posted over at the Ubuntu forums as well, but I seemed to have stumped them. Since the googles have often led me to this for answers, ...
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    3

    Ubuntu 10.04 RAID5 recreation issue

    Hey, everyone - I posted over at the Ubuntu forums as well, but I seemed to have stumped them. Since the googles have often led me to this for answers, I figured I'd see if anyone here can help me.

    I just setup Ubuntu 10.04 as a dual boot on my system that also has 8.10. On the old install, I have a four disk software RAID5 setup through MDADM. Currently, the new install does not recognize it, which I realize is because the disks aren't bundled as a recognized RAID through MDADM yet.

    How would I go about recreating this without losing the data on the array? I could go through the steps I used (if I can find them) when I first set up the array, but I am very paranoid that I would go one step too far and wipe everything - therefore, I figured that I'd get input here first.

    The four drives are currently:

    /dev/sdb
    /dev/sdc
    /dev/sdd
    /dev/sdf

    Before, they were bundled in a RAID5 as /dev/md1 and then mounted at /media/raid


    I think this is how I would do it:

    Code:

    sudo mdadm --create --verbose /dev/md1 --level=5 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sdf1
    I'm just not 100% that this will create the array with the data intact.

    Please help if you can. It would be greatly appreciated.

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    man mdadm

    Code:
    mdadm has 7 major modes of operation:
     
          Assemble
                 Assemble the parts of a previously created array into an  active
                 array.  Components  can  be  explicitly given or can be searched
                 for.  mdadm checks that the  components  do  form  a  bona  fide
                 array,  and can, on request, fiddle superblock information so as
                 to assemble a faulty array.

  3. #3
    Just Joined!
    Join Date
    Aug 2010
    Posts
    3
    Thank you for your response. Yes, I know that it can do it, I was mainly wondering if my syntax above is correct for what I am trying to do.

    EDIT:

    This section here seems to say "yes," but again, I want to be 100% before I risk losing everything I have in that array.

    Code:
     As  devices  are  added,  they  are checked to see if they contain raid
          superblocks or filesystems. They are also checked to see if  the  vari-
          ance in device size exceeds 1%.

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    NO.

    Code:
    Create Create a new array with per-device superblocks.
    Code:
     Assemble
                 Assemble the parts of a previously created array into an  active
                 array.

  5. #5
    Just Joined!
    Join Date
    Aug 2010
    Posts
    3
    Okay, now we're getting somewhere.

    In this case, would my code be something like:

    Code:
    sudo mdadm --assemble --verbose /dev/md1 --level=5 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sdf1
    or, do I not need the --level=5 --raid-devices=4 part, because it is already marked on the drives?

    I am also unsure about the --scan option, as I have never used it before. Does its usage negate the need for other parts in the line, such as the list of drive names? I'm not sure how it fits in, because in the man pages, the examples don't remove anything, they just add it in. For example, I would read it as needing to do this:

    Code:
    sudo mdadm --assemble --verbose --scan /dev/md1 --level=5 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sdf1
    If so, I'm not sure what I'm gaining by including it, or missing out by not including it.

  6. #6
    Just Joined! jippie's Avatar
    Join Date
    May 2006
    Location
    Eindhoven, the Netherlands
    Posts
    76
    whenever I have problems with my RAID array not automatically being started [because of a failing motherboard], I issue the following command:

    Code:
    mdamd --assemble --scan --force /dev/mdX
    Check status with:

    Code:
    watch cat /proc/mdstat
    Hope this helps

  7. #7
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    274
    In your case, I would try first (as root)

    # mdadm --auto-detect

    Code:
           --auto-detect
                  Request that the kernel starts any auto-detected arrays.  This can only work if md is  compiled  into
                  the  kernel — not if it is a module.  Arrays can be auto-detected by the kernel if all the components
                  are in primary MS-DOS partitions with partition type FD.  In-kernel autodetect is not recommended for
                  new  installations.   Using mdadm to detect and assemble arrays — possibly in an initrd — is substan‐
                  tially more flexible and should be preferred.
    Regards
    Luis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...