X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fgenerator.ml;h=04445ee6c7177731bfe3e799ae13ff4d0fed7103;hb=4581eb2523eeb4d094d53af0555cb7e0f760ae2d;hp=9a9c168ed630f8a3583306edae18cca7440dcf80;hpb=f7e6ffa8a82f8a7a214a47ff32f46d9e893902d8;p=libguestfs.git diff --git a/src/generator.ml b/src/generator.ml index 9a9c168..04445ee 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -1632,6 +1632,58 @@ to return the existing UUID of a filesystem."); This returns the ext2/3/4 filesystem UUID of the filesystem on C."); + ("fsck", (RInt "status", [String "fstype"; String "device"]), 84, [], + [InitBasicFS, TestOutputInt ( + [["umount"; "/dev/sda1"]; + ["fsck"; "ext2"; "/dev/sda1"]], 0); + InitBasicFS, TestOutputInt ( + [["umount"; "/dev/sda1"]; + ["zero"; "/dev/sda1"]; + ["fsck"; "ext2"; "/dev/sda1"]], 8)], + "run the filesystem checker", + "\ +This runs the filesystem checker (fsck) on C which +should have filesystem type C. + +The returned integer is the status. See L for the +list of status codes from C. + +Notes: + +=over 4 + +=item * + +Multiple status codes can be summed together. + +=item * + +A non-zero return code can mean \"success\", for example if +errors have been corrected on the filesystem. + +=item * + +Checking or repairing NTFS volumes is not supported +(by linux-ntfs). + +=back + +This command is entirely equivalent to running C."); + + ("zero", (RErr, [String "device"]), 85, [], + [InitBasicFS, TestOutput ( + [["umount"; "/dev/sda1"]; + ["zero"; "/dev/sda1"]; + ["file"; "/dev/sda1"]], "data")], + "write zeroes to the device", + "\ +This command writes zeroes over the first few blocks of C. + +How many blocks are zeroed isn't specified (but it's I enough +to securely wipe the device). It should be sufficient to remove +any partition tables, filesystem superblocks and so on."); + + ] let all_functions = non_daemon_functions @ daemon_functions