X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=python%2Fguestfs.py;h=a82c8cba48878fea56dbd003b19f44b7d2d570e2;hb=6b668620681ada82857e09922a0feb004ee65882;hp=4a2804b497cd940fcb6dba19e98fc86327fbc379;hpb=85ed8cef99c19b4143844991d14e0b848fecc5da;p=libguestfs.git diff --git a/python/guestfs.py b/python/guestfs.py index 4a2804b..a82c8cb 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -1423,3 +1423,64 @@ class GuestFS: """ return libguestfsmod.vg_activate (self._o, activate, volgroups) + def lvresize (self, device, mbytes): + u"""This resizes (expands or shrinks) an existing LVM + logical volume to "mbytes". When reducing, data in the + reduced part is lost. + """ + return libguestfsmod.lvresize (self._o, device, mbytes) + + def resize2fs (self, device): + u"""This resizes an ext2 or ext3 filesystem to match the + size of the underlying device. + + *Note:* It is sometimes required that you run + "g.e2fsck_f" on the "device" before calling this + command. For unknown reasons "resize2fs" sometimes gives + an error about this and sometimes not. In any case, it + is always safe to call "g.e2fsck_f" before calling this + function. + """ + return libguestfsmod.resize2fs (self._o, device) + + def find (self, directory): + u"""This command lists out all files and directories, + recursively, starting at "directory". It is essentially + equivalent to running the shell command "find directory + -print" but some post-processing happens on the output, + described below. + + This returns a list of strings *without any prefix*. + Thus if the directory structure was: + + /tmp/a + /tmp/b + /tmp/c/d + + then the returned list from "g.find" "/tmp" would be 4 + elements: + + a + b + c + c/d + + If "directory" is not a directory, then this command + returns an error. + + The returned list is sorted. + + This function returns a list of strings. + """ + return libguestfsmod.find (self._o, directory) + + def e2fsck_f (self, device): + u"""This runs "e2fsck -p -f device", ie. runs the ext2/ext3 + filesystem checker on "device", noninteractively ("-p"), + even if the filesystem appears to be clean ("-f"). + + This command is only needed because of "g.resize2fs" + (q.v.). Normally you should use "g.fsck". + """ + return libguestfsmod.e2fsck_f (self._o, device) +