/[gli]/trunk/src/GLIStorageDevice.py
Gentoo

Diff of /trunk/src/GLIStorageDevice.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 115 Revision 117
294 if blocks == 0: 294 if blocks == 0:
295 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512 295 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512
296 if existing: 296 if existing:
297 parted_part = device._parted_disk.get_partition(minor) 297 parted_part = device._parted_disk.get_partition(minor)
298 if type == "ntfs": 298 if type == "ntfs":
299 min_bytes = int(commands.getoutput("ntfsresize --info " + device._device + str(minor) + " | grep -e '^You might resize' | sed -e 's/You might resize at //' -e 's/ bytes or .\+//'")) 299 min_bytes = int(commands.getoutput("ntfsresize -f --info " + device._device + str(minor) + " | grep -e '^You might resize' | sed -e 's/You might resize at //' -e 's/ bytes or .\+//'"))
300 self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1 300 self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1
301 self._resizeable == True 301 self._resizeable == True
302 elif type == "ext2" or type == "ext3": 302 elif type == "ext2" or type == "ext3":
303 commands.getstatus("mkdir /mnt/freespace; mount " + device._device + str(minor) + " /mnt/freespace") 303 os.system("mkdir /mnt/freespace 2>&1 > /dev/null; mount " + device._device + str(minor) + " /mnt/freespace | tee -a /tmp/dfoutput.log")
304 min_bytes = int(commands.getoutput("df -B kB " + device._device + str(minor) + " | tail -n 1 | sed -e 's:^" + device._device + str(minor) + "\s\+[0-9]\+kB\s\+::' -e 's:kB\s.\+::'")) * 1000 304 min_bytes = string.strip(commands.getoutput("df -B kB | grep -e '^" + device._device + str(minor) + "' | sed -e 's:^" + device._device + str(minor) + "\s\+[0-9]\+kB\s\+::' -e 's:kB\s.\+::' | tee /tmp/dfoutput.log"))
305 print device._device + str(minor) + ": |" + min_bytes + "|"
306 min_bytes = int(min_bytes) * 1000
305 commands.getstatus("umount /mnt/freespace; rm -rf /mnt/freespace") 307 os.system("umount /mnt/freespace; rm -rf /mnt/freespace")
306 min_bytes = min_bytes + (100 * 1024 * 1024) # Add 100M just to be safe 308 min_bytes = min_bytes + (100 * 1024 * 1024) # Add 100M just to be safe
307 self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1 309 self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1
308 self._resizeable == True 310 self._resizeable == True
309 elif type == "fat16" or type == "fat32": 311 elif type == "fat16" or type == "fat32":
310 parted_part = self._device._parted_disk.get_partition(self._minor) 312 parted_part = self._device._parted_disk.get_partition(self._minor)

Legend:
Removed from v.115  
changed lines
  Added in v.117

  ViewVC Help
Powered by ViewVC 1.1.20