2
0
mirror of https://github.com/mbusb/multibootusb synced 2024-11-01 15:40:16 +00:00

linux: display total size of disk

This commit is contained in:
Alin Trăistaru 2017-04-29 10:19:06 +03:00
parent 1782495aea
commit 79e88874b1

View File

@ -258,7 +258,8 @@ def details_udev(usb_disk_part):
size_free = shutil.disk_usage(mount_point)[2]
else:
size_total = device.get('UDISKS_PARTITION_SIZE') or ""
fdisk_cmd = 'fdisk -l ' + usb_disk_part + ' | grep "^Disk /" | sed -re "s/.*\s([0-9]+)\sbytes.*/\\1/"'
size_total = subprocess.check_output(fdisk_cmd, shell=True).strip()
size_used = ""
size_free = ""
mount_point = ""