Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Mac OS X Install Space Usage

Mac OS X Install Space Usage
Thread Tools
milf
Mac Enthusiast
Join Date: Nov 2001
Location: Washington, DC 20009
Status: Offline
Reply With Quote
Jan 19, 2009, 05:50 PM
 
The numbers never seem to add up and I'm always at question to why my disk space just seems to disappear.

I viewed the size of each folder on my Macintosh HD and came up with a sum of 41,012,049,105 bytes. But when I view the size of the Macintosh HD itself I came up with a sum of 49,613,647,872 bytes.

What gives for the nearly 8GB difference and can I get it back!?!
Just my $.02 :-)
Ti Powerbook 1Ghz w/ Superdrive ......and lovin' it! :)
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Jan 19, 2009, 06:05 PM
 
There's a whole bunch of stuff at the root of the drive that Apple unfortunately chooses to make invisible, including the kernel itself and all of the BSD directories such as /bin, /sbin, /usr, etc. These include a lot of essential system files that will take up a few GB, and then there's also the swapfile, which will take up an amount of space dependent on how heavily you're using you computer, but usually it's a few GB too. You can't get that space back, because it's all important to the operation of your computer.

If you're running low on disk space, I'd suggest getting a new hard drive - they're cheaper per GB than they've ever been.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
ibook_steve
Moderator
Join Date: Oct 2001
Location: San Jose, CA
Status: Offline
Reply With Quote
Jan 19, 2009, 06:21 PM
 
I wouldn't say that it is unfortunate that Apple makes these files invisible.

Just imagine the problems if Joe Schmo was dragging these folders somewhere else or to the trash.

Steve
Celebrating 10 years and 4000 posts on MacNN!
     
mattyb
Addicted to MacNN
Join Date: Feb 2008
Location: Standing on the shoulders of giants
Status: Offline
Reply With Quote
Jan 19, 2009, 06:30 PM
 
Originally Posted by milf View Post
What gives for the nearly 8GB difference and can I get it back!?!
If anyone posts that you should run any 'rm' command in Terminal then ignore them.
     
milf  (op)
Mac Enthusiast
Join Date: Nov 2001
Location: Washington, DC 20009
Status: Offline
Reply With Quote
Jan 19, 2009, 06:30 PM
 
I'm good on space. I really just wanted to know. Thanks for the response.
Just my $.02 :-)
Ti Powerbook 1Ghz w/ Superdrive ......and lovin' it! :)
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Jan 19, 2009, 06:37 PM
 
Originally Posted by ibook_steve View Post
I wouldn't say that it is unfortunate that Apple makes these files invisible.

Just imagine the problems if Joe Schmo was dragging these folders somewhere else or to the trash.

Steve
Joe Schmo can already do that with /System, which would be just as bad. The fact that you have to enter your admin password to do it should be a warning to most users.

I've long wished that those folders would be in /System with only some invisible symlinks at the root of the drive, because I just hate hiding things. If they were visible, not only would the file sizes add up, but advanced users would be able to get in there more easily without having to use the keyboard.

It's clear by this time that Apple's not going to do this, though, so there's no point rehashing it again.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Tomchu
Mac Elite
Join Date: Sep 2005
Status: Offline
Reply With Quote
Jan 19, 2009, 06:56 PM
 
The swap file shouldn't be a few GB -- you're probably thinking of the safe sleep image. ;-)
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Jan 19, 2009, 07:02 PM
 
Mine's about 6 GB right now - it seems to pretty much always be in the multi-GB range.

I ordered some more RAM a little while ago, which might reduce that figure once it gets here, but the point stands that it's not unusual for your swapfiles to get pretty big if you use your computer a lot.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
B Gallagher
Grizzled Veteran
Join Date: Jan 2005
Location: New Zealand
Status: Offline
Reply With Quote
Jan 19, 2009, 07:09 PM
 
Ditto CharlesS's comment on the swap file - I usually get about 3-5GB of space back on my HD when I restart.
MBP 15" C2D 2.2GHz 4.0GB 500GB@5400
iPhone 4 32GB Black
     
mduell
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Jan 19, 2009, 08:09 PM
 
Drop into the terminal and run:

cd / && sudo du -chd 1
     
Spheric Harlot
Clinically Insane
Join Date: Nov 1999
Location: 888500128, C3, 2nd soft.
Status: Offline
Reply With Quote
Jan 20, 2009, 05:23 AM
 
I really wish people who posted command-line stuff would bother to explain it.

Because if you're just posting the command itself, you're doing one (or both) of two things:

1.) encouraging people to just blindly copy commands into their terminal and execute them - which is a completely disastrous pattern to get into. ESPECIALLY if the command includes a sudo, which requires an admin password. Guaranteed that you're either
a) training naïve computer illiterates to compromise/destroy their own computer, or that
b) your command will never be executed AT ALL.
Either way, completely useless.

2.) Just throwing around cryptic info, which accomplishes making you seem like a knowledgable, elitist geek with an ego problem.


I know it's just lack of time and/or laziness, but please consider the ramifications of what you're doing.

FWIW:
"cd" means "change directory", i.e. "look at this location", with "/" designating the top level of your hard drive.
"sudo" means "do as an omnipotent super user who can do anything",
and "du":
DESCRIPTION
The du utility displays the file system block usage for each file argument and for each
directory in the file hierarchy rooted in each directory argument. If no file is speci-
fied, the block usage of the hierarchy rooted in the current directory is displayed.
So this command says "show me all the filesizes of all the objects on the top level of the hard drive".

If you're unsure, you can always enter "man " followed by the command you wish to know about - this usually presents a full manual that explains exactly what a command does and how to use it. The above is excerpted from "man du".
     
badidea
Professional Poster
Join Date: Nov 2003
Location: Hamburg
Status: Offline
Reply With Quote
Jan 20, 2009, 09:26 AM
 
What's "&&" and "-chd 1"?
***
     
Maflynn
Professional Poster
Join Date: Mar 2002
Location: Boston
Status: Offline
Reply With Quote
Jan 20, 2009, 09:30 AM
 
Originally Posted by Spheric Harlot View Post
I really wish people who posted command-line stuff would bother to explain it.
QFT

Agreed, its setting them up for future problems by getting them into the habit to possibly do something bad to the computer. Plus it doesn't teach them anything. Personally I like to learn new commands and its always helpful for people to explain stuff instead of saying "do this"
~Mike
     
Spheric Harlot
Clinically Insane
Join Date: Nov 1999
Location: 888500128, C3, 2nd soft.
Status: Offline
Reply With Quote
Jan 20, 2009, 10:03 AM
 
Originally Posted by badidea View Post
What's "&&" and "-chd 1"?
"and"

and the second bit are the options for "du":

From "man du" output.
-c Display a grand total.

-d depth
Display an entry for all files and directories depth directories deep.

-h "Human-readable" output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte,
Terabyte and Petabyte.
so, "du -chd 1" means "Show me the size of everything at the location I'm at, label the units so I know what the hell it says, and only show the first directory level".
     
badidea
Professional Poster
Join Date: Nov 2003
Location: Hamburg
Status: Offline
Reply With Quote
Jan 20, 2009, 12:09 PM
 
Thanks!
I suppose that "&" means something else than "and" if "&&" is "and"?
And why do you even need "&&"?
Does "cd / sudo du -chd 1" not work?

(I can't try this myself right now since I'm at work and I have no admin rights on my UNIX workstation here)
***
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Jan 20, 2009, 03:39 PM
 
Originally Posted by Spheric Harlot View Post
I really wish people who posted command-line stuff would bother to explain it.

Because if you're just posting the command itself, you're doing one (or both) of two things:

1.) encouraging people to just blindly copy commands into their terminal and execute them - which is a completely disastrous pattern to get into. ESPECIALLY if the command includes a sudo, which requires an admin password. Guaranteed that you're either
a) training naïve computer illiterates to compromise/destroy their own computer, or that
b) your command will never be executed AT ALL.
Either way, completely useless.

2.) Just throwing around cryptic info, which accomplishes making you seem like a knowledgable, elitist geek with an ego problem.


I know it's just lack of time and/or laziness, but please consider the ramifications of what you're doing.
That was far better than I've ever been able to express it.

I, too, have been around here long enough to remember the jerks who used to take advantage of people in the early days by telling them to run "sudo rm -rf /" (note: please don't run the preceding command - it'll erase your hard drive and all other attached disks) and telling them it did something useful.

I'm going to bookmark this.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Spheric Harlot
Clinically Insane
Join Date: Nov 1999
Location: 888500128, C3, 2nd soft.
Status: Offline
Reply With Quote
Jan 20, 2009, 04:07 PM
 
Originally Posted by badidea View Post
Thanks!
I suppose that "&" means something else than "and" if "&&" is "and"?
And why do you even need "&&"?
Does "cd / sudo du -chd 1" not work?
I don't know about the "&&". But your version won't work because it's TWO commands: "cd /" is one ("move to this location") and "sudo du -chd 1" is another ("use administrator rights to look at everything in the current location and tell me how big it is, in understandable units").

Normally, you'd enter one, hit return, and then the other.
     
Art Vandelay
Professional Poster
Join Date: Sep 2002
Location: New York, NY
Status: Offline
Reply With Quote
Jan 20, 2009, 04:30 PM
 
You can execute multiple commands on one line. I'm not familiar with && but I tried it with a set of commands and it works. A semi-colon is another delimiter for multiple commands.

These commands will both list the contents of the root of your boot drive.
cd /; ls
cd / && ls
Vandelay Industries
     
Hal Itosis
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Jan 20, 2009, 05:33 PM
 
Originally Posted by Art Vandelay View Post
You can execute multiple commands on one line. I'm not familiar with && but I tried it with a set of commands and it works. A semi-colon is another delimiter for multiple commands. These commands will both list the contents of the root of your boot drive.
cd /; ls
cd / && ls
The && used that way is called an "and list". It's a way of chaining commands.
"Or lists" || are also possible.
With and-lists, if the first command fails [i.e., exit code not equal to zero] then the second one never gets called:

$ cd nofolder; ls
-bash: cd: nofolder: No such file or directory
Applications Documents Library Music Public
Desktop Downloads Movies Pictures Sites

$ cd nofolder && ls
-bash: cd: nofolder: No such file or directory

So basically, it works like a shortcut for an if/then statement:
if cd /; then ls; fi
-HI-
     
Art Vandelay
Professional Poster
Join Date: Sep 2002
Location: New York, NY
Status: Offline
Reply With Quote
Jan 20, 2009, 06:18 PM
 
Cool. Learn something new everyday.
Vandelay Industries
     
OreoCookie
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Jan 20, 2009, 06:46 PM
 
One ampersand (`&') puts an app into the background. Useful if you start graphical apps on Unix systems: otherwise you cannot use this particular Terminal anymore until you finish that app.
I don't suffer from insanity, I enjoy every minute of it.
     
OreoCookie
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Jan 20, 2009, 06:48 PM
 
@Hal
Thanks, I've never used the &&. So && is conditional executing depending on the exit code of the preceding app, right?
I don't suffer from insanity, I enjoy every minute of it.
     
Hal Itosis
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Jan 21, 2009, 02:53 AM
 
Originally Posted by OreoCookie View Post
So && is conditional executing depending on the exit code of the preceding app, right?
>Correct.<

However, chaining more than one pair of statements may require some care. [especially when trying to mix ANDs (&&) with ORs (||), usually in order to provide the "else" path.] In such cases, using braces { } can help group related stuff together... but -- at some point -- reverting back to plain old if/then conditionals (or a case statement) is cleaner/safer and easier to read.
-HI-
     
Simon
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Jan 21, 2009, 04:16 AM
 
Originally Posted by OreoCookie View Post
One ampersand (`&') puts an app into the background. Useful if you start graphical apps on Unix systems: otherwise you cannot use this particular Terminal anymore until you finish that app.
That's right. But there's a trick if you happen to forget to add the ampersand. In the shell, hit ctrl-z to interrupt the process and then enter bg for background. The GUI app will then continue while you once again have access to the shell.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:14 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,