I am working on a script to install a array raid5. I am having trouble with inserting auto=yes when the script ask: if I want to continue creating array. I tried --auto=yes (http://www.linuxmanpages.com/man8/mdadm.8.php) but very unsure where to place it.
#!/bin/bash
mdadm mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdc1 /dev/sdd1 /dev/sde1 --spare-devices=1 /dev/sdf1
if [ $? -eq 0 ]; then
echo OK
else
echo FAIL
fi
1) you can use HEREDOC to resolve such problems.
for example for
passwdcommand:You can also run your script and put
heredoc:UPDATE:
This is finally what you want
if you have one question:
Also you can:
2) There is also another solution:
or, if a capital 'Y' is required: