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

Diff of /trunk/src/GLIStorageDevice.py

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

Revision 146 Revision 147
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 os.system("mkdir /mnt/freespace 2>&1 > /dev/null; mount " + device._device + str(minor) + " /mnt/freespace | tee -a /tmp/dfoutput.log")
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")) 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"))
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 print device._device + str(minor) + ": |" + min_bytes + "|" 306# print device._device + str(minor) + ": |" + min_bytes + "|"
306 min_bytes = int(min_bytes) * 1000 307# min_bytes = int(min_bytes)
308 free_cyl = int(free_cyl)
307 os.system("umount /mnt/freespace; rm -rf /mnt/freespace") 309 os.system("umount /mnt/freespace; rm -rf /mnt/freespace")
308 min_bytes = min_bytes + (100 * 1024 * 1024) # Add 100M just to be safe 310# min_bytes = min_bytes + (200 * 1024 * 1024) # Add 200M just to be safe
311 free_cyl = free_cyl - 200 # just to be safe
309 self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1 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
310 self._resizeable == True 314 self._resizeable == True
311 elif type == "fat16" or type == "fat32": 315 elif type == "fat16" or type == "fat32":
312 parted_part = self._device._parted_disk.get_partition(self._minor) 316 parted_part = self._device._parted_disk.get_partition(self._minor)
313 parted_fs = parted_part.geom.file_system_open() 317 parted_fs = parted_part.geom.file_system_open()
314 resize_constraint = parted_fs.get_resize_constraint() 318 resize_constraint = parted_fs.get_resize_constraint()

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

  ViewVC Help
Powered by ViewVC 1.1.20