RAIDs disappearing on reboot (Centos 7.5)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












I'm trying to create 4 RAID 0 disk arrays on my system running Centos 7.5 and have the RAIDs automount after a reboot. For some reason, only one of the RAIDs /dev/md0 is persistent between boots. The remaining three RAIDs (md1,md2,md3) all disappear after a reboot.



I build the RAIDs using:



$ sudo mdadm --create --chunk 4096 --verbose /dev/md0 --level=stripe 
--raid-devices=2 /dev/nvme0n1 /dev/nvme1n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md1 --level=stripe
--raid-devices=2 /dev/nvme2n1 /dev/nvme3n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md2 --level=stripe
--raid-devices=2 /dev/nvme4n1 /dev/nvme5n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md3 --level=stripe
--raid-devices=2 /dev/nvme6n1 /dev/nvme7n1


Then I update the /etc/mdadm.conf file using:



$ mdadm --detail --scan >> /etc/mdadm.conf


Finally after mounting the drives to their appropriate directory and adding them to /etc/fstab I rebuilt the initramfs image using dracut:



$ sudo dracut --force --mdadmconf


After running dracut, I reboot the system and /dev/md0 is there but the other RAIDs are not, so I did some investigating and it seems like /etc/mdadm.conf is not being included in the initramfs, so I repeated all of the previous steps, except for the dracut command I manually added what seemed to be missing using:



$ sudo dracut --force --include /etc/mdadm.conf /etc/mdadm.conf 
--add="mdraid" --mdadmconf`


After running the command, I see that /etc/mdadm.conf and /usr/sbin/mdadm are included in the initramfs using:



$ sudo lsinitrd /boot/initramfs-$(uname -r).img


What am I missing?



Edit 1
I've added mdadm --assemble --scan to /etc/rc.local and tried running it from the command line once the system has booted, but md1, md2, and md3 still are not found. As before, md0 is found at boot.



I have a separate OS disk, so I am not booting from md0










share|improve this question























  • Are the partitions marked linux raid? (type fd)
    – wurtel
    Aug 8 at 9:39










  • Looking at this it would seem to be the case that you're suppose to bring up the rest yourself - superuser.com/questions/801826/…. The A'er you received is basically telling you this, but not telling you how. You could put mdadm --assemble --scan in rc.local to see if it forces them to come up. I'd suspect you could put this into systemd as well.
    – slm♦
    Aug 8 at 11:04











  • See this thread - centos.org/forums/viewtopic.php?t=54901.
    – slm♦
    Aug 8 at 11:21














up vote
4
down vote

favorite












I'm trying to create 4 RAID 0 disk arrays on my system running Centos 7.5 and have the RAIDs automount after a reboot. For some reason, only one of the RAIDs /dev/md0 is persistent between boots. The remaining three RAIDs (md1,md2,md3) all disappear after a reboot.



I build the RAIDs using:



$ sudo mdadm --create --chunk 4096 --verbose /dev/md0 --level=stripe 
--raid-devices=2 /dev/nvme0n1 /dev/nvme1n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md1 --level=stripe
--raid-devices=2 /dev/nvme2n1 /dev/nvme3n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md2 --level=stripe
--raid-devices=2 /dev/nvme4n1 /dev/nvme5n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md3 --level=stripe
--raid-devices=2 /dev/nvme6n1 /dev/nvme7n1


Then I update the /etc/mdadm.conf file using:



$ mdadm --detail --scan >> /etc/mdadm.conf


Finally after mounting the drives to their appropriate directory and adding them to /etc/fstab I rebuilt the initramfs image using dracut:



$ sudo dracut --force --mdadmconf


After running dracut, I reboot the system and /dev/md0 is there but the other RAIDs are not, so I did some investigating and it seems like /etc/mdadm.conf is not being included in the initramfs, so I repeated all of the previous steps, except for the dracut command I manually added what seemed to be missing using:



$ sudo dracut --force --include /etc/mdadm.conf /etc/mdadm.conf 
--add="mdraid" --mdadmconf`


After running the command, I see that /etc/mdadm.conf and /usr/sbin/mdadm are included in the initramfs using:



$ sudo lsinitrd /boot/initramfs-$(uname -r).img


What am I missing?



Edit 1
I've added mdadm --assemble --scan to /etc/rc.local and tried running it from the command line once the system has booted, but md1, md2, and md3 still are not found. As before, md0 is found at boot.



I have a separate OS disk, so I am not booting from md0










share|improve this question























  • Are the partitions marked linux raid? (type fd)
    – wurtel
    Aug 8 at 9:39










  • Looking at this it would seem to be the case that you're suppose to bring up the rest yourself - superuser.com/questions/801826/…. The A'er you received is basically telling you this, but not telling you how. You could put mdadm --assemble --scan in rc.local to see if it forces them to come up. I'd suspect you could put this into systemd as well.
    – slm♦
    Aug 8 at 11:04











  • See this thread - centos.org/forums/viewtopic.php?t=54901.
    – slm♦
    Aug 8 at 11:21












up vote
4
down vote

favorite









up vote
4
down vote

favorite











I'm trying to create 4 RAID 0 disk arrays on my system running Centos 7.5 and have the RAIDs automount after a reboot. For some reason, only one of the RAIDs /dev/md0 is persistent between boots. The remaining three RAIDs (md1,md2,md3) all disappear after a reboot.



I build the RAIDs using:



$ sudo mdadm --create --chunk 4096 --verbose /dev/md0 --level=stripe 
--raid-devices=2 /dev/nvme0n1 /dev/nvme1n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md1 --level=stripe
--raid-devices=2 /dev/nvme2n1 /dev/nvme3n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md2 --level=stripe
--raid-devices=2 /dev/nvme4n1 /dev/nvme5n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md3 --level=stripe
--raid-devices=2 /dev/nvme6n1 /dev/nvme7n1


Then I update the /etc/mdadm.conf file using:



$ mdadm --detail --scan >> /etc/mdadm.conf


Finally after mounting the drives to their appropriate directory and adding them to /etc/fstab I rebuilt the initramfs image using dracut:



$ sudo dracut --force --mdadmconf


After running dracut, I reboot the system and /dev/md0 is there but the other RAIDs are not, so I did some investigating and it seems like /etc/mdadm.conf is not being included in the initramfs, so I repeated all of the previous steps, except for the dracut command I manually added what seemed to be missing using:



$ sudo dracut --force --include /etc/mdadm.conf /etc/mdadm.conf 
--add="mdraid" --mdadmconf`


After running the command, I see that /etc/mdadm.conf and /usr/sbin/mdadm are included in the initramfs using:



$ sudo lsinitrd /boot/initramfs-$(uname -r).img


What am I missing?



Edit 1
I've added mdadm --assemble --scan to /etc/rc.local and tried running it from the command line once the system has booted, but md1, md2, and md3 still are not found. As before, md0 is found at boot.



I have a separate OS disk, so I am not booting from md0










share|improve this question















I'm trying to create 4 RAID 0 disk arrays on my system running Centos 7.5 and have the RAIDs automount after a reboot. For some reason, only one of the RAIDs /dev/md0 is persistent between boots. The remaining three RAIDs (md1,md2,md3) all disappear after a reboot.



I build the RAIDs using:



$ sudo mdadm --create --chunk 4096 --verbose /dev/md0 --level=stripe 
--raid-devices=2 /dev/nvme0n1 /dev/nvme1n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md1 --level=stripe
--raid-devices=2 /dev/nvme2n1 /dev/nvme3n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md2 --level=stripe
--raid-devices=2 /dev/nvme4n1 /dev/nvme5n1

$ sudo mdadm --create --chunk 4096 --verbose /dev/md3 --level=stripe
--raid-devices=2 /dev/nvme6n1 /dev/nvme7n1


Then I update the /etc/mdadm.conf file using:



$ mdadm --detail --scan >> /etc/mdadm.conf


Finally after mounting the drives to their appropriate directory and adding them to /etc/fstab I rebuilt the initramfs image using dracut:



$ sudo dracut --force --mdadmconf


After running dracut, I reboot the system and /dev/md0 is there but the other RAIDs are not, so I did some investigating and it seems like /etc/mdadm.conf is not being included in the initramfs, so I repeated all of the previous steps, except for the dracut command I manually added what seemed to be missing using:



$ sudo dracut --force --include /etc/mdadm.conf /etc/mdadm.conf 
--add="mdraid" --mdadmconf`


After running the command, I see that /etc/mdadm.conf and /usr/sbin/mdadm are included in the initramfs using:



$ sudo lsinitrd /boot/initramfs-$(uname -r).img


What am I missing?



Edit 1
I've added mdadm --assemble --scan to /etc/rc.local and tried running it from the command line once the system has booted, but md1, md2, and md3 still are not found. As before, md0 is found at boot.



I have a separate OS disk, so I am not booting from md0







centos raid mdadm software-raid dracut






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 8 at 13:59

























asked Aug 7 at 18:44









ks0ze

1212




1212











  • Are the partitions marked linux raid? (type fd)
    – wurtel
    Aug 8 at 9:39










  • Looking at this it would seem to be the case that you're suppose to bring up the rest yourself - superuser.com/questions/801826/…. The A'er you received is basically telling you this, but not telling you how. You could put mdadm --assemble --scan in rc.local to see if it forces them to come up. I'd suspect you could put this into systemd as well.
    – slm♦
    Aug 8 at 11:04











  • See this thread - centos.org/forums/viewtopic.php?t=54901.
    – slm♦
    Aug 8 at 11:21
















  • Are the partitions marked linux raid? (type fd)
    – wurtel
    Aug 8 at 9:39










  • Looking at this it would seem to be the case that you're suppose to bring up the rest yourself - superuser.com/questions/801826/…. The A'er you received is basically telling you this, but not telling you how. You could put mdadm --assemble --scan in rc.local to see if it forces them to come up. I'd suspect you could put this into systemd as well.
    – slm♦
    Aug 8 at 11:04











  • See this thread - centos.org/forums/viewtopic.php?t=54901.
    – slm♦
    Aug 8 at 11:21















Are the partitions marked linux raid? (type fd)
– wurtel
Aug 8 at 9:39




Are the partitions marked linux raid? (type fd)
– wurtel
Aug 8 at 9:39












Looking at this it would seem to be the case that you're suppose to bring up the rest yourself - superuser.com/questions/801826/…. The A'er you received is basically telling you this, but not telling you how. You could put mdadm --assemble --scan in rc.local to see if it forces them to come up. I'd suspect you could put this into systemd as well.
– slm♦
Aug 8 at 11:04





Looking at this it would seem to be the case that you're suppose to bring up the rest yourself - superuser.com/questions/801826/…. The A'er you received is basically telling you this, but not telling you how. You could put mdadm --assemble --scan in rc.local to see if it forces them to come up. I'd suspect you could put this into systemd as well.
– slm♦
Aug 8 at 11:04













See this thread - centos.org/forums/viewtopic.php?t=54901.
– slm♦
Aug 8 at 11:21




See this thread - centos.org/forums/viewtopic.php?t=54901.
– slm♦
Aug 8 at 11:21










1 Answer
1






active

oldest

votes

















up vote
0
down vote













The initrd only creates the RAID array needed for root and swap. Run this from the main system (after initrd changes to the real root)



$ sudo mdadm --assemble --scan





share|improve this answer






















  • Whoever downvoted, please give at least a reason. Regarding sudo, I didn't mean to run it from the command line as an unprivileged user, but from a script that runs as root.
    – RalfFriedl
    Aug 8 at 6:14










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',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
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%2f461142%2fraids-disappearing-on-reboot-centos-7-5%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













The initrd only creates the RAID array needed for root and swap. Run this from the main system (after initrd changes to the real root)



$ sudo mdadm --assemble --scan





share|improve this answer






















  • Whoever downvoted, please give at least a reason. Regarding sudo, I didn't mean to run it from the command line as an unprivileged user, but from a script that runs as root.
    – RalfFriedl
    Aug 8 at 6:14














up vote
0
down vote













The initrd only creates the RAID array needed for root and swap. Run this from the main system (after initrd changes to the real root)



$ sudo mdadm --assemble --scan





share|improve this answer






















  • Whoever downvoted, please give at least a reason. Regarding sudo, I didn't mean to run it from the command line as an unprivileged user, but from a script that runs as root.
    – RalfFriedl
    Aug 8 at 6:14












up vote
0
down vote










up vote
0
down vote









The initrd only creates the RAID array needed for root and swap. Run this from the main system (after initrd changes to the real root)



$ sudo mdadm --assemble --scan





share|improve this answer














The initrd only creates the RAID array needed for root and swap. Run this from the main system (after initrd changes to the real root)



$ sudo mdadm --assemble --scan






share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 8 at 4:50









slm♦

238k65491662




238k65491662










answered Aug 7 at 20:03









RalfFriedl

3,5601522




3,5601522











  • Whoever downvoted, please give at least a reason. Regarding sudo, I didn't mean to run it from the command line as an unprivileged user, but from a script that runs as root.
    – RalfFriedl
    Aug 8 at 6:14
















  • Whoever downvoted, please give at least a reason. Regarding sudo, I didn't mean to run it from the command line as an unprivileged user, but from a script that runs as root.
    – RalfFriedl
    Aug 8 at 6:14















Whoever downvoted, please give at least a reason. Regarding sudo, I didn't mean to run it from the command line as an unprivileged user, but from a script that runs as root.
– RalfFriedl
Aug 8 at 6:14




Whoever downvoted, please give at least a reason. Regarding sudo, I didn't mean to run it from the command line as an unprivileged user, but from a script that runs as root.
– RalfFriedl
Aug 8 at 6:14

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461142%2fraids-disappearing-on-reboot-centos-7-5%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Christian Cage

How to properly install USB display driver for Fresco Logic FL2000DX on Ubuntu?