Skip to content

Commit 95116db

Browse files
committed
Use append mode in 'dd' when the desired swap size is not a multiple of 64M (#2286)
First 'dd' command creates the swap in multiples of 64M and the second is supposed to add the rest, however, with no 'oflag=append' it just overwrites what was already written so the file doesn't grow as desired. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
1 parent 4db3b44 commit 95116db

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

azurelinuxagent/daemon/resourcedisk/default.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ def mkfile(self, filename, nbytes):
373373
if blocks > 0:
374374
ret = shellutil.run(dd_cmd.format(dd_maxbs, blocks, fn_sh)) << 8
375375

376+
dd_cmd += " oflag=append"
376377
remains = int(nbytes % dd_maxbs)
377378
if remains > 0:
378379
ret += shellutil.run(dd_cmd.format(remains, 1, fn_sh))

0 commit comments

Comments
 (0)