diff --git a/df_check.py b/df_check.py index f35b0ce..4b620b6 100755 --- a/df_check.py +++ b/df_check.py @@ -4,17 +4,19 @@ import os file = open("/proc/partitions", "r") -file = file.read() +parts = file.read() +file.close() # getting all local partitions (regardless if mounted or not) partitions = [] -for line in file.split("\n"): - #if "sd" in line or "hd" in line: - #if line.split()[3] != None or line.split()[3] != "name": +blocks = [] +for line in parts.split("\n"): if line and "name" not in line and "sr0" not in line: - partitions.append(line.split()[3]) + if line.split()[2] != "1": + partitions.append(line.split()[3]) + blocks.append(line.split()[2]) -print "partitions on this system: %s" %(partitions) +print "partitions: %s \nblocks: %s" %(partitions, blocks) exit()