[Libguestfs] [PATCH] fish: Increase default size of prepared disks (-N) to 1G.

Richard W.M. Jones rjones at redhat.com
Tue Apr 10 09:57:30 UTC 2018


The guestfish prepared disks (-N option) all defaulted to 100M.  This
has always been too small for btrfs (so for example ‘-N fs:btrfs’ has
failed for a long time), and can be too small for LVs with new LVM2 /
kernel >= 4.16.

This changes the default from 100M to 1G.  The beginning of the 1.39
branch seems like a good time to make this change.
---
 fish/guestfish.pod    | 14 +++++++-------
 generator/prepopts.ml | 28 ++++++++++++++--------------
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/fish/guestfish.pod b/fish/guestfish.pod
index bbf43aad5..4f24006b8 100644
--- a/fish/guestfish.pod
+++ b/fish/guestfish.pod
@@ -120,8 +120,8 @@ Create a 100MB disk containing an ext2-formatted partition:
 
 =head2 Start with a prepared disk
 
-An alternate way to create a 100MB disk called F<test1.img> containing
-a single ext2-formatted partition:
+Create a 1G disk called F<test1.img> containing a single
+ext2-formatted partition:
 
  guestfish -N fs
 
@@ -1084,10 +1084,10 @@ C<filename=> before the type (see examples below).
 The type briefly describes how the disk should be sized, partitioned,
 how filesystem(s) should be created, and how content should be added.
 Optionally the type can be followed by extra parameters, separated by
-C<:> (colon) characters.  For example, I<-N fs> creates a default
-100MB, sparsely-allocated disk, containing a single partition, with
-the partition formatted as ext2.  I<-N fs:ext4:1G> is the same, but
-for an ext4 filesystem on a 1GB disk instead.
+C<:> (colon) characters.  For example, I<-N fs> creates a default 1G,
+sparsely-allocated disk, containing a single partition, with the
+partition formatted as ext2.  I<-N fs:ext4:2G> is the same, but for an
+ext4 filesystem on a 2GB disk instead.
 
 Note that the prepared filesystem is not mounted.  You would usually
 have to use the C<mount /dev/sda1 /> command or add the
@@ -1098,7 +1098,7 @@ is automatically launched.
 
 =head2 EXAMPLES
 
-Create a 100MB disk with an ext4-formatted partition, called
+Create a 1G disk with an ext4-formatted partition, called
 F<test1.img> in the current directory:
 
  guestfish -N fs:ext4
diff --git a/generator/prepopts.ml b/generator/prepopts.ml
index 5a1ba3d88..a0a1925da 100644
--- a/generator/prepopts.ml
+++ b/generator/prepopts.ml
@@ -27,17 +27,17 @@ type prepopt = string * string * optargs * string
 let prepopts = [
   ("disk",
    "create a blank disk",
-   [ "size", "100M", "the size of the disk image" ],
-   "Create a blank disk, size 100MB (by default).
+   [ "size", "1G", "the size of the disk image" ],
+   "Create a blank disk, size 1G (by default).
 
 The default size can be changed by supplying an optional parameter.");
 
   ("part",
    "create a partitioned disk",
-   [ "size", "100M", "the size of the disk image";
+   [ "size", "1G", "the size of the disk image";
      "partition", "mbr", "partition table type" ],
    "Create a disk with a single partition.  By default the size of the disk
-is 100MB (the available space in the partition will be a tiny bit smaller)
+is 1G (the available space in the partition will be a tiny bit smaller)
 and the partition table will be MBR (old DOS-style).
 
 These defaults can be changed by supplying optional parameters.");
@@ -45,10 +45,10 @@ These defaults can be changed by supplying optional parameters.");
   ("fs",
    "create a filesystem",
    [ "filesystem", "ext2", "the type of filesystem to use";
-     "size", "100M", "the size of the disk image";
+     "size", "1G", "the size of the disk image";
      "partition", "mbr", "partition table type" ],
    "Create a disk with a single partition, with the partition containing
-an empty filesystem.  This defaults to creating a 100MB disk (the available
+an empty filesystem.  This defaults to creating a 1G disk (the available
 space in the filesystem will be a tiny bit smaller) with an MBR (old
 DOS-style) partition table and an ext2 filesystem.
 
@@ -57,11 +57,11 @@ These defaults can be changed by supplying optional parameters.");
   ("lv",
    "create a disk with logical volume",
    [ "name", "/dev/VG/LV", "the name of the VG and LV to use";
-     "size", "100M", "the size of the disk image";
+     "size", "1G", "the size of the disk image";
      "partition", "mbr", "partition table type" ],
    "Create a disk with a single partition, set up the partition as an
 LVM2 physical volume, and place a volume group and logical volume
-on there.  This defaults to creating a 100MB disk with the VG and
+on there.  This defaults to creating a 1G disk with the VG and
 LV called C</dev/VG/LV>.  You can change the name of the VG and LV
 by supplying an alternate name as the first optional parameter.
 
@@ -71,20 +71,20 @@ Note this does not create a filesystem.  Use 'lvfs' to do that.");
    "create a disk with logical volume and filesystem",
    [ "name", "/dev/VG/LV", "the name of the VG and LV to use";
      "filesystem", "ext2", "the type of filesystem to use";
-     "size", "100M", "the size of the disk image";
+     "size", "1G", "the size of the disk image";
      "partition", "mbr", "partition table type" ],
    "Create a disk with a single partition, set up the partition as an
 LVM2 physical volume, and place a volume group and logical volume
 on there.  Then format the LV with a filesystem.  This defaults to
-creating a 100MB disk with the VG and LV called C</dev/VG/LV>, with an
+creating a 1G disk with the VG and LV called C</dev/VG/LV>, with an
 ext2 filesystem.");
 
   ("bootroot",
    "create a boot and root filesystem",
    [ "bootfs", "ext2", "the type of filesystem to use for boot";
      "rootfs", "ext2", "the type of filesystem to use for root";
-     "size", "100M", "the size of the disk image";
-     "bootsize", "32M", "the size of the boot filesystem";
+     "size", "1G", "the size of the disk image";
+     "bootsize", "128M", "the size of the boot filesystem";
      "partition", "mbr", "partition table type" ],
    "Create a disk with two partitions, for boot and root filesystem.
 Format the two filesystems independently.  There are several optional
@@ -95,8 +95,8 @@ parameters which control the exact layout and filesystem types.");
    [ "name", "/dev/VG/LV", "the name of the VG and LV for root";
      "bootfs", "ext2", "the type of filesystem to use for boot";
      "rootfs", "ext2", "the type of filesystem to use for root";
-     "size", "100M", "the size of the disk image";
-     "bootsize", "32M", "the size of the boot filesystem";
+     "size", "1G", "the size of the disk image";
+     "bootsize", "128M", "the size of the boot filesystem";
      "partition", "mbr", "partition table type" ],
    "This is the same as C<bootroot> but the root filesystem (only) is
 placed on a logical volume, named by default C</dev/VG/LV>.  There are
-- 
2.15.1




More information about the Libguestfs mailing list