summaryrefslogtreecommitdiffstats
path: root/src/utils/fs.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/fs.py')
-rw-r--r--src/utils/fs.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utils/fs.py b/src/utils/fs.py
index 57e6674..c030e68 100644
--- a/src/utils/fs.py
+++ b/src/utils/fs.py
@@ -232,8 +232,9 @@ def _reduce_ntfsresize(partdev):
if 'Nothing to do: NTFS volume size is already OK.' in out_resize_dryrun:
logging.warn('ntfsresize reports nothing to do. Is the target filesystem already shrunken?')
break
- extra_size = int(out_resize_dryrun.split('Needed relocations : ')[1].split(' ')[0])*1.1+1024
- new_size += int(extra_size)
+ if out_resize_dryrun.find('Needed relocations : ') != -1:
+ extra_size = int(out_resize_dryrun.split('Needed relocations : ')[1].split(' ')[0])*1.1+1024
+ new_size += int(extra_size)
if new_size < size:
cmd_resize = shlex.split(f'ntfsresize -fs {new_size:.0f} {partdev}')