- log.write( "Extending vservers logical volume.\n" )
-
- if not utils.sysexec_noerr("lvextend -l +%s /dev/planetlab/vservers" %
- remaining_extents, log):
- log.write( "Failed to extend vservers logical volume, continuing\n" )
- return 1
-
- log.write( "making the ext3 filesystem match new logical volume size.\n" )
- if not utils.sysexec_noerr("resize2fs /dev/planetlab/vservers",log):
- log.write( "Failed to make ext3 file system match, continuing\n" )
- return 1
-
- log.write( "Succesfully extended vservers partition by %4.2f GB\n" %
- extended_gb_size )
+ log.write( "Extending vservers logical volume.\n" )
+ utils.sysexec( "vgchange -ay", log )
+ cmd = "lvextend -l +%s %s" % (remaining_extents, PARTITIONS["vservers"])
+ if not utils.sysexec_noerr(cmd, log):
+ log.write( "Failed to extend vservers logical volume, continuing\n" )
+ res = 1
+ break
+
+ log.write( "making the ext3 filesystem match new logical volume size.\n" )
+ if BOOT_CD_VERSION[0] == 2:
+ cmd = "resize2fs %s" % PARTITIONS["vservers"]
+ resize = utils.sysexec_noerr(cmd,log)
+ elif BOOT_CD_VERSION[0] == 3:
+ vars['ROOT_MOUNTED']= 1
+ cmd = "mount %s %s" % (PARTITIONS["root"],SYSIMG_PATH)
+ utils.sysexec_noerr( cmd, log )
+ cmd = "mount %s %s/vservers" % \
+ (PARTITIONS["vservers"],SYSIMG_PATH)
+ utils.sysexec_noerr( cmd, log )
+ cmd = "ext2online %s/vservers" % SYSIMG_PATH
+ resize = utils.sysexec_noerr(cmd,log)
+ utils.sysexec_noerr( "umount %s/vservers" % SYSIMG_PATH, log )
+ utils.sysexec_noerr( "umount %s" % SYSIMG_PATH, log )
+ vars['ROOT_MOUNTED']= 0
+
+ utils.sysexec( "vgchange -an", log )
+
+ if not resize:
+ log.write( "Failed to resize vservers partition, continuing.\n" )
+ res = 1
+ break
+ else:
+ log.write( "Extended vservers partition by %4.2f GB\n" %
+ extended_gb_size )
+ res = 1
+ break
+