- # make root file system
- utils.sysexec( "mkfs.ext2 -j %s" % PARTITIONS["root"], log )
-
- # make vservers file system
- utils.sysexec( "mkfs.ext2 -m 0 -j %s" % PARTITIONS["vservers"], log )
+ # check if badhd option has been set
+ option = ''
+ txt = ''
+ if NODE_MODEL_OPTIONS & ModelOptions.BADHD:
+ option = '-c'
+ txt = " with bad block search enabled, which may take a while"
+
+ # filesystems partitions names and their corresponding
+ # reserved-blocks-percentages
+ filesystems = {"root":5,"vservers":0}
+
+ # make the file systems
+ for fs in filesystems.keys():
+ # get the reserved blocks percentage
+ rbp = filesystems[fs]
+ devname = PARTITIONS[fs]
+ log.write("formatting %s partition (%s)%s.\n" % (fs,devname,txt))
+ utils.sysexec( "mkfs.ext2 -q %s -m %d -j %s" % (option,rbp,devname), log )