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

Diff of /trunk/src/GLIStorageDevice.py

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

Revision 113 Revision 174
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.system("mkdir /mnt/freespace; mount " + device._device + str(minor) + " /mnt/freespace") 303 block_size = string.strip(commands.getoutput("dumpe2fs -h " + device._device + str(minor) + " 2>&1 | grep -e '^Block size:' | sed -e 's/^Block size:\s\+//'"))
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 free_blocks = string.strip(commands.getoutput("dumpe2fs -h " + device._device + str(minor) + " 2>&1 | grep -e '^Free blocks:' | sed -e 's/^Free blocks:\s\+//'"))
305 commands.system("umount /mnt/freespace; rm -rf /mnt/freespace") 305 free_cyl = int(int(block_size) * int(free_blocks) / self._device._cylinder_bytes)
306 min_bytes = min_bytes + (100 * 1024 * 1024) # Add 100M just to be safe 306 free_cyl = int(free_cyl)
307 self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1 307 free_cyl = free_cyl - 200 # just to be safe
308 self._min_cylinders_for_resize = (self._end - self._start + 1) - free_cyl
308 self._resizeable == True 309 self._resizeable == True
309 elif type == "fat16" or type == "fat32": 310 elif type == "fat16" or type == "fat32":
310 parted_part = self._device._parted_disk.get_partition(self._minor) 311 parted_part = self._device._parted_disk.get_partition(self._minor)
311 parted_fs = parted_part.geom.file_system_open() 312 parted_fs = parted_part.geom.file_system_open()
312 resize_constraint = parted_fs.get_resize_constraint() 313 resize_constraint = parted_fs.get_resize_constraint()

Legend:
Removed from v.113  
changed lines
  Added in v.174

  ViewVC Help
Powered by ViewVC 1.1.20