Don't use oflag=direct while erasing bootloader code

We are erasing 446 bytes of bootloader code before rebooting
node, but you can write only blocks with O_DIRECT, so let's
write 446 bytes without oflag=direct and do sync after dd
instead.

Change-Id: I7b5f9749b170a9b7191991dd02cb867bba0e4c43
Partial-Bug: #1573105
Closes-Bug: #1538587
This commit is contained in:
Dmitry Guryanov 2016-04-22 20:53:23 +03:00 committed by Maksim Malchuk
parent 1e913924a1
commit 9a547037ef
1 changed files with 2 additions and 1 deletions

View File

@ -116,7 +116,8 @@ 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 oflag=direct")
system("dd if=/dev/zero of=#{dev[:name]} bs=446 count=1")
system("sync")
end
reply[:erased] = true