Hard Drive Full?

KB ID 0000012

Problem

The fact that I’m going back to re-write article 0000012, should tell you this is an omnipresent problem! Either very suddenly, or slowly over time you have a drive or a volume that’s full to bursting point. These days with laptops which have smaller SSD drives it’s a common problem.

I’ve seen literally hundreds of post in forums, most of them are answered with ‘Use WinDirStat’, or ‘Use TreeSize’. Techies seem to be a fan of one or the other, and stick with the tool that’s served them best.

What If There’s No Room To Install Either Of these?

Good point, then you can use PowerShell, I’ll cover that below also. Well I said everyone has a favourite solution, here’s mine,

WinDirStat

My weapon of choice, install it and give it the drive you want to analyse;

When it’s finished, you will see something like this;

So you get a graphical representation of the drive, and you can see TWO things straight away, firstly you can spot large files, click on them and it will tell you what they are. Secondly it groups ‘Types’ of files together, if you just look at folder sizes it can be misleading e.g. The ‘red’ files above are my MP3 Collection, I know that folder is massive and I expect it to have a lot of stuff in it. But in some cases this is great! e.g. If your IIS server is churning out logs and theres a folder with millions of them in it, you will spot it straight away.

Why Do I Prefer This? I prefer the graphical front end, I can send a screen shot to client, and they understand what’s happening, and it’s always been free. (There is a free version of TreeSize in fairness). I just like this one.

TreeSize

Once you’ve installed simply select the drive in question,

You can then drill down folders which are sized based on usage. One thing I do like about TreeSize is, it knows the difference between file size and actual size, and you can swap views accordingly. But I’ve included it here so every-time I post this article link in a forum, you can see both and make your own mind up.

PowerShell

This is really a PowerShell version of using the same approach TreeSize uses. You need a PowerShell plugin called PSFolderSize, then simply navigate to the the drive in question and run Get-FolderSize.

[box]

Install-Module PSFoldersize
cd {Drive-Letter}:
Get-FolderSize

[/box]

You can then drill down {cd folder-name} one at a time repeating the same command.

 

Related Articles, References, Credits, or External Links

NA

Cisco Catalyst – %Error Deleting flash:/{name} (Is a directory)

KB ID 0001070 

Problem

Today I was upgrading a Cisco 3750 switch, and needed to free up some space in the flash memory to upload the new system image to. But when I tried to delete the current system file I got this error.

[box]

Petes-3750# dir
Directory of flash:/

2 -rwx 796 Mar 7 1993 01:15:49 +00:00 vlan.dat
3 drwx 192 Mar 1 1993 00:17:13 +00:00 c3750-ipservicesk9-mz.122-55.SE5
4 -rwx 5504 May 27 2015 10:23:47 +00:00 private-config.text
85 -rwx 3096 May 27 2015 10:23:47 +00:00 multiple-fs
86 -rwx 2544 Mar 1 1993 00:01:40 +00:00 config.backup
88 -rwx 4020 May 27 2015 10:23:47 +00:00 config.text

15998976 bytes total (2421248 bytes free)
Petes-3750(config-if)#exit

Petes-3750#delete flash:/c3750-ipservicesk9-mz.122-55.SE5
Delete filename [c3750-ipservicesk9-mz.122-55.SE5]?
Delete flash:/c3750-ipservicesk9-mz.122-55.SE5? [confirm]
%Error deleting flash:/c3750-ipservicesk9-mz.122-55.SE5 (Is a directory)

[/box]

Solution

Well the fact that the file name didn’t have ‘.bin’ on the end of it should have been a clue. Anyway to delete the folder you need to use the force and recursive switches in your delete command, (or you can use rmdir).</p?

[box]

Petes-3750#delete /force /recursive flash:/c3750-ipservicesk9-mz.122-55.SE5
Petes-3750#dir
Directory of flash:/

2 -rwx 796 Mar 7 1993 01:15:49 +00:00 vlan.dat
4 -rwx 5504 May 27 2015 10:23:47 +00:00 private-config.text
85 -rwx 3096 May 27 2015 10:23:47 +00:00 multiple-fs
86 -rwx 2544 Mar 1 1993 00:01:40 +00:00 config.backup
88 -rwx 4020 May 27 2015 10:23:47 +00:00 config.text

15998976 bytes total (15981056 bytes free)
Petes-3750#

[/box]

Related Articles, References, Credits, or External Links

NA