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

Diff of /trunk/src/GLIStorageDevice.py

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

Revision 147 Revision 174
298 if type == "ntfs": 298 if type == "ntfs":
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 .\+//'")) 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 os.system("mkdir /mnt/freespace 2>&1 > /dev/null; mount " + device._device + str(minor) + " /mnt/freespace | tee -a /tmp/dfoutput.log") 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 = string.strip(commands.getoutput("df --block-size 1 | grep -e '^" + device._device + str(minor) + "' | sed -e 's:^" + device._device + str(minor) + "\s\+[0-9]\+\s\+::' -e 's:\s.\+::' | tee /tmp/dfoutput.log")) 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 free_cyl = string.strip(commands.getoutput("df --block-size " + str(self._device._cylinder_bytes) + " | grep -e '^" + device._device + str(minor) + "' | sed -e 's:^" + device._device + str(minor) + "\s\+[0-9]\+\s\+[0-9]\+\s\+::' -e 's:\s.\+::' | tee /tmp/dfoutput.log")) 305 free_cyl = int(int(block_size) * int(free_blocks) / self._device._cylinder_bytes)
306# print device._device + str(minor) + ": |" + min_bytes + "|"
307# min_bytes = int(min_bytes)
308 free_cyl = int(free_cyl) 306 free_cyl = int(free_cyl)
309 os.system("umount /mnt/freespace; rm -rf /mnt/freespace")
310# min_bytes = min_bytes + (200 * 1024 * 1024) # Add 200M just to be safe
311 free_cyl = free_cyl - 200 # just to be safe 307 free_cyl = free_cyl - 200 # just to be safe
312# self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1
313 self._min_cylinders_for_resize = (self._end - self._start + 1) - free_cyl 308 self._min_cylinders_for_resize = (self._end - self._start + 1) - free_cyl
314 self._resizeable == True 309 self._resizeable == True
315 elif type == "fat16" or type == "fat32": 310 elif type == "fat16" or type == "fat32":
316 parted_part = self._device._parted_disk.get_partition(self._minor) 311 parted_part = self._device._parted_disk.get_partition(self._minor)
317 parted_fs = parted_part.geom.file_system_open() 312 parted_fs = parted_part.geom.file_system_open()

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

  ViewVC Help
Powered by ViewVC 1.1.20