Re: Files deleted but free space doesn't increase



The strange thing is that when I give you a self-logging batch file to
create and delete a big file then things work out exactly as expected. On
the other hand, when you do things manually then they don't. It seems
necessary to repeat the deletion exercise, but this time with ***your***
files and with the process documenting itself. Try this batch file:

@echo off
set Active=no
set Drive=F:
set Folder=%Drive%\Some Folder Name

echo %date% %time% > c:\test.txt
echo.
echo Before emptying "%folder%" >> c:\test.txt
dir "%folder%" >> c:\test.txt
fsutil volume diskfree %Drive% >> c:\test.txt

if /i %Active%==yes (
del /q "%folder%\*.*" 1>>c:\test.txt 2>>&1
) else (
echo del /q "%folder%\*.*"
)
echo. >> c:\test.txt
echo After emptying "%folder%" >> c:\test.txt
dir "%folder%" >> c:\test.txt
fsutil volume diskfree %Drive% >> c:\test.txt

notepad c:\test.txt

Adjust lines 3 and 4 to suit your environment. Do not add any double quotes
to the folder name and leave the "Set active=no" line as it is. Now run the
batch file from the Command Prompt. It will show you the "delete" command
used if it was active. If you're happy that the command is correct, modify
Line 2 like so:
set Active=yes
Do not add any spaces other than between "set" and "Active". Now run the
batch file and examine the evidence.


"JaimeZX" <JaimeZX@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ACD9CBF6-2DAD-4614-88E5-EBACCA84EE4E@xxxxxxxxxxxxxxxx
I can certainly understand why you would say that, but here's what confuses
me:
Let's say I want to delete f:\1\*.*, which as I said is 100,000 files for
28GB. I determine this two ways: first, in the window status bar it says
"100,000 files 28GB" and second, if I right click -> properties on the
folder
for "1," it says "100,000 files, 28GB."

So if I right-click -> delete the directory numbered 1, OR if I go into
the
command prompt to do that, the directory goes away. But as I say, the free
space doesn't increase. I've been doing some further research and have
read
that UNIX occasionally stores files in more than one location, but I
haven't
seen anything along those lines for NTFS. How else would you go about
deleting the files?

(I guess what I'm saying is that I'm 99% sure I am not deleting a
shortcut.)

Thanks for all of your help, I *do* appreciate your thoughts!

Jim

"Pegasus (MVP)" wrote:

The test you ran shows clearly that the amount of free space decreased
when
you created a large file and it increased when you deleted this same
file.
Conclusions:
- File deletion does work as expected.
- When you think you're deleting one of your own big files
then you're deleting something other than that file.

I suspect you deleted a link. The file behind the link is still there.


"JaimeZX" <JaimeZX@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9C044B7D-CE03-49E1-A7A8-BDD09CD095C5@xxxxxxxxxxxxxxxx
Well that seems to have run okay.
--------------------------------
Wed 10/08/2008 12:30:15.73
Before creating the big test file
Total # of free bytes : 1145970688
Total # of bytes : 5247106805760
Total # of avail free bytes : 1145970688

After creating the big test file
Total # of free bytes : 1045966848
Total # of bytes : 5247106805760
Total # of avail free bytes : 1045966848

After deleting the big test file
Total # of free bytes : 1145970688
Total # of bytes : 5247106805760
Total # of avail free bytes : 1145970688

One minute later . . .
Total # of free bytes : 1145970688
Total # of bytes : 5247106805760
Total # of avail free bytes : 1145970688
--------------------------------

So why would that work and clear up space when
del f:\1\*.*
(28GB in 100,000 files) does nothing?

Jim


"Pegasus (MVP)" wrote:

This is getting a little bizarre. Let's put your machine on the lie
detector
by running a set of non-GUI commands. Copy the lines below into
c:\test.bat, then run c:\test.bat from a Command Prompt:
@echo off
set size=100000000
if exist c:\big.bin del c:\big.bin

echo %date% %time% > c:\test.txt
echo.
echo Before creating the big test file >> c:\test.txt
fsutil volume diskfree c: >> c:\test.txt

fsutil file createnew c:\big.bin %size%
echo. >> c:\test.txt
echo After creating the big test file >> c:\test.txt
fsutil volume diskfree c: >> c:\test.txt

del c:\big.bin
echo. >> c:\test.txt
echo After deleting the big test file >> c:\test.txt
fsutil volume diskfree c: >> c:\test.txt

echo Pausing for a minute . . .
ping localhost -n 60 > nul
echo. >> c:\test.txt
echo One minute later . . . >> c:\test.txt
fsutil volume diskfree c: >> c:\test.txt
notepad c:\test.txt

The batch file will create and delete a 100 MByte file while
monitoring
the
amount of free disk space. Post the contents of the notepad screen you
see
at the end.


"JaimeZX" <JaimeZX@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:52CC23F7-AC72-4A3B-89FC-A3082E5ABCD0@xxxxxxxxxxxxxxxx
Sorry for the delay, I had to wait for chkdisk to finish and then
last-minute
trip out of town.

Deleting from command prompt does the same thing. 58GB of files
appear
to
be
gone but no space is freed up. Still only 1GB free on the drive. Now
I've
deleted close to 200GB and still only 1GB "free." This is bizarre.

Thanks again for your thoughts!

"Pegasus (MVP)" wrote:


"JaimeZX" <JaimeZX@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AF619ACC-9CBE-44BF-A0BC-2E2157C5655D@xxxxxxxxxxxxxxxx
This is a follow-up to a previous post where I am organizing
several
TB
of
files. The proprietary software I'm using only copies files, it
doesn't
move
them.

So after confirming the successful copy of the database files, I
go
into
the
old directory to delete them. Windows (Server 2003) tells me "the
files
you
are trying to delete are too big for the Recycle Bin. Would you
like
to
permanently delete them?"
I click "Yes to all."

The files and their directories disappear but no space is freed
up
on
the
drive. I'll bet I've deleted over 100GB so far but the free space
remains
unchanged. I've tried rebooting to no avail. Now I'm running
checkdisk
on
the
drive, but any other suggestions y'all might have would be
helpful.

I do not have Norton installed on this machine. It's just a
straight-up
Server 2003 install.

Thanks in advance!

What happens when you delete some of those big files from the
Command
Prompt?











.



Relevant Pages

  • Re: How to program Enable, Disable drivers?
    ... Use this batch file to enable or disable a device ... setlocal enabledelayedexpansion ... echo Syntax: Device enable / disable ... Open a Command Prompt. ...
    (microsoft.public.windowsxp.general)
  • Re: Files deleted but free space doesnt increase
    ... command prompt to do that, ... (I guess what I'm saying is that I'm 99% sure I am not deleting a shortcut.) ... Before creating the big test file ... echo %date% %time%> c:\test.txt ...
    (microsoft.public.windows.file_system)
  • Re: Files deleted but free space doesnt increase
    ... echo %date% %time%> c:\test.txt ... command prompt to do that, ... deleting the files? ... Before creating the big test file ...
    (microsoft.public.windows.file_system)
  • Re: Files deleted but free space doesnt increase
    ... command prompt to do that, ... (I guess what I'm saying is that I'm 99% sure I am not deleting a shortcut.) ... Before creating the big test file ... echo %date% %time%> c:\test.txt ...
    (microsoft.public.windows.file_system)
  • Re: Help with batch file!! File Cleanup
    ... I was having issues with this deleting the entire folder last week. ... It deletes the entire test folder instead of the files inside which I can ... I need help adding to my batch file a method of deleting any files over ... other than the one in "@echo off". ...
    (microsoft.public.windows.server.general)

Quantcast