cap = self.diskSize()
if cap == 0:
return ""
- return "%d.%03d GB" % (cap/1024, cap%1024)
+ return "%d.%03d GB" % (cap/1000, cap%1000)
def model(self):
if self.device[:2] == "hd":
cmd = "/sbin/mkfs.ext3 "
if self.diskSize() > 4 * 1024:
cmd += "-T largefile "
- cmd += "-m0 " + self.devidex + "part1"
+ cmd += "-m0 -O dir_index " + self.devidex + "part1"
res = system(cmd)
return (res >> 8)
def mount(self):
- cmd = "/bin/mount -t ext3 " + self.devidex + "part1"
- res = system(cmd)
- return (res >> 8)
+ res = -1
+ #we don't know which type of devicename is used in fstab, try both
+ for device in [self.devidex, self.devidex2]:
+ cmd = "/bin/mount -t ext3 " + device + "part1"
+ res = system(cmd)
+ res >>= 8
+ if not res:
+ break
+ return res
def createMovieFolder(self):
try:
self.on_partition_list_change("remove", x)
l = len(device)
if l and not device[l-1].isdigit():
- idx = 0
for hdd in self.hdd:
if hdd.device == device:
- self.hdd[x].stop()
- del self.hdd[idx]
+ hdd.stop()
+ self.hdd.remove(hdd)
break
SystemInfo["Harddisk"] = len(self.hdd) > 0