print " Device:", mdinfo.v.device print " Size:", libstorage.byteToHumanString( 1024 * mdinfo.v.sizeK, True, 2, False) print " Chunk Size:", libstorage.byteToHumanString( 1024 * mdinfo.chunkSizeK, True, 2, True) if container.type == libstorage.LVM: lvmvginfo = libstorage.LvmVgInfo() c.getLvmVgInfo(container.name, lvmvginfo) print " Size:", libstorage.byteToHumanString(1024 * lvmvginfo.sizeK, True, 2, False) print " PE Size:", libstorage.byteToHumanString( 1024 * lvmvginfo.peSizeK, True, 2, True) lvmlvinfos = libstorage.DequeLvmLvInfo() c.getLvmLvInfo(container.name, lvmlvinfos) for lvmlvinfo in lvmlvinfos: print " Device:", lvmlvinfo.v.device print " Size:", libstorage.byteToHumanString( 1024 * lvmlvinfo.v.sizeK, True, 2, False) print " Stripes:", lvmlvinfo.stripes if lvmlvinfo.stripes > 1: print " Stripe Size:", libstorage.byteToHumanString( 1024 * lvmlvinfo.stripeSizeK, True, 2, True) print libstorage.destroyStorageInterface(c)
#!/usr/bin/python from libstorage import Environment, createStorageInterface, saveDeviceGraph, saveMountGraph, destroyStorageInterface env = Environment(True) c = createStorageInterface(env) saveDeviceGraph(c, "device.gv") saveMountGraph(c, "mount.gv") destroyStorageInterface(c)
mdinfos = libstorage.dequemdinfo() c.getMdInfo(mdinfos) for mdinfo in mdinfos: print " Device:", mdinfo.v.device print " Size:", libstorage.byteToHumanString(1024 * mdinfo.v.sizeK, True, 2, False) print " Chunk Size:", libstorage.byteToHumanString(1024 * mdinfo.chunkSizeK, True, 2, True) if container.type == libstorage.LVM: lvmvginfo = libstorage.LvmVgInfo() c.getLvmVgInfo(container.name, lvmvginfo) print " Size:", libstorage.byteToHumanString(1024 * lvmvginfo.sizeK, True, 2, False) print " PE Size:", libstorage.byteToHumanString(1024 * lvmvginfo.peSizeK, True, 2, True) lvmlvinfos = libstorage.DequeLvmLvInfo() c.getLvmLvInfo(container.name, lvmlvinfos) for lvmlvinfo in lvmlvinfos: print " Device:", lvmlvinfo.v.device print " Size:", libstorage.byteToHumanString(1024 * lvmlvinfo.v.sizeK, True, 2, False) print " Stripes:", lvmlvinfo.stripes if lvmlvinfo.stripes > 1: print " Stripe Size:", libstorage.byteToHumanString(1024 * lvmlvinfo.stripeSizeK, True, 2, True) print libstorage.destroyStorageInterface(c)