Pino Toscano
2015-Jun-15 14:10 UTC
[Libguestfs] [PATCH] resize: make available expand method warnings more prominent
When hitting a filesystem which we cannot or don't know how to expand, instead of print a warning in verbose mode only, print it always when showing the summary of the changes. In the virt-resize documentation, add a paragraph about this warning. --- resize/resize.ml | 30 +++++++++++++++++++++++------- resize/virt-resize.pod | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/resize/resize.ml b/resize/resize.ml index 602a583..9ea5f8a 100644 --- a/resize/resize.ml +++ b/resize/resize.ml @@ -575,11 +575,7 @@ read the man page virt-resize(1). | ContentFS (("ntfs"), _) when !ntfs_available -> true | ContentFS (("btrfs"), _) when !btrfs_available -> true | ContentFS (("xfs"), _) when !xfs_available -> true - | ContentFS (fs, _) -> - if verbose () then - warning (f_"unknown/unavailable method for expanding filesystem %s") - fs; - false + | ContentFS (fs, _) -> false | ContentExtendedPartition -> false else fun _ -> false @@ -863,7 +859,17 @@ read the man page virt-resize(1). p.p_name (string_of_expand_content_method (expand_content_method p.p_type)) - ) else "" in + ) else ( + (match p.p_type with + | ContentUnknown + | ContentPV _ + | ContentExtendedPartition -> () + | ContentFS (fs, _) -> + warning (f_"unknown/unavailable method for expanding the %s filesystem on %s") + fs p.p_name; + ); + "" + ) in wrap (text ^ "\n\n") in @@ -883,7 +889,17 @@ read the man page virt-resize(1). name (string_of_expand_content_method (expand_content_method lv.lv_type)) - ) else "" in + ) else ( + (match lv.lv_type with + | ContentUnknown + | ContentPV _ + | ContentExtendedPartition -> () + | ContentFS (fs, _) -> + warning (f_"unknown/unavailable method for expanding the %s filesystem on %s") + fs name; + ); + "" + ) in wrap (text ^ "\n\n") ) lvs; diff --git a/resize/virt-resize.pod b/resize/virt-resize.pod index d8da02f..26fd136 100644 --- a/resize/virt-resize.pod +++ b/resize/virt-resize.pod @@ -727,6 +727,45 @@ the disk before. If you have to reuse a target which contains data already, you should use the I<--no-sparse> option. Note this can be much slower. +=head2 "unknown/unavailable method for expanding the TYPE filesystem on DEVICE/LV" + +Virt-resize was asked to expand a partition or a logical volume +containing a filesystem with the type C<TYPE>, but there is no +available nor known expanding method for that filesystem. + +This may be due to either of the following: + +=over 4 + +=item 1. + +There corresponding filesystem is not available in libguestfs, +because there is no proper package in the host with utilities for it. +This is usually the case for C<btrfs>, C<ntfs>, and C<xfs> +filesystems. + +Check the results of: + + virt-resize --machine-readable + guestfish -a /dev/null run : available + guestfish -a /dev/null run : filesystem_available TYPE + +In this case, it is enough to install the proper packages +adding support for them. For example, C<libguestfs-xfs> on +Red Hat Enterprise Linux, CentOS, Debian, Ubuntu, and distributions +derived from them, for supporting the C<xfs> filesystem. + +=item 2. + +Virt-resize has no support for expanding that type of filesystem. + +In this case, there's nothing that can be done to let virt-resize +expand that type of filesystem. + +=back + +In both cases, virt-resize will not expand the mentioned filesystem. + =head1 ALTERNATIVE TOOLS There are several proprietary tools for resizing partitions. We -- 2.1.0
Richard W.M. Jones
2015-Jun-15 15:55 UTC
Re: [Libguestfs] [PATCH] resize: make available expand method warnings more prominent
ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Chen, Hanxiao
2015-Jun-16 02:14 UTC
Re: [Libguestfs] [PATCH] resize: make available expand method warnings more prominent
> -----Original Message----- > From: libguestfs-bounces@redhat.com [mailto:libguestfs-bounces@redhat.com] On > Behalf Of Pino Toscano > Sent: Monday, June 15, 2015 10:10 PM > To: libguestfs@redhat.com > Subject: [Libguestfs] [PATCH] resize: make available expand method warnings more > prominent > > When hitting a filesystem which we cannot or don't know how to expand, > instead of print a warning in verbose mode only, print it always when > showing the summary of the changes. > > In the virt-resize documentation, add a paragraph about this warning. > --- > resize/resize.ml | 30 +++++++++++++++++++++++------- > resize/virt-resize.pod | 39 +++++++++++++++++++++++++++++++++++++++ > 2 files changed, 62 insertions(+), 7 deletions(-) >Reviewed-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Maybe Matching Threads
- [PATCH 2/2] resize: shrink/expand swap partitions
- [PATCH 1/2] resize: add --unknown-filesystems
- [PATCH 1/2] daemon: allow to change the labels of swap partitions
- [PATCH v2 2/2] resize: expand f2fs partitions
- [PATCH RFC] resize: add p_mbr_p_type as member of type partition