<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">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<div><br></div><div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">I have no name!@(none):/# ntfsresize /dev/sda1</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">ntfsresize v2012.1.15AR.5 (libntfs-3g)</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">ERROR: Volume is scheduled for check.</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Run chkdsk /f and please try again, or see option -f.</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">I have no name!@(none):/# chkdsk /f</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">bash: chkdsk: command not found</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">I have no name!@(none):/# </div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">I have no name!@(none):/# ntfsresize -f /dev/sda1</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">ntfsresize v2012.1.15AR.5 (libntfs-3g)</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Device name        : /dev/sda1</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">NTFS volume version: 3.1</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Cluster size       : 4096 bytes</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Current volume size: 21472604672 bytes (21473 MB)</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Current device size: 32210026496 bytes (32211 MB)</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">New volume size    : 32210022912 bytes (32211 MB)</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Checking filesystem consistency ...</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">100.00 percent completed</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Accounting clusters ...</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Space in use       : 9815 MB (45.7%)</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Collecting resizing constraints ...</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">WARNING: Every sanity check passed and only the dangerous operations left.</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Make sure that important data has been backed up! Power outage or computer</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">crash may result major data loss!</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Are you sure you want to proceed (y/[n])? y</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Schedule chkdsk for NTFS consistency check at Windows boot time ...</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Resetting $LogFile ... (this might take a while)</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Updating $BadClust file ...</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Updating $Bitmap file ...</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Updating Boot record ...</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Syncing device ...</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);">Successfully resized NTFS on device '/dev/sda1'.</div></div><div><br><div apple-content-edited="true">
Keresztes Péter-Zoltán<br><a href="mailto:zozo@z0z0.tk">zozo@z0z0.tk</a><br>I haven’t lost my mind, I know exactly where I left it.
</div>
<br><div><div>On 01 Jul 2014, at 20:45, Richard W.M. Jones <<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">[Let's keep everything on the mailing list]<br><br>On Tue, Jul 01, 2014 at 08:37:39PM +0300, Keresztes Péter-Zoltán wrote:<br><blockquote type="cite">Hi, I have run the command with virt-rescue and after getting lots of error I get a prompt where I enter the ntfsresize —check /dev/sda1 and I get the following:<br><br>I have no name!@(none):/# ntfsresize --check /dev/sda1<br>ntfsresize v2012.1.15AR.5 (libntfs-3g)<br>I have no name!@(none):/# <br></blockquote><br>For comparison, here is the output using ntfs-3g-2014.2.15-1.fc20.x86_64:<br><br>  $ guestfish -N fs:ntfs exit<br>  $ virt-rescue --ro -a test1.img<br>  [...]<br><blockquote type="cite"><rescue> ntfsresize --check /dev/sda1<br></blockquote>  ntfsresize v2014.2.15 (libntfs-3g)<br><blockquote type="cite"><rescue><br></blockquote><br>So that's basically the same as your output, and indicates that<br>the ntfsresize command itself is working.<br><br>Now you should try actually resizing the partition in virt-rescue.<br>Since it is inside ``virt-rescue --ro'' it won't actually alter the<br>disk image -- the ``--ro'' flag means that libguestfs puts a<br>protective overlay between the commands in the rescue shell and the<br>underlying disk image.<br><br>Here is what happens for me:<br><br><blockquote type="cite"><rescue> ntfsresize /dev/sda1<br></blockquote>  ntfsresize v2014.2.15 (libntfs-3g)<br>  Device name        : /dev/sda1<br>  NTFS volume version: 3.1<br>  Cluster size       : 4096 bytes<br>  Current volume size: 104727040 bytes (105 MB)<br>  Current device size: 104727040 bytes (105 MB)<br>  New volume size    : 104727040 bytes (105 MB)<br>  Nothing to do: NTFS volume size is already OK.<br><br>Rich.<br><br>-- <br>Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones">http://people.redhat.com/~rjones</a><br>Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com">http://rwmj.wordpress.com</a><br>virt-top is 'top' for virtual machines.  Tiny program with many<br>powerful monitoring features, net stats, disk stats, logging, etc.<br><a href="http://people.redhat.com/~rjones/virt-top">http://people.redhat.com/~rjones/virt-top</a><br></blockquote></div><br></div></body></html>