CentOS 7 created mdadm array disappears after reboot Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionmdadm - RAID5 array size vs. actual disk size mismatchmdadm raid 5 missing partitions after rebootResize MDADM/Software RAID underlying partition and filesystemCentos missing ext3.korgmanager [fs] start_filesystem: Could not match “f6a58cf7-b39b-489c-add5-444ceab8af9d” with a real deviceUbuntu: RAID 10 degrades to RAID 0 after reboot?Help with mdadm will not reassembleRebuilding mdadm RAID 5 array with multiple failed drivesLVM: PV missing after rebootMDADM can't automount existing RAID1 array

I'm thinking of a number

What computer would be fastest for Mathematica Home Edition?

What are the performance impacts of 'functional' Rust?

Losing the Initialization Vector in Cipher Block Chaining

How can I make names more distinctive without making them longer?

What items from the Roman-age tech-level could be used to deter all creatures from entering a small area?

What's the difference between (size_t)-1 and ~0?

Did the new image of black hole confirm the general theory of relativity?

Why does this iterative way of solving of equation work?

Biased dice probability question

What was the last x86 CPU that did not have the x87 floating-point unit built in?

The following signatures were invalid: EXPKEYSIG 1397BC53640DB551

Keep going mode for require-package

Autumning in love

Need a suitable toxic chemical for a murder plot in my novel

What is the largest species of polychaete?

How do I keep my slimes from escaping their pens?

Unable to start mainnet node docker container

Using "nakedly" instead of "with nothing on"

Two different pronunciation of "понял"

Active filter with series inductor and resistor - do these exist?

Is it possible to ask for a hotel room without minibar/extra services?

How are presidential pardons supposed to be used?

Can I throw a longsword at someone?



CentOS 7 created mdadm array disappears after reboot



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionmdadm - RAID5 array size vs. actual disk size mismatchmdadm raid 5 missing partitions after rebootResize MDADM/Software RAID underlying partition and filesystemCentos missing ext3.korgmanager [fs] start_filesystem: Could not match “f6a58cf7-b39b-489c-add5-444ceab8af9d” with a real deviceUbuntu: RAID 10 degrades to RAID 0 after reboot?Help with mdadm will not reassembleRebuilding mdadm RAID 5 array with multiple failed drivesLVM: PV missing after rebootMDADM can't automount existing RAID1 array



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I created a raid1 using the below disks and command:



$ ls -l /dev/disk/by-id/ata-ST3000*
lrwxrwxrwx 1 root root 9 Sep 19 07:27 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1 -> ../../sdc
lrwxrwxrwx 1 root root 9 Sep 19 07:27 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 -> ../../sda

$ mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1


I added the pertinent information to mdadm.conf. I used 'mdadm --detail --scan >> /etc/mdadm.conf' for the ARRAY line:



$ cat /etc/mdadm.conf
DEVICE /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3
DEVICE /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1
ARRAY /dev/md0 metadata=1.2 name=jaime.WORKGROUP:0 UUID=93f2cb73:2d124630:562f1dd9:bf189029
MAILADDR your@address


I created and mounted the filesystem:



$ mkfs -t xfs /dev/md0
$ mount -t xfs /dev/md0 /data


After rebooting, /dev/md0 no longer exists and I can't assemble the array:



$ mdadm --assemble /dev/md0 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1
mdadm: Cannot assemble mbr metadata on /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3
mdadm: /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 has no superblock - assembly aborted



$ blkid
/dev/sda: PTTYPE="gpt"
/dev/sdb1: UUID="5c7d3f2b-c975-46a3-a116-e9fc156c1de5" TYPE="xfs"
/dev/sdb2: UUID="JhoqjI-N6R6-O9zt-Xumq-TnFX-OUCd-Lg9YHy" TYPE="LVM2_member"
/dev/sdc: PTTYPE="gpt"
/dev/mapper/centos-swap: UUID="3b882d4d-b900-4c59-9912-60a413699db4" TYPE="swap"
/dev/mapper/centos-root: UUID="08df953d-d4f4-4e83-bf4b-41f14a98a12e" TYPE="xfs"
/dev/mapper/centos-home: UUID="2358f723-5e7f-49ed-b207-f32fe34b1bbc" TYPE="xfs"









share|improve this question
























  • Confirm that the drives are there and identified by the kernel to start. blkid or lsblk. Also look in the output of dmesg for any messages related to the RAID.

    – slm
    Sep 19 '14 at 15:23












  • Also I've never seen the /dev/disk/by-id/... used when constructing RAIDs. You typically use /dev/sda1 /dev/sdb1, where these are partitions on the device that were created using parted, fdisk, or gdisk.

    – slm
    Sep 19 '14 at 15:28











  • So which HDDs in that list are the RAIDs?

    – slm
    Sep 19 '14 at 15:30











  • Using /dev/sdXX will cause problems when you add drives to the system and those identifiers change. I read a LOT on this over the past week or so and it seems like the recommendation is to use either the by-id identifier or the by-uuid identifier. Also, I've seen arrays created both on partitions and on raw devices. I can't seem to find any hard fast best practices on these points...

    – uwsublime
    Sep 19 '14 at 15:30











  • /dev/sda and /dev/sdc are the RAID drives.

    – uwsublime
    Sep 19 '14 at 15:32

















2















I created a raid1 using the below disks and command:



$ ls -l /dev/disk/by-id/ata-ST3000*
lrwxrwxrwx 1 root root 9 Sep 19 07:27 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1 -> ../../sdc
lrwxrwxrwx 1 root root 9 Sep 19 07:27 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 -> ../../sda

$ mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1


I added the pertinent information to mdadm.conf. I used 'mdadm --detail --scan >> /etc/mdadm.conf' for the ARRAY line:



$ cat /etc/mdadm.conf
DEVICE /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3
DEVICE /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1
ARRAY /dev/md0 metadata=1.2 name=jaime.WORKGROUP:0 UUID=93f2cb73:2d124630:562f1dd9:bf189029
MAILADDR your@address


I created and mounted the filesystem:



$ mkfs -t xfs /dev/md0
$ mount -t xfs /dev/md0 /data


After rebooting, /dev/md0 no longer exists and I can't assemble the array:



$ mdadm --assemble /dev/md0 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1
mdadm: Cannot assemble mbr metadata on /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3
mdadm: /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 has no superblock - assembly aborted



$ blkid
/dev/sda: PTTYPE="gpt"
/dev/sdb1: UUID="5c7d3f2b-c975-46a3-a116-e9fc156c1de5" TYPE="xfs"
/dev/sdb2: UUID="JhoqjI-N6R6-O9zt-Xumq-TnFX-OUCd-Lg9YHy" TYPE="LVM2_member"
/dev/sdc: PTTYPE="gpt"
/dev/mapper/centos-swap: UUID="3b882d4d-b900-4c59-9912-60a413699db4" TYPE="swap"
/dev/mapper/centos-root: UUID="08df953d-d4f4-4e83-bf4b-41f14a98a12e" TYPE="xfs"
/dev/mapper/centos-home: UUID="2358f723-5e7f-49ed-b207-f32fe34b1bbc" TYPE="xfs"









share|improve this question
























  • Confirm that the drives are there and identified by the kernel to start. blkid or lsblk. Also look in the output of dmesg for any messages related to the RAID.

    – slm
    Sep 19 '14 at 15:23












  • Also I've never seen the /dev/disk/by-id/... used when constructing RAIDs. You typically use /dev/sda1 /dev/sdb1, where these are partitions on the device that were created using parted, fdisk, or gdisk.

    – slm
    Sep 19 '14 at 15:28











  • So which HDDs in that list are the RAIDs?

    – slm
    Sep 19 '14 at 15:30











  • Using /dev/sdXX will cause problems when you add drives to the system and those identifiers change. I read a LOT on this over the past week or so and it seems like the recommendation is to use either the by-id identifier or the by-uuid identifier. Also, I've seen arrays created both on partitions and on raw devices. I can't seem to find any hard fast best practices on these points...

    – uwsublime
    Sep 19 '14 at 15:30











  • /dev/sda and /dev/sdc are the RAID drives.

    – uwsublime
    Sep 19 '14 at 15:32













2












2








2








I created a raid1 using the below disks and command:



$ ls -l /dev/disk/by-id/ata-ST3000*
lrwxrwxrwx 1 root root 9 Sep 19 07:27 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1 -> ../../sdc
lrwxrwxrwx 1 root root 9 Sep 19 07:27 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 -> ../../sda

$ mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1


I added the pertinent information to mdadm.conf. I used 'mdadm --detail --scan >> /etc/mdadm.conf' for the ARRAY line:



$ cat /etc/mdadm.conf
DEVICE /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3
DEVICE /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1
ARRAY /dev/md0 metadata=1.2 name=jaime.WORKGROUP:0 UUID=93f2cb73:2d124630:562f1dd9:bf189029
MAILADDR your@address


I created and mounted the filesystem:



$ mkfs -t xfs /dev/md0
$ mount -t xfs /dev/md0 /data


After rebooting, /dev/md0 no longer exists and I can't assemble the array:



$ mdadm --assemble /dev/md0 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1
mdadm: Cannot assemble mbr metadata on /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3
mdadm: /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 has no superblock - assembly aborted



$ blkid
/dev/sda: PTTYPE="gpt"
/dev/sdb1: UUID="5c7d3f2b-c975-46a3-a116-e9fc156c1de5" TYPE="xfs"
/dev/sdb2: UUID="JhoqjI-N6R6-O9zt-Xumq-TnFX-OUCd-Lg9YHy" TYPE="LVM2_member"
/dev/sdc: PTTYPE="gpt"
/dev/mapper/centos-swap: UUID="3b882d4d-b900-4c59-9912-60a413699db4" TYPE="swap"
/dev/mapper/centos-root: UUID="08df953d-d4f4-4e83-bf4b-41f14a98a12e" TYPE="xfs"
/dev/mapper/centos-home: UUID="2358f723-5e7f-49ed-b207-f32fe34b1bbc" TYPE="xfs"









share|improve this question
















I created a raid1 using the below disks and command:



$ ls -l /dev/disk/by-id/ata-ST3000*
lrwxrwxrwx 1 root root 9 Sep 19 07:27 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1 -> ../../sdc
lrwxrwxrwx 1 root root 9 Sep 19 07:27 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 -> ../../sda

$ mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1


I added the pertinent information to mdadm.conf. I used 'mdadm --detail --scan >> /etc/mdadm.conf' for the ARRAY line:



$ cat /etc/mdadm.conf
DEVICE /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3
DEVICE /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1
ARRAY /dev/md0 metadata=1.2 name=jaime.WORKGROUP:0 UUID=93f2cb73:2d124630:562f1dd9:bf189029
MAILADDR your@address


I created and mounted the filesystem:



$ mkfs -t xfs /dev/md0
$ mount -t xfs /dev/md0 /data


After rebooting, /dev/md0 no longer exists and I can't assemble the array:



$ mdadm --assemble /dev/md0 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F04NR1
mdadm: Cannot assemble mbr metadata on /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3
mdadm: /dev/disk/by-id/ata-ST3000DM001-9YN166_Z1F190E3 has no superblock - assembly aborted



$ blkid
/dev/sda: PTTYPE="gpt"
/dev/sdb1: UUID="5c7d3f2b-c975-46a3-a116-e9fc156c1de5" TYPE="xfs"
/dev/sdb2: UUID="JhoqjI-N6R6-O9zt-Xumq-TnFX-OUCd-Lg9YHy" TYPE="LVM2_member"
/dev/sdc: PTTYPE="gpt"
/dev/mapper/centos-swap: UUID="3b882d4d-b900-4c59-9912-60a413699db4" TYPE="swap"
/dev/mapper/centos-root: UUID="08df953d-d4f4-4e83-bf4b-41f14a98a12e" TYPE="xfs"
/dev/mapper/centos-home: UUID="2358f723-5e7f-49ed-b207-f32fe34b1bbc" TYPE="xfs"






linux centos mdadm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 17 hours ago









Rui F Ribeiro

42.1k1483142




42.1k1483142










asked Sep 19 '14 at 14:49









uwsublimeuwsublime

1113




1113












  • Confirm that the drives are there and identified by the kernel to start. blkid or lsblk. Also look in the output of dmesg for any messages related to the RAID.

    – slm
    Sep 19 '14 at 15:23












  • Also I've never seen the /dev/disk/by-id/... used when constructing RAIDs. You typically use /dev/sda1 /dev/sdb1, where these are partitions on the device that were created using parted, fdisk, or gdisk.

    – slm
    Sep 19 '14 at 15:28











  • So which HDDs in that list are the RAIDs?

    – slm
    Sep 19 '14 at 15:30











  • Using /dev/sdXX will cause problems when you add drives to the system and those identifiers change. I read a LOT on this over the past week or so and it seems like the recommendation is to use either the by-id identifier or the by-uuid identifier. Also, I've seen arrays created both on partitions and on raw devices. I can't seem to find any hard fast best practices on these points...

    – uwsublime
    Sep 19 '14 at 15:30











  • /dev/sda and /dev/sdc are the RAID drives.

    – uwsublime
    Sep 19 '14 at 15:32

















  • Confirm that the drives are there and identified by the kernel to start. blkid or lsblk. Also look in the output of dmesg for any messages related to the RAID.

    – slm
    Sep 19 '14 at 15:23












  • Also I've never seen the /dev/disk/by-id/... used when constructing RAIDs. You typically use /dev/sda1 /dev/sdb1, where these are partitions on the device that were created using parted, fdisk, or gdisk.

    – slm
    Sep 19 '14 at 15:28











  • So which HDDs in that list are the RAIDs?

    – slm
    Sep 19 '14 at 15:30











  • Using /dev/sdXX will cause problems when you add drives to the system and those identifiers change. I read a LOT on this over the past week or so and it seems like the recommendation is to use either the by-id identifier or the by-uuid identifier. Also, I've seen arrays created both on partitions and on raw devices. I can't seem to find any hard fast best practices on these points...

    – uwsublime
    Sep 19 '14 at 15:30











  • /dev/sda and /dev/sdc are the RAID drives.

    – uwsublime
    Sep 19 '14 at 15:32
















Confirm that the drives are there and identified by the kernel to start. blkid or lsblk. Also look in the output of dmesg for any messages related to the RAID.

– slm
Sep 19 '14 at 15:23






Confirm that the drives are there and identified by the kernel to start. blkid or lsblk. Also look in the output of dmesg for any messages related to the RAID.

– slm
Sep 19 '14 at 15:23














Also I've never seen the /dev/disk/by-id/... used when constructing RAIDs. You typically use /dev/sda1 /dev/sdb1, where these are partitions on the device that were created using parted, fdisk, or gdisk.

– slm
Sep 19 '14 at 15:28





Also I've never seen the /dev/disk/by-id/... used when constructing RAIDs. You typically use /dev/sda1 /dev/sdb1, where these are partitions on the device that were created using parted, fdisk, or gdisk.

– slm
Sep 19 '14 at 15:28













So which HDDs in that list are the RAIDs?

– slm
Sep 19 '14 at 15:30





So which HDDs in that list are the RAIDs?

– slm
Sep 19 '14 at 15:30













Using /dev/sdXX will cause problems when you add drives to the system and those identifiers change. I read a LOT on this over the past week or so and it seems like the recommendation is to use either the by-id identifier or the by-uuid identifier. Also, I've seen arrays created both on partitions and on raw devices. I can't seem to find any hard fast best practices on these points...

– uwsublime
Sep 19 '14 at 15:30





Using /dev/sdXX will cause problems when you add drives to the system and those identifiers change. I read a LOT on this over the past week or so and it seems like the recommendation is to use either the by-id identifier or the by-uuid identifier. Also, I've seen arrays created both on partitions and on raw devices. I can't seem to find any hard fast best practices on these points...

– uwsublime
Sep 19 '14 at 15:30













/dev/sda and /dev/sdc are the RAID drives.

– uwsublime
Sep 19 '14 at 15:32





/dev/sda and /dev/sdc are the RAID drives.

– uwsublime
Sep 19 '14 at 15:32










6 Answers
6






active

oldest

votes


















1














In theory, one can make raids out of "bare drives" (non-partitioned), but I noticed your disks are showing up as gpt-partitioned, not md drives. In general, I've found better success / stability by partitioning my disk, and then using partitions in my md arrays.



I'd try creating a partition table, setting the partition type as linux raid autodetect (fd in fdisk if I recall correctly). Then recreating your array.



Also, I found that if I did NOT use an mdadm.conf, I encountered better success. Modern versions of md tools will get all the information they need from the superblocks of the partitions involved.






share|improve this answer























  • Thank you for the suggestions. Can I use gdisk instead of fdisk? My partitions will be >2TB. Also, should I make the partitions fill the drive, or leave a little space. I don't recall why, but in the vast amount of reading I've done this week I think some people said to leave a bit of space outside of the partition.

    – uwsublime
    Sep 19 '14 at 20:04











  • gdisk shows this option: fd00 Linux RAID

    – uwsublime
    Sep 19 '14 at 20:08












  • I've gone forward with partitioning first and so far the results are good. I will update again once all of my arrays are in place... May be a few days. Thanks for the help all!

    – uwsublime
    Sep 19 '14 at 22:14











  • I've got all of my mirrored pools setup now on "Linux Raid" (fd00) partitions. I did not use an mdadm.conf file. All seems to be working great, even when moving drives to different SATA ports.

    – uwsublime
    Sep 23 '14 at 15:44


















1














For all you folks, I have found a workaround that works for me.. May be this may help you guys.. Here it is:



Raid mount disappears because the system is not reading the mdadm.conf file during boot or startup. So, what I did is I edited the /etc/rc.d/rc.local file to include the below commands:



sleep 10
mdadm --assemble --scan
sleep 10
mount -a


Now, everytime I reboot the system, it reads this file, run the commands mentioned in it and mount the raid mount..






share|improve this answer
































    1














    I came across this question which helped me a lot during troubleshooting. But none of the answers could solve my problem.



    So maybe this helps someone having the same issue. In my case I have two NVME drives on a RedHat Linux 7.2.



    SELinux has a problem with nvme and prevents mdadm to work with them.



    Symptoms:



    Create software RAID as described in the question of this thread. After a reboot the RAID is gone:




    • /proc/mdstat is empty and /dev/md0 does not exist


    • mdadm --assemble --scan brings the RAID up.

    Solution:



    I disabled selinux in my case. I know this is not possible on every system. But maybe you get in the right direction from my post.






    share|improve this answer






























      0














      The output of blkid shows you your problem - the drives weren't clean when you created them md device, and the old information is confusing things.



      Given that you created these without a partition table, the fact that blkid reports PTTYPE="gpt" for sda and sdc is the problem.



      If you do not (yet) have any data on the drives that you need to save, you can wipe out the GPT partition table with 'dd':



      $ sudo dd if=/dev/zero of=/dev/sda bs=1M count=10



      This will zero out the first 10 megabytes of /dev/sda. Repeat for /dev/sdc. Recreate the array after that, and then /dev/md0 should come up on boot.






      share|improve this answer
































        0














        It seems to be a better way to format the disk partitions with type fd (Linux raid autodetect), but watch for alignment messages in fdisk! I had those warnings and resolved them with then parted tool for creating the partitions and then using fdisk to set them to type 'fd'.
        Then do exactly as you did and the RAID device will form automatically at boot time. With an entry in /etc/fstab it will even be mounted...



        One caveat: Using /etc/mdadm.conf destroyed my RHEL7 3.10.0-514.6.1.el7.x86_6 system.






        share|improve this answer






























          0














          Usual caveats apply. Make sure your data was backed up. I'm not responsible for any data loss. This worked for me. Make sure to test your array before you put meaningful data on it. Make sure it can survive a reboot and device name changes, etc etc etc.



          Now off to what I did.



          I ran into the same issue today. After doing some searching I was able to fix this and get a stable raid device.



          On two disks I was using for my array I created a partition using gdisk before I created the RAID device. I deleted the partitions using gdisk but when I created the array I got the informational message below:



          mdadm: partition table exists on /dev/disk/by-id/ata-ST4000VN000-1H4168_Z30254QX but will be lost or meaningless after creating array


          Each time I saw this message when I rebooted the array would be lost.



          I figured I'd use Jim K's above suggestion and create a Linux raid partition on each drive. This worked but the sync rate went from 145MB/s on the raw drives to 35MB/s on the partitioned ones. I probably could have played with tuning parameters but why should I do that?



          I went on a quest to figure out how to nuke the drive partition table.



          The fix...



          First make sure your raid device is stopped , then nuke the drives raid signature.



          mdadm --stop /dev/md<number> 
          mdadm --zero-superblock /dev/sd<x> (do this for all your raid disks)


          Run blkid and see if any of the raid devices show up. If they do.



          run:



          dd if=/dev/zero of=/dev/sd<x> bs=512 count=1


          This will hopefully nuke the partition tables. Run blkid again to make sure no disks used for the raid device are listed.



          In my case gpt had a LVM label backed up on one disk. I cleaned this up using lvremove, vgremove, and finally pvremove.



          blkid ran clean this time.



          However when I tried creating the array again I got an error about an existing raid device so I did a dd one more time. After this the array created without notices like I listed above.



          I recreated the array as it was originally, I used disk/by-id instead of sd. Once the array was recreated the test partition I had created on the array came back intact.



          The array now survives reboots and changes to /dev/sd from when the array was originally created.






          share|improve this answer

























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f156424%2fcentos-7-created-mdadm-array-disappears-after-reboot%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            6 Answers
            6






            active

            oldest

            votes








            6 Answers
            6






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            In theory, one can make raids out of "bare drives" (non-partitioned), but I noticed your disks are showing up as gpt-partitioned, not md drives. In general, I've found better success / stability by partitioning my disk, and then using partitions in my md arrays.



            I'd try creating a partition table, setting the partition type as linux raid autodetect (fd in fdisk if I recall correctly). Then recreating your array.



            Also, I found that if I did NOT use an mdadm.conf, I encountered better success. Modern versions of md tools will get all the information they need from the superblocks of the partitions involved.






            share|improve this answer























            • Thank you for the suggestions. Can I use gdisk instead of fdisk? My partitions will be >2TB. Also, should I make the partitions fill the drive, or leave a little space. I don't recall why, but in the vast amount of reading I've done this week I think some people said to leave a bit of space outside of the partition.

              – uwsublime
              Sep 19 '14 at 20:04











            • gdisk shows this option: fd00 Linux RAID

              – uwsublime
              Sep 19 '14 at 20:08












            • I've gone forward with partitioning first and so far the results are good. I will update again once all of my arrays are in place... May be a few days. Thanks for the help all!

              – uwsublime
              Sep 19 '14 at 22:14











            • I've got all of my mirrored pools setup now on "Linux Raid" (fd00) partitions. I did not use an mdadm.conf file. All seems to be working great, even when moving drives to different SATA ports.

              – uwsublime
              Sep 23 '14 at 15:44















            1














            In theory, one can make raids out of "bare drives" (non-partitioned), but I noticed your disks are showing up as gpt-partitioned, not md drives. In general, I've found better success / stability by partitioning my disk, and then using partitions in my md arrays.



            I'd try creating a partition table, setting the partition type as linux raid autodetect (fd in fdisk if I recall correctly). Then recreating your array.



            Also, I found that if I did NOT use an mdadm.conf, I encountered better success. Modern versions of md tools will get all the information they need from the superblocks of the partitions involved.






            share|improve this answer























            • Thank you for the suggestions. Can I use gdisk instead of fdisk? My partitions will be >2TB. Also, should I make the partitions fill the drive, or leave a little space. I don't recall why, but in the vast amount of reading I've done this week I think some people said to leave a bit of space outside of the partition.

              – uwsublime
              Sep 19 '14 at 20:04











            • gdisk shows this option: fd00 Linux RAID

              – uwsublime
              Sep 19 '14 at 20:08












            • I've gone forward with partitioning first and so far the results are good. I will update again once all of my arrays are in place... May be a few days. Thanks for the help all!

              – uwsublime
              Sep 19 '14 at 22:14











            • I've got all of my mirrored pools setup now on "Linux Raid" (fd00) partitions. I did not use an mdadm.conf file. All seems to be working great, even when moving drives to different SATA ports.

              – uwsublime
              Sep 23 '14 at 15:44













            1












            1








            1







            In theory, one can make raids out of "bare drives" (non-partitioned), but I noticed your disks are showing up as gpt-partitioned, not md drives. In general, I've found better success / stability by partitioning my disk, and then using partitions in my md arrays.



            I'd try creating a partition table, setting the partition type as linux raid autodetect (fd in fdisk if I recall correctly). Then recreating your array.



            Also, I found that if I did NOT use an mdadm.conf, I encountered better success. Modern versions of md tools will get all the information they need from the superblocks of the partitions involved.






            share|improve this answer













            In theory, one can make raids out of "bare drives" (non-partitioned), but I noticed your disks are showing up as gpt-partitioned, not md drives. In general, I've found better success / stability by partitioning my disk, and then using partitions in my md arrays.



            I'd try creating a partition table, setting the partition type as linux raid autodetect (fd in fdisk if I recall correctly). Then recreating your array.



            Also, I found that if I did NOT use an mdadm.conf, I encountered better success. Modern versions of md tools will get all the information they need from the superblocks of the partitions involved.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 19 '14 at 19:52









            Jim KusznirJim Kusznir

            16612




            16612












            • Thank you for the suggestions. Can I use gdisk instead of fdisk? My partitions will be >2TB. Also, should I make the partitions fill the drive, or leave a little space. I don't recall why, but in the vast amount of reading I've done this week I think some people said to leave a bit of space outside of the partition.

              – uwsublime
              Sep 19 '14 at 20:04











            • gdisk shows this option: fd00 Linux RAID

              – uwsublime
              Sep 19 '14 at 20:08












            • I've gone forward with partitioning first and so far the results are good. I will update again once all of my arrays are in place... May be a few days. Thanks for the help all!

              – uwsublime
              Sep 19 '14 at 22:14











            • I've got all of my mirrored pools setup now on "Linux Raid" (fd00) partitions. I did not use an mdadm.conf file. All seems to be working great, even when moving drives to different SATA ports.

              – uwsublime
              Sep 23 '14 at 15:44

















            • Thank you for the suggestions. Can I use gdisk instead of fdisk? My partitions will be >2TB. Also, should I make the partitions fill the drive, or leave a little space. I don't recall why, but in the vast amount of reading I've done this week I think some people said to leave a bit of space outside of the partition.

              – uwsublime
              Sep 19 '14 at 20:04











            • gdisk shows this option: fd00 Linux RAID

              – uwsublime
              Sep 19 '14 at 20:08












            • I've gone forward with partitioning first and so far the results are good. I will update again once all of my arrays are in place... May be a few days. Thanks for the help all!

              – uwsublime
              Sep 19 '14 at 22:14











            • I've got all of my mirrored pools setup now on "Linux Raid" (fd00) partitions. I did not use an mdadm.conf file. All seems to be working great, even when moving drives to different SATA ports.

              – uwsublime
              Sep 23 '14 at 15:44
















            Thank you for the suggestions. Can I use gdisk instead of fdisk? My partitions will be >2TB. Also, should I make the partitions fill the drive, or leave a little space. I don't recall why, but in the vast amount of reading I've done this week I think some people said to leave a bit of space outside of the partition.

            – uwsublime
            Sep 19 '14 at 20:04





            Thank you for the suggestions. Can I use gdisk instead of fdisk? My partitions will be >2TB. Also, should I make the partitions fill the drive, or leave a little space. I don't recall why, but in the vast amount of reading I've done this week I think some people said to leave a bit of space outside of the partition.

            – uwsublime
            Sep 19 '14 at 20:04













            gdisk shows this option: fd00 Linux RAID

            – uwsublime
            Sep 19 '14 at 20:08






            gdisk shows this option: fd00 Linux RAID

            – uwsublime
            Sep 19 '14 at 20:08














            I've gone forward with partitioning first and so far the results are good. I will update again once all of my arrays are in place... May be a few days. Thanks for the help all!

            – uwsublime
            Sep 19 '14 at 22:14





            I've gone forward with partitioning first and so far the results are good. I will update again once all of my arrays are in place... May be a few days. Thanks for the help all!

            – uwsublime
            Sep 19 '14 at 22:14













            I've got all of my mirrored pools setup now on "Linux Raid" (fd00) partitions. I did not use an mdadm.conf file. All seems to be working great, even when moving drives to different SATA ports.

            – uwsublime
            Sep 23 '14 at 15:44





            I've got all of my mirrored pools setup now on "Linux Raid" (fd00) partitions. I did not use an mdadm.conf file. All seems to be working great, even when moving drives to different SATA ports.

            – uwsublime
            Sep 23 '14 at 15:44













            1














            For all you folks, I have found a workaround that works for me.. May be this may help you guys.. Here it is:



            Raid mount disappears because the system is not reading the mdadm.conf file during boot or startup. So, what I did is I edited the /etc/rc.d/rc.local file to include the below commands:



            sleep 10
            mdadm --assemble --scan
            sleep 10
            mount -a


            Now, everytime I reboot the system, it reads this file, run the commands mentioned in it and mount the raid mount..






            share|improve this answer





























              1














              For all you folks, I have found a workaround that works for me.. May be this may help you guys.. Here it is:



              Raid mount disappears because the system is not reading the mdadm.conf file during boot or startup. So, what I did is I edited the /etc/rc.d/rc.local file to include the below commands:



              sleep 10
              mdadm --assemble --scan
              sleep 10
              mount -a


              Now, everytime I reboot the system, it reads this file, run the commands mentioned in it and mount the raid mount..






              share|improve this answer



























                1












                1








                1







                For all you folks, I have found a workaround that works for me.. May be this may help you guys.. Here it is:



                Raid mount disappears because the system is not reading the mdadm.conf file during boot or startup. So, what I did is I edited the /etc/rc.d/rc.local file to include the below commands:



                sleep 10
                mdadm --assemble --scan
                sleep 10
                mount -a


                Now, everytime I reboot the system, it reads this file, run the commands mentioned in it and mount the raid mount..






                share|improve this answer















                For all you folks, I have found a workaround that works for me.. May be this may help you guys.. Here it is:



                Raid mount disappears because the system is not reading the mdadm.conf file during boot or startup. So, what I did is I edited the /etc/rc.d/rc.local file to include the below commands:



                sleep 10
                mdadm --assemble --scan
                sleep 10
                mount -a


                Now, everytime I reboot the system, it reads this file, run the commands mentioned in it and mount the raid mount..







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 29 '16 at 20:34









                HalosGhost

                3,80392236




                3,80392236










                answered Nov 29 '16 at 20:04









                user3416955user3416955

                111




                111





















                    1














                    I came across this question which helped me a lot during troubleshooting. But none of the answers could solve my problem.



                    So maybe this helps someone having the same issue. In my case I have two NVME drives on a RedHat Linux 7.2.



                    SELinux has a problem with nvme and prevents mdadm to work with them.



                    Symptoms:



                    Create software RAID as described in the question of this thread. After a reboot the RAID is gone:




                    • /proc/mdstat is empty and /dev/md0 does not exist


                    • mdadm --assemble --scan brings the RAID up.

                    Solution:



                    I disabled selinux in my case. I know this is not possible on every system. But maybe you get in the right direction from my post.






                    share|improve this answer



























                      1














                      I came across this question which helped me a lot during troubleshooting. But none of the answers could solve my problem.



                      So maybe this helps someone having the same issue. In my case I have two NVME drives on a RedHat Linux 7.2.



                      SELinux has a problem with nvme and prevents mdadm to work with them.



                      Symptoms:



                      Create software RAID as described in the question of this thread. After a reboot the RAID is gone:




                      • /proc/mdstat is empty and /dev/md0 does not exist


                      • mdadm --assemble --scan brings the RAID up.

                      Solution:



                      I disabled selinux in my case. I know this is not possible on every system. But maybe you get in the right direction from my post.






                      share|improve this answer

























                        1












                        1








                        1







                        I came across this question which helped me a lot during troubleshooting. But none of the answers could solve my problem.



                        So maybe this helps someone having the same issue. In my case I have two NVME drives on a RedHat Linux 7.2.



                        SELinux has a problem with nvme and prevents mdadm to work with them.



                        Symptoms:



                        Create software RAID as described in the question of this thread. After a reboot the RAID is gone:




                        • /proc/mdstat is empty and /dev/md0 does not exist


                        • mdadm --assemble --scan brings the RAID up.

                        Solution:



                        I disabled selinux in my case. I know this is not possible on every system. But maybe you get in the right direction from my post.






                        share|improve this answer













                        I came across this question which helped me a lot during troubleshooting. But none of the answers could solve my problem.



                        So maybe this helps someone having the same issue. In my case I have two NVME drives on a RedHat Linux 7.2.



                        SELinux has a problem with nvme and prevents mdadm to work with them.



                        Symptoms:



                        Create software RAID as described in the question of this thread. After a reboot the RAID is gone:




                        • /proc/mdstat is empty and /dev/md0 does not exist


                        • mdadm --assemble --scan brings the RAID up.

                        Solution:



                        I disabled selinux in my case. I know this is not possible on every system. But maybe you get in the right direction from my post.







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Feb 27 '17 at 16:28









                        ora-600ora-600

                        1135




                        1135





















                            0














                            The output of blkid shows you your problem - the drives weren't clean when you created them md device, and the old information is confusing things.



                            Given that you created these without a partition table, the fact that blkid reports PTTYPE="gpt" for sda and sdc is the problem.



                            If you do not (yet) have any data on the drives that you need to save, you can wipe out the GPT partition table with 'dd':



                            $ sudo dd if=/dev/zero of=/dev/sda bs=1M count=10



                            This will zero out the first 10 megabytes of /dev/sda. Repeat for /dev/sdc. Recreate the array after that, and then /dev/md0 should come up on boot.






                            share|improve this answer





























                              0














                              The output of blkid shows you your problem - the drives weren't clean when you created them md device, and the old information is confusing things.



                              Given that you created these without a partition table, the fact that blkid reports PTTYPE="gpt" for sda and sdc is the problem.



                              If you do not (yet) have any data on the drives that you need to save, you can wipe out the GPT partition table with 'dd':



                              $ sudo dd if=/dev/zero of=/dev/sda bs=1M count=10



                              This will zero out the first 10 megabytes of /dev/sda. Repeat for /dev/sdc. Recreate the array after that, and then /dev/md0 should come up on boot.






                              share|improve this answer



























                                0












                                0








                                0







                                The output of blkid shows you your problem - the drives weren't clean when you created them md device, and the old information is confusing things.



                                Given that you created these without a partition table, the fact that blkid reports PTTYPE="gpt" for sda and sdc is the problem.



                                If you do not (yet) have any data on the drives that you need to save, you can wipe out the GPT partition table with 'dd':



                                $ sudo dd if=/dev/zero of=/dev/sda bs=1M count=10



                                This will zero out the first 10 megabytes of /dev/sda. Repeat for /dev/sdc. Recreate the array after that, and then /dev/md0 should come up on boot.






                                share|improve this answer















                                The output of blkid shows you your problem - the drives weren't clean when you created them md device, and the old information is confusing things.



                                Given that you created these without a partition table, the fact that blkid reports PTTYPE="gpt" for sda and sdc is the problem.



                                If you do not (yet) have any data on the drives that you need to save, you can wipe out the GPT partition table with 'dd':



                                $ sudo dd if=/dev/zero of=/dev/sda bs=1M count=10



                                This will zero out the first 10 megabytes of /dev/sda. Repeat for /dev/sdc. Recreate the array after that, and then /dev/md0 should come up on boot.







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Oct 1 '14 at 23:37









                                slm

                                256k71544690




                                256k71544690










                                answered Oct 1 '14 at 23:32









                                samsonsamson

                                43142




                                43142





















                                    0














                                    It seems to be a better way to format the disk partitions with type fd (Linux raid autodetect), but watch for alignment messages in fdisk! I had those warnings and resolved them with then parted tool for creating the partitions and then using fdisk to set them to type 'fd'.
                                    Then do exactly as you did and the RAID device will form automatically at boot time. With an entry in /etc/fstab it will even be mounted...



                                    One caveat: Using /etc/mdadm.conf destroyed my RHEL7 3.10.0-514.6.1.el7.x86_6 system.






                                    share|improve this answer



























                                      0














                                      It seems to be a better way to format the disk partitions with type fd (Linux raid autodetect), but watch for alignment messages in fdisk! I had those warnings and resolved them with then parted tool for creating the partitions and then using fdisk to set them to type 'fd'.
                                      Then do exactly as you did and the RAID device will form automatically at boot time. With an entry in /etc/fstab it will even be mounted...



                                      One caveat: Using /etc/mdadm.conf destroyed my RHEL7 3.10.0-514.6.1.el7.x86_6 system.






                                      share|improve this answer

























                                        0












                                        0








                                        0







                                        It seems to be a better way to format the disk partitions with type fd (Linux raid autodetect), but watch for alignment messages in fdisk! I had those warnings and resolved them with then parted tool for creating the partitions and then using fdisk to set them to type 'fd'.
                                        Then do exactly as you did and the RAID device will form automatically at boot time. With an entry in /etc/fstab it will even be mounted...



                                        One caveat: Using /etc/mdadm.conf destroyed my RHEL7 3.10.0-514.6.1.el7.x86_6 system.






                                        share|improve this answer













                                        It seems to be a better way to format the disk partitions with type fd (Linux raid autodetect), but watch for alignment messages in fdisk! I had those warnings and resolved them with then parted tool for creating the partitions and then using fdisk to set them to type 'fd'.
                                        Then do exactly as you did and the RAID device will form automatically at boot time. With an entry in /etc/fstab it will even be mounted...



                                        One caveat: Using /etc/mdadm.conf destroyed my RHEL7 3.10.0-514.6.1.el7.x86_6 system.







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Feb 20 '17 at 16:13









                                        SpruanceSpruance

                                        11




                                        11





















                                            0














                                            Usual caveats apply. Make sure your data was backed up. I'm not responsible for any data loss. This worked for me. Make sure to test your array before you put meaningful data on it. Make sure it can survive a reboot and device name changes, etc etc etc.



                                            Now off to what I did.



                                            I ran into the same issue today. After doing some searching I was able to fix this and get a stable raid device.



                                            On two disks I was using for my array I created a partition using gdisk before I created the RAID device. I deleted the partitions using gdisk but when I created the array I got the informational message below:



                                            mdadm: partition table exists on /dev/disk/by-id/ata-ST4000VN000-1H4168_Z30254QX but will be lost or meaningless after creating array


                                            Each time I saw this message when I rebooted the array would be lost.



                                            I figured I'd use Jim K's above suggestion and create a Linux raid partition on each drive. This worked but the sync rate went from 145MB/s on the raw drives to 35MB/s on the partitioned ones. I probably could have played with tuning parameters but why should I do that?



                                            I went on a quest to figure out how to nuke the drive partition table.



                                            The fix...



                                            First make sure your raid device is stopped , then nuke the drives raid signature.



                                            mdadm --stop /dev/md<number> 
                                            mdadm --zero-superblock /dev/sd<x> (do this for all your raid disks)


                                            Run blkid and see if any of the raid devices show up. If they do.



                                            run:



                                            dd if=/dev/zero of=/dev/sd<x> bs=512 count=1


                                            This will hopefully nuke the partition tables. Run blkid again to make sure no disks used for the raid device are listed.



                                            In my case gpt had a LVM label backed up on one disk. I cleaned this up using lvremove, vgremove, and finally pvremove.



                                            blkid ran clean this time.



                                            However when I tried creating the array again I got an error about an existing raid device so I did a dd one more time. After this the array created without notices like I listed above.



                                            I recreated the array as it was originally, I used disk/by-id instead of sd. Once the array was recreated the test partition I had created on the array came back intact.



                                            The array now survives reboots and changes to /dev/sd from when the array was originally created.






                                            share|improve this answer





























                                              0














                                              Usual caveats apply. Make sure your data was backed up. I'm not responsible for any data loss. This worked for me. Make sure to test your array before you put meaningful data on it. Make sure it can survive a reboot and device name changes, etc etc etc.



                                              Now off to what I did.



                                              I ran into the same issue today. After doing some searching I was able to fix this and get a stable raid device.



                                              On two disks I was using for my array I created a partition using gdisk before I created the RAID device. I deleted the partitions using gdisk but when I created the array I got the informational message below:



                                              mdadm: partition table exists on /dev/disk/by-id/ata-ST4000VN000-1H4168_Z30254QX but will be lost or meaningless after creating array


                                              Each time I saw this message when I rebooted the array would be lost.



                                              I figured I'd use Jim K's above suggestion and create a Linux raid partition on each drive. This worked but the sync rate went from 145MB/s on the raw drives to 35MB/s on the partitioned ones. I probably could have played with tuning parameters but why should I do that?



                                              I went on a quest to figure out how to nuke the drive partition table.



                                              The fix...



                                              First make sure your raid device is stopped , then nuke the drives raid signature.



                                              mdadm --stop /dev/md<number> 
                                              mdadm --zero-superblock /dev/sd<x> (do this for all your raid disks)


                                              Run blkid and see if any of the raid devices show up. If they do.



                                              run:



                                              dd if=/dev/zero of=/dev/sd<x> bs=512 count=1


                                              This will hopefully nuke the partition tables. Run blkid again to make sure no disks used for the raid device are listed.



                                              In my case gpt had a LVM label backed up on one disk. I cleaned this up using lvremove, vgremove, and finally pvremove.



                                              blkid ran clean this time.



                                              However when I tried creating the array again I got an error about an existing raid device so I did a dd one more time. After this the array created without notices like I listed above.



                                              I recreated the array as it was originally, I used disk/by-id instead of sd. Once the array was recreated the test partition I had created on the array came back intact.



                                              The array now survives reboots and changes to /dev/sd from when the array was originally created.






                                              share|improve this answer



























                                                0












                                                0








                                                0







                                                Usual caveats apply. Make sure your data was backed up. I'm not responsible for any data loss. This worked for me. Make sure to test your array before you put meaningful data on it. Make sure it can survive a reboot and device name changes, etc etc etc.



                                                Now off to what I did.



                                                I ran into the same issue today. After doing some searching I was able to fix this and get a stable raid device.



                                                On two disks I was using for my array I created a partition using gdisk before I created the RAID device. I deleted the partitions using gdisk but when I created the array I got the informational message below:



                                                mdadm: partition table exists on /dev/disk/by-id/ata-ST4000VN000-1H4168_Z30254QX but will be lost or meaningless after creating array


                                                Each time I saw this message when I rebooted the array would be lost.



                                                I figured I'd use Jim K's above suggestion and create a Linux raid partition on each drive. This worked but the sync rate went from 145MB/s on the raw drives to 35MB/s on the partitioned ones. I probably could have played with tuning parameters but why should I do that?



                                                I went on a quest to figure out how to nuke the drive partition table.



                                                The fix...



                                                First make sure your raid device is stopped , then nuke the drives raid signature.



                                                mdadm --stop /dev/md<number> 
                                                mdadm --zero-superblock /dev/sd<x> (do this for all your raid disks)


                                                Run blkid and see if any of the raid devices show up. If they do.



                                                run:



                                                dd if=/dev/zero of=/dev/sd<x> bs=512 count=1


                                                This will hopefully nuke the partition tables. Run blkid again to make sure no disks used for the raid device are listed.



                                                In my case gpt had a LVM label backed up on one disk. I cleaned this up using lvremove, vgremove, and finally pvremove.



                                                blkid ran clean this time.



                                                However when I tried creating the array again I got an error about an existing raid device so I did a dd one more time. After this the array created without notices like I listed above.



                                                I recreated the array as it was originally, I used disk/by-id instead of sd. Once the array was recreated the test partition I had created on the array came back intact.



                                                The array now survives reboots and changes to /dev/sd from when the array was originally created.






                                                share|improve this answer















                                                Usual caveats apply. Make sure your data was backed up. I'm not responsible for any data loss. This worked for me. Make sure to test your array before you put meaningful data on it. Make sure it can survive a reboot and device name changes, etc etc etc.



                                                Now off to what I did.



                                                I ran into the same issue today. After doing some searching I was able to fix this and get a stable raid device.



                                                On two disks I was using for my array I created a partition using gdisk before I created the RAID device. I deleted the partitions using gdisk but when I created the array I got the informational message below:



                                                mdadm: partition table exists on /dev/disk/by-id/ata-ST4000VN000-1H4168_Z30254QX but will be lost or meaningless after creating array


                                                Each time I saw this message when I rebooted the array would be lost.



                                                I figured I'd use Jim K's above suggestion and create a Linux raid partition on each drive. This worked but the sync rate went from 145MB/s on the raw drives to 35MB/s on the partitioned ones. I probably could have played with tuning parameters but why should I do that?



                                                I went on a quest to figure out how to nuke the drive partition table.



                                                The fix...



                                                First make sure your raid device is stopped , then nuke the drives raid signature.



                                                mdadm --stop /dev/md<number> 
                                                mdadm --zero-superblock /dev/sd<x> (do this for all your raid disks)


                                                Run blkid and see if any of the raid devices show up. If they do.



                                                run:



                                                dd if=/dev/zero of=/dev/sd<x> bs=512 count=1


                                                This will hopefully nuke the partition tables. Run blkid again to make sure no disks used for the raid device are listed.



                                                In my case gpt had a LVM label backed up on one disk. I cleaned this up using lvremove, vgremove, and finally pvremove.



                                                blkid ran clean this time.



                                                However when I tried creating the array again I got an error about an existing raid device so I did a dd one more time. After this the array created without notices like I listed above.



                                                I recreated the array as it was originally, I used disk/by-id instead of sd. Once the array was recreated the test partition I had created on the array came back intact.



                                                The array now survives reboots and changes to /dev/sd from when the array was originally created.







                                                share|improve this answer














                                                share|improve this answer



                                                share|improve this answer








                                                edited Apr 6 at 1:18









                                                Rui F Ribeiro

                                                42.1k1483142




                                                42.1k1483142










                                                answered Oct 1 '14 at 23:15









                                                xtreextree

                                                1




                                                1



























                                                    draft saved

                                                    draft discarded
















































                                                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                                    • Please be sure to answer the question. Provide details and share your research!

                                                    But avoid


                                                    • Asking for help, clarification, or responding to other answers.

                                                    • Making statements based on opinion; back them up with references or personal experience.

                                                    To learn more, see our tips on writing great answers.




                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function ()
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f156424%2fcentos-7-created-mdadm-array-disappears-after-reboot%23new-answer', 'question_page');

                                                    );

                                                    Post as a guest















                                                    Required, but never shown





















































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown

































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown







                                                    -centos, linux, mdadm

                                                    Popular posts from this blog

                                                    Word for a person who has no opinion about whether god existsWord for having a definite opinion while simultaneously withholding judgment?What's the opposite of “newcomer? Is ”veteran" OK?What do you call an “atheist” who might believe in an afterlife?What's a word for someone who wants to voice opinions but not have them challenged?Word for someone who dismisses contrary opinions as irrational?Somone who thinks they are overly special/out of the ordinaryIs there a word, phrase or idiom for “a person who is incapable of thinking about the future”?The belief that a god is human-likeA word for a non-famous person/thing you have heard a lot aboutAdjective for a person who enjoys taking care of their appearance

                                                    What was this official D&D 3.5e Lovecraft-flavored rulebook?What was this set of RPG tools called?As a first-time DM should I let my players play complex character classes and roles?Nymph's Kiss and the RelationshipWhat was the name of this Cleric Prestige Class that shapes metal with its bare hands?Are the 3.5e Dragonlance books third party or official works?What's up with the domain Vile Darkness?What was this 80s book about RPGs?What was the name of this Werewolf band?What book had Rituals to “upgrade” animal companions to keep them viable at higher levels?What was this RPG that had rules for player-owned businesses?

                                                    2017 IndyCar Series Contents Series news Teams and drivers Schedule Season summary Footnotes References External links Navigation menu"INDYCAR: Initial 2018 bodywork concepts unveiled"the original"IndyCar confirms switch to Performance Friction brakes in 2017""AJ Foyt Racing will switch to Chevy"the original"Carlos Munoz, Conor Daly will drive for AJ Foyt Racing""Zach Veach's Indy 500 Debut Confirmed with Foyt""No mass exodus from Honda after Ganassi switch""Ex-F1 driver Sato joins Andretti Autosport for 2017 IndyCar season""IndyCar's Ryan Hunter-Reay, sponsor DHL paired through 2020""hhgregg and Andretti Autosport announce partnership for key races in 2016""INDYCAR: Rossi re-signs with Andretti"the original"McLaren Formula 1 - Fernando Alonso to race at Indy 500 with McLaren, Honda and Andretti Autosport""Shank will finally take part in Indy 500 with Harvey, Andretti | MotorSportsTalk""Andretti adds Jack Harvey to Indy 500 field""Ganassi switches to Honda power for 2017""INDYCAR: Chilton returns to Ganassi"the original"IndyCar silly season: Who's going where in 2017?""INDYCAR: Kanaan, NTT Data return to Ganassi"the original"Kimball to remain at Ganassi for 2017""Coyne confirms Bourdais for 2017 IndyCar season""Davison to sub for Bourdais in Indy 500"the original"Gutierrez confirmed for Detroit IndyCar debut""Gutierrez returns with Coyne for rest of 2017 season""Vautier to drive for Coyne at Texas"the original"INDYCAR: Coyne confirms Jones for 2017"the original"Pippa Mann returns to Coyne for Indy 500""Karam, Dreyer & Reinbold teaming up again for Indianapolis 500""Pigot to return to Ed Carpenter Racing""Hildebrand confirmed as full-time Ed Carpenter driver""Veach to replace injured Hildebrand at Barber"the originalNew Team Harding Racing Enters Chaves for 101st Indianapolis 500"Juncos Racing Announces Entry in 101st Running of the Indianapolis 500 :: Juncos Racing""Juncos confirms Pigot for Indy 500""Saavedra confirmed in Juncos' second 500 entry"the original"Lazier confirms Indy 500 run after son's USF2000 debut"the original"Claman DeMelo to race for RLLR at Sonoma"the original"Rahal signs Servia and ace engineer for 2017""IndyCar: Aleshin returns with Schmidt"the original"Aleshin replaced by Saavedra for Toronto""Jack Harvey will pilot SPM No. 7 car at Watkins Glen, Sonoma""Jay Howard confirmed in Tony Stewart's supported SPM Indy entry""INDYCAR: Newgarden to wave the flag at Penske"the original"Pagenaud opts for No. 1 in 2017"the original"Penske confirms Newgarden for 2017""Montoya to stay with Team Penske in 2017""Target leaving IndyCar after 27 seasons with Chip Ganassi""Cavin: IndyCar could see complete driver/team shakeup in 2017""End of the road for KV Racing?""KV Racing confirms closure, equipment sold to Juncos""Juncos confirms IndyCar Series entry"the original"Juncos readies IndyCar program, aims for '17 500"the original"Harding Racing to add Texas, Pocono to schedule"the original"Sato signs with Andretti Autosport for 2017""INDYCAR: Aleshin in Doubt at SPM"the original"Long Beach notebook: JR Hildebrand breaks hand""Hildebrand cleared to return at Phoenix"the original"Bourdais to undergo surgery on multiple fractures""Aleshin loses Schmidt Peterson IndyCar ride""Saavedra in at SPM for Pocono, Gateway"the original"Bourdais to make return at Gateway"the original"The IndyCar Grand Prix no longer is sponsored by Angie's List""2017 IndyCar Series rulebook""2017 Verizon IndyCar Series Official Rulebook"Official websiteeeeee