PCLinuxOS-Forums
News: ...FLASH!!! ...New PCLinuxOS Testing board now open. Register today! Be an active contributor to the PCLinuxOS future! ... Read all about it now, on THIS forum!!!..
 
*
Welcome, Guest. Please login or register. May 27, 2012, 06:53:22 AM


Login with username, password and session length


Pages: [1] 2   Go Down
  Print  
Author Topic: (solved) How does Linux determine folder size?  (Read 1094 times)
JakeLogan
Full Member
***
Offline Offline

Posts: 123


Life ain't easy in the fringe


« on: December 17, 2010, 04:37:12 PM »

I have a folder or partition ( it shows as file system or Home on the desktop of Enlightenment) or under Dolphin as the root folder or home etc. It says for example File System, 6 gigs used out of 12 gigs or for Home, 3 gigs out of 8 gigs.

When I installed the OS I used a 30 gigabyte partition. Why don't those folders say 6 gigs used out of the total space available - 30 gigabytes?

How and why does it put a limit on those folders?;

and what happens if that space is full?

Say Home has used all 8 gigs but I know I have not reached my 30 gigabyte limit. What happens?
Logged
Was_Just19
Hero Member
*****
Offline Offline

Posts: 6885


MLU


« Reply #1 on: December 17, 2010, 06:12:54 PM »

To help clarify things run the following command in a terminal and copy and paste the whole lot in your next post .....

df

regards
Logged
JakeLogan
Full Member
***
Offline Offline

Posts: 123


Life ain't easy in the fringe


« Reply #2 on: December 17, 2010, 06:19:27 PM »

Cool command. Thanks.

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              12G  3.4G  7.9G  30% /
/dev/sda7              16G  395M   16G   3% /home
/dev/sda3             100M  3.6M   96M   4% /media/HP_TOOLS
/dev/sda1             199M   29M  171M  15% /media/disk
/dev/sda2             203G  168G   35G  83% /media/disk-1

1 and 2 are Windows 7, 3 is HP and 5 and 7 are Linux.

12 and 16 gigs. Hmm.. why does Linus split these into separate partitions and how does it determine how many gigs to use for each one?

I told it to use 30 gigs of space. 12 + 16 = 28. Where are my other 2 gigs?
Logged
Was_Just19
Hero Member
*****
Offline Offline

Posts: 6885


MLU


« Reply #3 on: December 17, 2010, 06:38:10 PM »

It appears from your setup that you did not make the decisions yourself but accepted the defaults when installing.

The default is to keep the user information & Data separate from the OS, so that you can reinstall the OS while retaining your user settings and data.

The file system on a partition is 'mounted' to a directory within the OS, so that opening that directory shows the contents of the file system on the partition.
Mount points like this are shown with a folder icon ...... 

Hope that helps explain a little.
Logged
muungwana
Hero Member
*****
Offline Offline

Posts: 5403


« Reply #4 on: December 17, 2010, 06:52:59 PM »

Cool command. Thanks.

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              12G  3.4G  7.9G  30% /
/dev/sda7              16G  395M   16G   3% /home
/dev/sda3             100M  3.6M   96M   4% /media/HP_TOOLS
/dev/sda1             199M   29M  171M  15% /media/disk
/dev/sda2             203G  168G   35G  83% /media/disk-1

1 and 2 are Windows 7, 3 is HP and 5 and 7 are Linux.

12 and 16 gigs. Hmm.. why does Linus split these into separate partitions and how does it determine how many gigs to use for each one?

I told it to use 30 gigs of space. 12 + 16 = 28. Where are my other 2 gigs?


"linux" did not split the one partition you assigned for installation into two, the installer did. Different distributions use different installers and they do the split differently, just though i should mention this to inform you of who did that.

In linux, it is generally advised to have a separate partition for a "/home" folder. It look like when you installed your system, you told the installer by going with the default to partition the drive the way it though is best and it came up with those two partitions. If you disagree with this, you can reinstall and manually set up how big each partition should be.

Partitioning is a relatively complicated step and you may need to go over it a couple of times to get it right. Different installers are better than others, hope ours will not be too complicated for you.

Those 2G are probably used by the file system. Partitioning a hard drive is usually followed by putting a file system on the drive and the file system take a bit of space for itself for file management. Any partitioned hard will take some space off the drive.

Logged

.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..
Bald Brick
PCLinuxOS Tester
Hero Member
*******
Online Online

Posts: 5147


I'm going South


« Reply #5 on: December 17, 2010, 07:30:46 PM »

Cool command. Thanks.

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              12G  3.4G  7.9G  30% /
/dev/sda7              16G  395M   16G   3% /home
/dev/sda3             100M  3.6M   96M   4% /media/HP_TOOLS
/dev/sda1             199M   29M  171M  15% /media/disk
/dev/sda2             203G  168G   35G  83% /media/disk-1

1 and 2 are Windows 7, 3 is HP and 5 and 7 are Linux.

12 and 16 gigs. Hmm.. why does Linus split these into separate partitions and how does it determine how many gigs to use for each one?

I told it to use 30 gigs of space. 12 + 16 = 28. Where are my other 2 gigs?


Some of it may be used by the system as muungwana wrote, but most of it is still there.

The problem is that there are two kinds of gigs: decimal gigabytes (GB) and traditional binary gigabytes, a.k.a. gibibytes (GiB).

A decimal gigabyte (1 GB) is simply 1,000,000,000 bytes.
A gibibyte (1 GiB) is 1,073,741,824 bytes. (2 to the 30th power.)

So 28 GiB is very close to 30 GB.


Manufacturers usually report disk sizes in decimal gigabytes because it gives them a larger number, while many apps (like the df command) by default use gibibytes.

Try comparing the output of "df" to the output of "df -H".
Logged

If it ain't broke
hit harder!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D
Aradalf
Sr. Member
****
Offline Offline

Posts: 485


« Reply #6 on: December 17, 2010, 07:35:50 PM »

Cool command. Thanks.

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              12G  3.4G  7.9G  30% /
/dev/sda7              16G  395M   16G   3% /home
/dev/sda3             100M  3.6M   96M   4% /media/HP_TOOLS
/dev/sda1             199M   29M  171M  15% /media/disk
/dev/sda2             203G  168G   35G  83% /media/disk-1

1 and 2 are Windows 7, 3 is HP and 5 and 7 are Linux.

12 and 16 gigs. Hmm.. why does Linus split these into separate partitions and how does it determine how many gigs to use for each one?

I told it to use 30 gigs of space. 12 + 16 = 28. Where are my other 2 gigs?

 The installer split your 30GB into separate partitions, because, as Just19 explained, a separate /home partition allows you to keep user information and data separate from system files.

  The 12GB partition, /(also called the root partation), is where your installed programs and system configuration are stored. The /home partition is where user configuration is stored, in addition to personal files. Normally, documents and user settings need more space than OS configuration, so that's how the installer configured it.

  The other 2GB is probably used for your swap partition, which is basically a virtual memory space allotted on your hard drive, to be used by the system when not enough RAM is available. df does not show swap partitions and in your list partition sda6 is missing, which is what led to be suppose that sda6(the remaining 2GB is swap.

  To be sure, type fdisk -l in a terminal, and paste the entire output in your next post.
Logged

JakeLogan
Full Member
***
Offline Offline

Posts: 123


Life ain't easy in the fringe


« Reply #7 on: December 17, 2010, 07:39:09 PM »

muungwana, Just19, Aradalf and Bald Brick:

 Yes, those explanations did help a lot. Thank you all very much. I did choose the defaults during installation. It's very interesting how the partition managers/installers set up Linux differently than the dos and windows partitions I am familiar with. You just make a partition like a big box and everything goes inside it.

I do not disagree with the way this works.. I just didn't understand it. I have no more space to fudge on this drive anyway.

However when I am able to use a larger hard drive for Linux, I will be needing to set up the partitions differently because I will not want to take a chance of running out of space for one or the other of those partitions when used with a large hard drive I know I will fill. In a case like that.. what is the recommended setup? How large should I make those partitions? ( Let's say I am going to use a 500 gigabyte drive)
Logged
muungwana
Hero Member
*****
Offline Offline

Posts: 5403


« Reply #8 on: December 17, 2010, 07:48:53 PM »

what is the recommended setup? How large should I make those partitions? ( Let's say I am going to use a 500 gigabyte drive)

 Grin This question is equivalent to an alien coming to earth and then ask for a recommendation of what religion to follow. There is no consensus and hence most people will come up with different recommendations. I would recommend having 4GB for swap, 20GB for root partition and the rest for home partition.
Logged

.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..
Aradalf
Sr. Member
****
Offline Offline

Posts: 485


« Reply #9 on: December 17, 2010, 07:53:45 PM »

what is the recommended setup? How large should I make those partitions? ( Let's say I am going to use a 500 gigabyte drive)

 Grin This question is equivalent to an alien coming to earth and then ask for a recommendation of what religion to follow. There is no consensus and hence most people will come up with different recommendations. I would recommend having 4GB for swap, 20GB for root partition and the rest for home partition.
Grin Grin Grin I wholeheartedly agree, both with your observation and your suggestion, though if you want to install tons of programs, you might want to add 6GB more to root partition.
Logged

JakeLogan
Full Member
***
Offline Offline

Posts: 123


Life ain't easy in the fringe


« Reply #10 on: December 17, 2010, 07:59:28 PM »

Disk identifier: 0xe48393f7

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      409599      203776    7  HPFS/NTFS
/dev/sda2          409600   425095964   212343182+   7  HPFS/NTFS
/dev/sda3       488183808   488395119      105656    c  W95 FAT32 (LBA)
/dev/sda4       425095965   488183219    31543627+   5  Extended
/dev/sda5       425096028   450285884    12594928+  83  Linux
/dev/sda6       450285948   454655564     2184808+  82  Linux swap / Solaris
/dev/sda7       454655628   488183219    16763796   83  Linux

Partition table entries are not in disk order

Here ya go Aradalf

BTW I forgot to log in using SU. I tried to use SUDO for the fdisk -l command and it told me: "phoenix is not in the sudoers file.  This incident will be reported." This cracked me up.. what's it gonna do.. report me to myself ? ;-0


Thank you muungwana and Aradalf on your advice for the partition sizes.
Logged
muungwana
Hero Member
*****
Offline Offline

Posts: 5403


« Reply #11 on: December 17, 2010, 08:11:12 PM »


we dont use sudo by default and hence it does not come configured on install, you will have to manually configure it if you want to use it.

We dont recommend using it as it can be abused. If you want to execute a single command as root, we recommend using "su -c" and then enter root's password when asked

example:

su -c "fdisk -l"
Logged

.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..
Bald Brick
PCLinuxOS Tester
Hero Member
*******
Online Online

Posts: 5147


I'm going South


« Reply #12 on: December 17, 2010, 08:16:18 PM »

what is the recommended setup? How large should I make those partitions? ( Let's say I am going to use a 500 gigabyte drive)

 Grin This question is equivalent to an alien coming to earth and then ask for a recommendation of what religion to follow. There is no consensus and hence most people will come up with different recommendations. I would recommend having 4GB for swap, 20GB for root partition and the rest for home partition.
Grin Grin Grin I wholeheartedly agree, both with your observation and your suggestion, though if you want to install tons of programs, you might want to add 6GB more to root partition.

I agree with both muungwana and Aradalf, but many people on these forums have settled on another solution: they don't use a separate /home partition, but they create a separate data partition instead. So for them the home directory is just a folder for configuration files while a large separate partition is there for all their personal data.

This is a bit untraditional but for some people it is a better choice. It all depends on whether you want to retain both your settings and your data if you reinstall, or if retaining your data would be enough while you'd might prefer to start with default settings after reinstalling.
Logged

If it ain't broke
hit harder!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D
JakeLogan
Full Member
***
Offline Offline

Posts: 123


Life ain't easy in the fringe


« Reply #13 on: December 17, 2010, 08:26:19 PM »


we dont use sudo by default and hence it does not come configured on install, you will have to manually configure it if you want to use it.

We dont recommend using it as it can be abused. If you want to execute a single command as root, we recommend using "su -c" and then enter root's password when asked

example:

su -c "fdisk -l"

I see so that's why it didn't work. Fine by me.. less I have to deal with. Thanks for the info.
Logged
JakeLogan
Full Member
***
Offline Offline

Posts: 123


Life ain't easy in the fringe


« Reply #14 on: December 17, 2010, 08:29:15 PM »

Quote from: Bald Brick

I agree with both muungwana and Aradalf, but many people on these forums have settled on another solution: they don't use a separate /home partition, but they create a separate data partition instead. So for them the home directory is just a folder for configuration files while a large separate partition is there for all their personal data.

This is a bit untraditional but for some people it is a better choice. It all depends on whether you want to retain both your settings and your data if you reinstall, or if retaining your data would be enough while you'd might prefer to start with default settings after reinstalling.

Interesting. Thank you for those pros and cons. It will come in handy.
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM