On Wed, Jul 06, 2011 at 12:47:21PM +0400, Nikita A Menkovich wrote:
  sectorsize:512 is option, that passed -S option to mkfs.ufs, patch
attached 
[...]
 --- /home/sh/projects/libguestfs-1.10.3/daemon/mkfs.c2011-07-04
09:48:46.000000000 +0000
 +++ daemon/mkfs.c20112011-07-06 08:08:12.000000000 +0000
 @@ -34,12 +34,13 @@
  /* Takes optional arguments, consult optargs_bitmask. */
  int
  do_mkfs_opts (const char *fstype, const char *device, int blocksize,
 -              const char *features, int inode)
 +              const char *features, int inode, int sectorsize)
  {
    const char *argv[MAX_ARGS];
    size_t i = 0;
    char blocksize_str[32];
    char inode_str[32];
 +  char sectorsize_str[32];
    int r;
    char *err;
  
 @@ -159,6 +160,23 @@
      argv[i++] = inode_str;
    }
  
 +
 +  if (optargs_bitmask & GUESTFS_MKFS_OPTS_SECTORSIZE_BITMASK) {
 +    if (!STREQ (fstype, "ufs")) {
 +      reply_with_error ("sector size (-S) can only be set on ufs
filesystems");
 +      return -1;
 +    }
 +
 +    if (sectorsize <= 0) {
 +      reply_with_error ("sector size must be larger than zero");
 +      return -1;
 +    }
 +
 +    snprintf (sectorsize_str, sizeof sectorsize_str, "%d", sectorsize);
 +    argv[i++] = "-S";
 +    argv[i++] = sectorsize_str;
 +  }
 +
    argv[i++] = device;
    argv[i++] = NULL;
  
 @@ -180,12 +198,12 @@
  do_mkfs (const char *fstype, const char *device)
  {
    optargs_bitmask = 0;
 -  return do_mkfs_opts (fstype, device, 0, 0, 0);
 +  return do_mkfs_opts (fstype, device, 0, 0, 0, 0);
  }
  
  int
  do_mkfs_b (const char *fstype, int blocksize, const char *device)
  {
    optargs_bitmask = GUESTFS_MKFS_OPTS_BLOCKSIZE_BITMASK;
 -  return do_mkfs_opts (fstype, device, blocksize, 0, 0);
 +  return do_mkfs_opts (fstype, device, blocksize, 0, 0, 0);
  } 
 ---
/home/sh/projects/libguestfs-1.10.3/generator/generator_actions.ml2011-07-04
09:48:46.000000000 +0000
 +++ generator/generator_actions.ml20112011-07-06 08:34:00.000000000 +0000
 @@ -5831,10 +5831,10 @@
  
  See also C<guestfs_is_lv>.");
  
 -  ("mkfs_opts", (RErr, [String "fstype"; Device "device"],
[Int "blocksize"; String "features"; Int "inode"]), 278,
[],
 +  ("mkfs_opts", (RErr, [String "fstype"; Device "device"],
[Int "blocksize"; String "features"; Int "inode"; Int
"sectorsize"]), 278, [],
     [InitEmpty, Always, TestOutput (
        [["part_disk"; "/dev/sda"; "mbr"];
 -       ["mkfs_opts"; "ext2"; "/dev/sda1";
"4096"; ""; "256"];
 +       ["mkfs_opts"; "ext2"; "/dev/sda1";
"4096"; ""; "256"; ""];
         ["mount_options"; ""; "/dev/sda1"; "/"];
         ["write"; "/new"; "new file contents"];
         ["cat"; "/new"]], "new file contents")],
 @@ -5874,6 +5874,11 @@
  This passes the I<-I> parameter to the external L<mke2fs(8)> program
  which sets the inode size (only for ext2/3/4 filesystems at present).
  
 +=item C<sectorsize>
 +
 +This passes the I<-S> parameter to external L<mkfs.ufs(8)> program,
 +which sets sector size for ufs filesystem.
 +
  =back"); 
Thanks, I have pushed this.  It required a fix to the generator which
I have also done.
http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=f7a11c60437afa700...
http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=39d5c63be6037d1cb...
http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=407d8fe1db9b8c9b0...
Rich.
-- 
Richard Jones, Virtualization Group, Red Hat 
http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw