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

Diff of /trunk/src/GLIStorageDevice.py

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

Revision 212 Revision 231
306 self._mountpoint = mountpoint 306 self._mountpoint = mountpoint
307 self._mountopts = mountopts 307 self._mountopts = mountopts
308 self._format = format 308 self._format = format
309 if blocks == 0: 309 if blocks == 0:
310 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512 310 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512
311# if existing: 311 if existing:
312# parted_part = device._parted_disk.get_partition(minor) 312 parted_part = device._parted_disk.get_partition(minor)
313# if type == "ntfs": 313 if type == "ntfs":
314# 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 .\+//'")) 314 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 .\+//'"))
315# self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1 315 self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1
316# self._resizeable == True 316 self._resizeable == True
317# elif type == "ext2" or type == "ext3": 317 elif type == "ext2" or type == "ext3":
318# block_size = string.strip(commands.getoutput("dumpe2fs -h " + device._device + str(minor) + " 2>&1 | grep -e '^Block size:' | sed -e 's/^Block size:\s\+//'")) 318 block_size = string.strip(commands.getoutput("dumpe2fs -h " + device._device + str(minor) + " 2>&1 | grep -e '^Block size:' | sed -e 's/^Block size:\s\+//'"))
319# free_blocks = string.strip(commands.getoutput("dumpe2fs -h " + device._device + str(minor) + " 2>&1 | grep -e '^Free blocks:' | sed -e 's/^Free blocks:\s\+//'")) 319 free_blocks = string.strip(commands.getoutput("dumpe2fs -h " + device._device + str(minor) + " 2>&1 | grep -e '^Free blocks:' | sed -e 's/^Free blocks:\s\+//'"))
320# free_cyl = int(int(block_size) * int(free_blocks) / self._device._cylinder_bytes) 320 free_sec = int(int(block_size) * int(free_blocks) / self._device._sector_bytes)
321# free_cyl = int(free_cyl)
322# free_cyl = free_cyl - 200 # just to be safe 321 free_sec = free_sec - 2000 # just to be safe
323# self._min_cylinders_for_resize = (self._end - self._start + 1) - free_cyl 322 self._min_sectors_for_resize = (self._end - self._start + 1) - free_sec
324# self._resizeable == True 323 self._resizeable == True
325# elif type == "fat16" or type == "fat32": 324 else:
326# parted_part = self._device._parted_disk.get_partition(self._minor) 325 parted_part = self._device._parted_disk.get_partition(self._minor)
327# parted_fs = parted_part.geom.file_system_open() 326 parted_fs = parted_part.geom.file_system_open()
328# resize_constraint = parted_fs.get_resize_constraint() 327 resize_constraint = parted_fs.get_resize_constraint()
329# min_size = float(resize_constraint.min_size / self._device._sectors_in_cylinder) 328 min_size = resize_constraint.min_size
330# if int(min_size) != min_size: min_size = int(min_size) + 1 329 if int(min_size) != min_size: min_size = int(min_size) + 1
331# self._min_cylinders_for_resize = min_size 330 self._min_sectors_for_resize = min_size
332# self._resizeable = True 331 self._resizeable = True
333# elif type == "": 332# elif type == "":
334# self._min_cylinders_for_resize = 1 333# self._min_cylinders_for_resize = 1
335# self._resizeable = True 334# self._resizeable = True
336# else: 335# else:
337# self._resizeable = True 336# self._resizeable = True

Legend:
Removed from v.212  
changed lines
  Added in v.231

  ViewVC Help
Powered by ViewVC 1.1.20