summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/utils/fs.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/utils/fs.py b/src/utils/fs.py
index 77f8b75..5bc7956 100644
--- a/src/utils/fs.py
+++ b/src/utils/fs.py
@@ -97,6 +97,8 @@ def ogReduceFs(disk, part):
"""
partdev = get_partition_device(disk, part)
fstype = get_filesystem_type(partdev)
+ if fstype == "unknown":
+ return -1
umount(partdev)
if fstype == 'ext4':
@@ -117,6 +119,8 @@ def ogExtendFs(disk, part):
"""
partdev = get_partition_device(disk, part)
fstype = get_filesystem_type(partdev)
+ if fstype == "unknown":
+ return -1
umount(partdev)
if fstype == 'ext4':
@@ -198,7 +202,9 @@ def get_filesystem_type(partdev):
cmd = shlex.split(f'blkid -o value -s TYPE {partdev}')
proc = subprocess.run(cmd, stdout=PIPE, encoding='utf-8')
if proc.returncode != 0:
- raise RuntimeError(f'Error getting filesystem from {partdev}')
+ log.error(f'Error getting filesystem from {partdev}')
+ return "unknown"
+
return proc.stdout.strip()