defrag command line in Windows 7

1

I'm trying to consolidate my system partition volume by running defrag in a command prompt in command line recovery mode.

This is the command I'm trying to have executed: defrag C: /X /H /U

After I enter the command above all I can see is:

Microsoft Disk Defragmenter
Copyright (c) 2007 Microsoft Corp.

and the line is ready to take new commands. No reports, no time used to execute the operation.

Am I doing something wrong? Is the operation executing in the background?

maja

Posted 2014-08-03T11:35:56.317

Reputation: 307

Run the following command and post here the full output: wmic logicaldisk get caption,filesystem,size,volumename – and31415 – 2014-08-03T12:16:32.687

here you are: Caption FileSystem Size VolumeName C: NTFS 100075040768 OS D: NTFS 216149475328 E: – maja – 2014-08-03T13:17:20.393

Judging by the output: C: is 93 GiB and it's associated with the operating system; D: is 201 GiB and is probably used to store personal data; E: should correspond to a CD/DVD drive. Correct if I'm wrong. Which steps did you follow to run the defrag utility, exactly? Do you get the same issue if you try defrag D: /X /H /U instead? – and31415 – 2014-08-03T14:27:29.677

You're right about the data given by logicaldisk, the machine also has a FAT recovery partition and ext4+swap partitions. – maja – 2014-08-03T17:43:05.173

The steps I took are to enter Windows in safe made and then input the command in a prompt. I tried to do this in command prompt recovery mode (no gui), in "normal" recovery mode (in this case I did elevate the prompt) and in a normal session. In the normal session the command executes without any problem, in recovery mode it just gives the copyright info and no other output. – maja – 2014-08-03T17:49:15.983

I'm trying to execute the command in recovery mode because I'm trying a few steps suggested in some gparted documentation about shrinking Windows partitions without making a whole mess out of it (at this point I have the file $mftmirr written at the very end of those 93GB). – maja – 2014-08-03T17:49:47.407

It seems like defrag * is not loaded in recovery mode... – maja – 2014-08-03T17:50:24.980

It works for me: http://i.stack.imgur.com/3PKsE.png

– and31415 – 2014-08-03T21:54:52.997

are you using a version of Windows 7 without the SP1 updates? – maja – 2014-08-04T09:05:45.393

Let us continue this discussion in chat.

– and31415 – 2014-08-04T11:18:07.427

Answers

1

maja

Posted 2014-08-03T11:35:56.317

Reputation: 307

also, if someone would change the question into "defrag command line in Windows 7's recovery mode" the whole post would make more sense.. – maja – 2014-08-03T21:39:03.030