diff --git a/cobbler/snippets/kickstart_pre_partition_disks b/cobbler/snippets/kickstart_pre_partition_disks index c38f6fe..1c8c9fc 100644 --- a/cobbler/snippets/kickstart_pre_partition_disks +++ b/cobbler/snippets/kickstart_pre_partition_disks @@ -43,6 +43,9 @@ let found_disk_offset=0 while [ \$disk_offset -lt \$disk_nums ]; do let found_disk=0 disk_name=\$(basename \$1) +#if $getVar('keep_old_partitions', '0') == "0" + dd if=/dev/zero of=/dev/\${disk_name} bs=512 count=1 +#end if if [[ x"\${disk_mapping[\${disk_name}]}" == x"" ]]; then echo "ignore disk \$1 since it is not in disk_mapping" >> /tmp/log let disk_offset=\$disk_offset+1 @@ -103,6 +106,9 @@ done echo "clearpart --all --initlabel" > /tmp/part-include #if $getVar('keep_old_partitions', '0') != "0" +for disk in \${sorted_disks[@]}; do + dd if=/dev/zero of=\${disk} bs=512 count=1 +done echo "only partition \$sorted_disks_str" >> /tmp/log echo "ignoredisk --only-use=\$sorted_disks_str" >> /tmp/part-include #end if diff --git a/cobbler/snippets/preseed_pre_partition_disks b/cobbler/snippets/preseed_pre_partition_disks index a93ef81..956c377 100644 --- a/cobbler/snippets/preseed_pre_partition_disks +++ b/cobbler/snippets/preseed_pre_partition_disks @@ -51,6 +51,9 @@ for disk in \$(list-devices disk); do continue fi disk_name=\$(basename \$disk) +#if $getVar('keep_old_partitions', '0') == "0" + dd if=/dev/zero of=\$disk bs=512 count=1 +#end if eval "disk_path=\\${disk_\${disk_name}}" if [ -z \${disk_path} ]; then echo "ignore disk \${disk_name} since it is not in disk_mapping" >> /tmp/preseed.log @@ -129,6 +132,9 @@ done echo "first disk \${first_disk_name}" >> /tmp/preseed.log #if $getVar('keep_old_partitions', '0') != "0" +for disk_name in \${sorted_disks}; do + dd if=/dev/zero of=/dev/\${disk_name} bs=512 count=1 +done remove_disks=\${sorted_disks} #else remove_disks=\${disks}