Fix cleaning boot sectors of disks on delete
Bootloaders may check MBR signature to determine, if it can boot from thios disk. So let's clear it together with boot code. Also #{dev[:name]} is just a name of a device, like sdb, so add /dev/ path. Change-Id: Ifc23fe4e4919a10b3d5546c98ee333ccac9c92f2
This commit is contained in:
parent
94c96e3582
commit
3c00fb6550
|
@ -116,7 +116,9 @@ module MCollective
|
|||
get_devices(type='all').each do |dev|
|
||||
debug_msg("erasing bootstrap code area in MBR of #{dev[:name]}")
|
||||
# clear out the boot code in MBR
|
||||
system("dd if=/dev/zero of=#{dev[:name]} bs=446 count=1")
|
||||
system("dd if=/dev/zero of=/dev/#{dev[:name]} bs=446 count=1")
|
||||
# clear out the signature
|
||||
system("dd if=/dev/zero of=/dev/#{dev[:name]} seek=510 bs=1 count=2")
|
||||
system("sync")
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue