[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6268: Suggestion: truncate should allow -r and -s options together

From: Richard W.M. Jones
Subject: bug#6268: Suggestion: truncate should allow -r and -s options together
Date: Tue, 25 May 2010 15:32:05 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

The manpage for truncate says:

  Note that the -r and -s options are mutually exclusive.

and indeed you cannot have both:

  $ truncate -r /tmp/ref -s +10M /tmp/new
  truncate: you must specify one of `--size' or `--reference'

We suggest using the 'truncate' command in the 'virt-resize'
documentation[1].  We want users to create a file which is the size of
an existing file + some extra amount.  Naturally this would be:

  truncate -r old-disk.img -s +1G new-disk.img

but this does not work and we have to suggest that users use two
separate 'truncate' commands[2].

Related to this feature request, it would be nice if you could suffix
a size with a % sign to indicate that you want to increase a file by a
certain percentage of the old or reference size, eg:

  truncate -r old-disk.img -s +10% new-disk.img

  truncate -r old-disk.img -s 110% new-disk.img

Neither of these forms work at the moment.


[1] http://libguestfs.org/virt-resize.1.html#expanding_a_virtual_machine_disk

Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]