Commit b2b27ca4 authored by Mikhail Karpenko's avatar Mikhail Karpenko

Fix 'invalid blocks on device' error during disk formatting

parent 4d24f0a2
...@@ -207,7 +207,7 @@ def partition_disk(dev_path, sys_size, disk_size, dry_run = True, force = False) ...@@ -207,7 +207,7 @@ def partition_disk(dev_path, sys_size, disk_size, dry_run = True, force = False)
time.sleep(2) time.sleep(2)
partition = dev_path + '1' partition = dev_path + '1'
if force: if force:
f_param = '-FF' cmd_str = ['mkfs.ext4', '-FF', partition]
# if system partition contained a file system then it will be mounted right after partitioning # if system partition contained a file system then it will be mounted right after partitioning
# check this situation and unmount partition # check this situation and unmount partition
mounted = subprocess.check_output(['mount']) mounted = subprocess.check_output(['mount'])
...@@ -216,8 +216,8 @@ def partition_disk(dev_path, sys_size, disk_size, dry_run = True, force = False) ...@@ -216,8 +216,8 @@ def partition_disk(dev_path, sys_size, disk_size, dry_run = True, force = False)
if mount_point: if mount_point:
subprocess.check_output(['umount', partition]) subprocess.check_output(['umount', partition])
else: else:
f_param = '' cmd_str = ['mkfs.ext4', partition]
subprocess.check_output(['mkfs.ext4', f_param, partition], stderr = subprocess.STDOUT) subprocess.check_output(cmd_str, stderr = subprocess.STDOUT)
ret_str = "" ret_str = ""
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
ret_str = e.output ret_str = e.output
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment