On Tue, Jul 01, 2014 at 08:50:27PM +0300, Keresztes Péter-Zoltán wrote:
OK, that seam to work however it is not exactly the correct solution
for me since I need to make it one command to be able to call it
from an API
Understood. What I'm trying to find out is why the ntfsresize utility
is failing when it is being run under virt-resize, since it is not
printing any error message but is returning a non-zero error code.
By running it under virt-rescue, you can test ntfsresize and also see
the full errors.
I have no name!@(none):/# ntfsresize /dev/sda1
ntfsresize v2012.1.15AR.5 (libntfs-3g)
ERROR: Volume is scheduled for check.
Run chkdsk /f and please try again, or see option -f.
I think this is the problem.
In virt-resize 1.20 and above you can use ``virt-resize --ntfsresize-force''
which has the same effect as passing the -f option to ntfsresize:
--ntfsresize-force
Pass the --force option to ntfsresize(8), allowing resizing even if
the NTFS disk is marked as needing a consistency check. You have
to use this option if you want to resize a Windows guest multiple
times without booting into Windows between each resize.
However I am not sure if this is safe. You will have to ask the
ntfs-3g community whether running ntfsresize on a partition that is
marked as needing chkdsk is in fact safe, or if you are going to
have other problems from doing this.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages.
http://libguestfs.org