Sign in with
Sign up | Sign in
Your question
Solved

Ex hdd mounting in linux takes space from linux?

Tags:
  • Hard Drives
  • Linux
Last response: in Linux/Free BSD
Share
August 31, 2011 1:17:42 PM

To clarify, as more data has been going to my ex hdd the space on the linux hdd(internal) has been gradually losing space. I did an analysis of the disk and it said that /media takes up around 450+ GBs of space. So I unmount the drive and I get the space back. When I mount it back, the space is gone. Maybe I'm still trapped in the windows mindset but this isn't supposed to happen right? I always thought to mount something in linux the end result would be the same as if doing it in windows. I'm using fedora 14 if that helps.

More about : hdd mounting linux takes space linux

a b 5 Linux
August 31, 2011 1:51:38 PM

If you mount a disk on /media then the size of that directory will increase by the size of the data on the disk (for example if you use "du" to measure its size). It depends upon how you are measuring the space used. "df" should correctly report the size of the individual filesystems.
m
0
l
a b 5 Linux
August 31, 2011 4:10:05 PM

When nothing's mounted to /media, the space reported is the free space of the disk that contains the /media folder (in other words, your root drive) and doesn't report any disk usage.

Once you mount a drive there, then it creates a tiered storage setup wherein the space available/used by a disk exists under where it's mounted 9the mountpoint). A Windows-centric explanation would be if you had two disks, C:\ and D:\, but instead of D:\ showing up at the very top (when you open Explorer), if it instead were being used to hold the contents of Program Files (which, coincidentally, you absolutely can do with Windows; an extra disk need not exist at the root and be lettered)

Short version: It does add to the overall space used by the overall filesystem, but it also adds (more) available space to the overall filesystem. ijack's suggestion to read up on the "df" command and try it out s a fine way to visualize what I've been attempting to explain here.
  1. HDD1(sda1) HDD2(sdb1)
  2. V V
  3. +--------++----------------+
  4. |/media/ ||ExternalDisk |
  5. |/usr |+----------------+
  6. |/bin +-----------------+
  7. |.... |
  8. +--------------------------+

In this diagram, the path /media/ExternalDisk would correspond to the storage of D:\ on windows, but it has a location within the first disk (which contains /media, /bin/etc.), which corresponds to C:\ on Windows. So, as noted above, it's like putting D:\ under a folder on C:\ (which, also as I noted above, is possible to do under Windows)
m
0
l
Related resources
September 1, 2011 1:45:22 AM

So if I understand correctly, its like the space is being sectioned off. While on file I'm losing space I'm really not because I have whatever may be left on the internal hdd plus the external disk. Is this a correct assumption?
m
0
l
a b 5 Linux
September 1, 2011 6:45:21 AM

You are not losing any space. The disk has as much free space after the mount as it had before. It is just a question of what you are actally measuring.

How are you measuring space used and free? "df" is the command to measure this aspect of physical disks. Try it and see what it reports before and after the mount.
m
0
l
a b 5 Linux
September 1, 2011 7:50:07 AM

It's not really being sectioned off, you're not really losing/using up space on the root drive, to borrow my previous figure, below is what the overall filesystem looks like with the external drive removed
  1. HDD1(sda1)
  2. V
  3. +--------+
  4. |/media/ |
  5. |/usr |
  6. |/bin +-----------------+
  7. |.... |
  8. +--------------------------+

Same exact size, it's just that ExternalDrive no longer exists/contains the content of your external drive.
m
0
l
September 2, 2011 12:53:14 AM

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 10079084 9059016 508068 95% /
tmpfs 2059588 296 2059292 1% /dev/shm
/dev/sda3 228222260 60276564 156352688 28% /home
/dev/sdb5 192292660 191816 182332900 1% /opt2
/dev/sdc1 976758780 393525100 583233680 41% /media/Elements
*won't format this correctly*

This and bmouring's diagram really puts things in perspective... (Please forgive the horrible analogy) It's like a game, you get the full game but you can get dlc to expand the game. It's no less complete with or without the dlc... Yeah that really was bad but I assure you I get it what you guys are saying. I find myself wanting to learn more. Think I'll google some linux information on various concepts and commands. If you guys have any suggestions please post. And thank you for your help and patience.
m
0
l

Best solution

a b 5 Linux
September 2, 2011 5:08:45 AM

Fenrir190,

That's a perfectly good example (when viewed from the gameplay perspective, storage-space-wise of course it doesn't work :) )

Hmm, as far as guides, I know there are some good ones out there that will cover the material you're looking for, but it's a little tricky to try to pinpoint what it is that you're looking for and your level. This LifeHacker guide does a pretty decent job of covering all of the getting-started basics, but you may already be largely beyond what they're covering here. This one's a bit of a tome and will take some time, but it covers everything to a fairly in-depth level (for example, here is their treatment of the stuff that we've been talking about, and it's a nice, full discussion, but a bit heavy).

Ultimately, the way I got the the experience was just to use it and become proficient at googlefu to find the answers (and, if it was something that didn't make a ton of sense to me and interested me, I would continue to dig after solving the problem)

Edit: Just a bit of a pro-tip, if you want to get output from the command line formatted well in these threads, enclose the output in a "code" bbcode block, e.g.
  1. brad@onyx:~$ df
  2. Filesystem 1K-blocks Used Available Use% Mounted on
  3. /dev/sda1 110648144 41277460 63750052 40% /
  4. none 1923616 280 1923336 1% /dev
  5. none 1930676 272 1930404 1% /dev/shm
  6. none 1930676 360 1930316 1% /var/run
  7. none 1930676 4 1930672 1% /var/lock
  8. /dev/sdb 28312128 16603520 11708608 59% /media/Nokia N900
  9. /dev/sdc1 15313348 10217640 4317828 71% /media/987a0435-8ce2-488c-b043-7eab52dc3ba9

It's not always perfect, but it's close
Share
September 20, 2011 12:19:53 PM

Best answer selected by Fenrir190.
m
0
l
September 20, 2011 12:21:09 PM

bmouring said:
Fenrir190,

That's a perfectly good example (when viewed from the gameplay perspective, storage-space-wise of course it doesn't work :) )

Hmm, as far as guides, I know there are some good ones out there that will cover the material you're looking for, but it's a little tricky to try to pinpoint what it is that you're looking for and your level. This LifeHacker guide does a pretty decent job of covering all of the getting-started basics, but you may already be largely beyond what they're covering here. This one's a bit of a tome and will take some time, but it covers everything to a fairly in-depth level (for example, here is there treatment of the stuff that we've been talking about, and it's a nice, full discussion, but a bit heavy).

Ultimately, the way I got the the experience was just to use it and become proficient at googlefu to find the answers (and, if it was something that didn't make a ton of sense to me and interested me, I would continue to dig after solving the problem)

Edit: Just a bit of a pro-tip, if you want to get output from the command line formatted well in these threads, enclose the output in a "code" bbcode block, e.g.
  1. brad@onyx:~$ df
  2. Filesystem 1K-blocks Used Available Use% Mounted on
  3. /dev/sda1 110648144 41277460 63750052 40% /
  4. none 1923616 280 1923336 1% /dev
  5. none 1930676 272 1930404 1% /dev/shm
  6. none 1930676 360 1930316 1% /var/run
  7. none 1930676 4 1930672 1% /var/lock
  8. /dev/sdb 28312128 16603520 11708608 59% /media/Nokia N900
  9. /dev/sdc1 15313348 10217640 4317828 71% /media/987a0435-8ce2-488c-b043-7eab52dc3ba9

It's not always perfect, but it's close


Thanks for the tip bmouring. Take care all!
m
0
l
!