<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ET link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'>Hello,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'>I have, for a long time, had a separate FAI action around, which I call “cleandisks”. This makes re-installing a lvm- and/or raid-equipped host a two stage process:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'>1) Boot into FAI_ACTION=cleandisks. Let the script wipe the disks.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'>2) Reboot into install. During this boot, the kernel should find clean disks and not make any assumptions about earlier states of the disks.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'>The functionality of the script is similar to </span><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'>that of </span><span lang=EN-GB style='font-size:12.0pt'>Andrew's WIPEDISKS, but let me copy it here (with some sanitation) for reference:</span><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>case `hostname` in<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    some_sample_host)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        # This needs to be set up for each host, by looking at its configuration prior to reinstall.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        # Non-existent disks, partitions, etc, will not hurt in most cases, so better err in the direction of too many.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        LV_LIST="lv1"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        MD_LIST="md0 md1 md126 md127"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        DISK_LIST="sda sdb"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        PART_LIST="sda1 sdb1 sda3 sdb3"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        ;;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    […]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>esac<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>lvdisplay<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'># Repeat all this twice!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>for round in 1 2 ; do<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    for LV in $LV_LIST<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    do<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        vgremove -f $LV<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    done<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    for MD in $MD_LIST<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    do<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        mdadm --remove /dev/$MD<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        mdadm --stop /dev/$MD<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    done<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    for PART in $PART_LIST<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    do<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        mdadm --zero-superblock /dev/$PART<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        mdadm --zero-superblock /dev/$PART<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    done<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    for DISK in $DISK_LIST<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    do<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        dd if=/dev/zero of=/dev/$DISK bs=10240 count=100000<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    done<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>done<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>lvdisplay<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'>This is a lot of overkill, and some of the commands fail, especially on the second round, but this way I have always got rid of all the old data on the disks and booted into a problem-free reinstall.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'>Hoping this helps,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'>Toomas<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:12.0pt;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-GB>From:</span></b><span lang=EN-GB> linux-fai <linux-fai-bounces@uni-koeln.de> <b>On Behalf Of </b>Jerry Steele<br><b>Sent:</b> teisipäev, 2. juuli 2019 15:08<br><b>To:</b> fully automatic installation for Linux <linux-fai@uni-koeln.de><br><b>Subject:</b> Re: MD devices are not wiped if LVM exists<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><div><div><p class=MsoNormal><span lang=EN-GB>Moving away from Andrew's WIPEDISKS script for a second, I have made a simple script containing just<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB>vgdisplay<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB>The output from this is null, suggesting that FAI does not see any LVM stuff at this stage, however after it has completed these bits of the disk_config,<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB>Executing: wipefs -af /dev/sdb1<br>Executing: wipefs -af /dev/sda1<br>Executing: wipefs -af /dev/sdd1<br>Executing: wipefs -af /dev/sdc1<br>Executing: mdadm --stop --scan<br>Executing: mdadm --assemble --scan --config=/tmp/fai/mdadm-from-examine.conf<br>Executing: mdadm -W --stop /dev/md0<br>Executing: mdadm -W --stop /dev/md2<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB>... the LVM volumes are visible again (I can't grab the ouput of "vgdisplay", but it shows the volume groups). I'm guessing that this shows that the LVM metadata is immune to the wipefs stuff.<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB>I have to stop looking at this for the moment, but I'll see if I can pick it up later and report back (unless anyone else has come across this and can report back, of course)<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB>Thanks for your help so far guys..<o:p></o:p></span></p></div><div><div><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p></div></div><p class=MsoNormal><span lang=EN-GB>-- <o:p></o:p></span></p><div><div><div><div><div><div><div><div><div><div><p class=MsoNormal><span lang=EN-GB>---<br><br>Jerry Steele<br>Telephone: +44 (0)7492 910225<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB>GPG: 43A3A8C6<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p></div></div></div></div></div></div></div></div></div></div></div></div></body></html>