Author Topic: (solved) How does Linux determine folder size?  (Read 1550 times)

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6471
  • I'm going South
Re: How does Linux determine folder size?
« Reply #15 on: December 17, 2010, 06:53:39 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.

One could add that the separate data partition is particularly useful if you want share data between several distros (or even with Windows).

(And while my ramblings about GB and GiB where true, I realize now that they were beside the point, while Aradalf's deduction was entirely correct.)
Feed the trolls!
They need it!

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

Offline Aradalf

  • Sr. Member
  • ****
  • Posts: 474
Re: How does Linux determine folder size?
« Reply #16 on: December 18, 2010, 08:57:35 AM »
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 <---------------- THIS is your swap partition
/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.


One thing I would like to add is that if you do use a separate data partition, it might be advisable to create symbolic links from your /home/<your username>/Documents Downloads Pictures Music and Movies to folders located in your data partition with the same name. This will make it easier to save files and stuff, as you can still save in your /home/<your username>/Documents, but it will actually be saved in your Data partition.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I realize I'm not very good at explaining things, so hopefully Just19, Bald Brick, or muungwana will come along and help me explain.
« Last Edit: December 18, 2010, 09:00:46 AM by Aradalf »

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6471
  • I'm going South
Re: How does Linux determine folder size?
« Reply #17 on: December 22, 2010, 05:00:11 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 <---------------- THIS is your swap partition
/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.


One thing I would like to add is that if you do use a separate data partition, it might be advisable to create symbolic links from your /home/<your username>/Documents Downloads Pictures Music and Movies to folders located in your data partition with the same name. This will make it easier to save files and stuff, as you can still save in your /home/<your username>/Documents, but it will actually be saved in your Data partition.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I realize I'm not very good at explaining things, so hopefully Just19, Bald Brick, or muungwana will come along and help me explain.

I think you explained it very well.

But if JakeLogan gets a larger drive and decides to create a data partition on it I'll be happy to explain how he should create the symbolic links.
Feed the trolls!
They need it!

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

uncleV

  • Guest
Re: (solved) How does Linux determine folder size?
« Reply #18 on: December 22, 2010, 09:06:24 PM »
The symbolic links under question are in my mind. I simply save data directly to the data partitions. ;)

Offline JakeLogan

  • Full Member
  • ***
  • Posts: 121
  • Life ain't easy in the fringe
Re: How does Linux determine folder size?
« Reply #19 on: December 22, 2010, 11:57:01 PM »
Let's back up a minute.


  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.

My programs get installed on the smaller partition? This sounds strange.. wouldn't installed programs eventually take up way more space than the OS?

I just used Texstar's program MyLiveCD ( I think it's called) to make a backup. My first Linux backup.  I figured on using 3 dvd's because the program can compress each 10 gigs down to 4 gigs.  I'm thinking it's going to back up everything, the whole 30 gigabytes I used. But that's not what happened. The program only made one dvd and said it was finished. What exactly then did it back up?
« Last Edit: December 22, 2010, 11:59:18 PM by JakeLogan »

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12657
Re: How does Linux determine folder size?
« Reply #20 on: December 23, 2010, 02:14:57 AM »
Let's back up a minute.


  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.

My programs get installed on the smaller partition? This sounds strange.. wouldn't installed programs eventually take up way more space than the OS?

I just used Texstar's program MyLiveCD ( I think it's called) to make a backup. My first Linux backup.  I figured on using 3 dvd's because the program can compress each 10 gigs down to 4 gigs.  I'm thinking it's going to back up everything, the whole 30 gigabytes I used. But that's not what happened. The program only made one dvd and said it was finished. What exactly then did it back up?


mylivecd has a compression limit of 4 gigs. You are not going to be able to compress 30 gigs into a 4 gig DVD.  2.5 gigs will compress to 700 mb ISO. It does not have the capability to span across multiple dvds.


Thanks to everyone who donates. You keep the servers running.
Follow me on Twitter for the latest development info.

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: How does Linux determine folder size?
« Reply #21 on: December 23, 2010, 03:19:45 AM »
Let's back up a minute.


  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.

My programs get installed on the smaller partition? This sounds strange.. wouldn't installed programs eventually take up way more space than the OS?

I just used Texstar's program MyLiveCD ( I think it's called) to make a backup. My first Linux backup.  I figured on using 3 dvd's because the program can compress each 10 gigs down to 4 gigs.  I'm thinking it's going to back up everything, the whole 30 gigabytes I used. But that's not what happened. The program only made one dvd and said it was finished. What exactly then did it back up?

You are misinterpreting I think .....  programmes/applications etc  get installed with the OS - in the ' / ' partition.
Your personal data, and configuration files for your installed OS and applications, get installed into ' /home '.
' /home '  is larger because all those settings and configuration files and personal data take up much more space that the OS plus application.

Offline JakeLogan

  • Full Member
  • ***
  • Posts: 121
  • Life ain't easy in the fringe
Re: How does Linux determine folder size?
« Reply #22 on: December 23, 2010, 08:26:23 AM »
Let's back up a minute.

My programs get installed on the smaller partition? This sounds strange.. wouldn't installed programs eventually take up way more space than the OS?

I just used Texstar's program MyLiveCD ( I think it's called) to make a backup. My first Linux backup.  I figured on using 3 dvd's because the program can compress each 10 gigs down to 4 gigs.  I'm thinking it's going to back up everything, the whole 30 gigabytes I used. But that's not what happened. The program only made one dvd and said it was finished. What exactly then did it back up?


mylivecd has a compression limit of 4 gigs. You are not going to be able to compress 30 gigs into a 4 gig DVD.  2.5 gigs will compress to 700 mb ISO. It does not have the capability to span across multiple dvds.

O.k... If it cannot span across multiple dvd's, then what data did it back up? Home folder? Root folder, something other?

Offline JakeLogan

  • Full Member
  • ***
  • Posts: 121
  • Life ain't easy in the fringe
Re: How does Linux determine folder size?
« Reply #23 on: December 23, 2010, 08:31:48 AM »
You are misinterpreting I think .....  programmes/applications etc  get installed with the OS - in the ' / ' partition.
Your personal data, and configuration files for your installed OS and applications, get installed into ' /home '.
' /home '  is larger because all those settings and configuration files and personal data take up much more space that the OS plus application.


Let me see if I got it right this time.

The OS, and all it's files that get installed by default, are all in the root partition.. even the applications installed at that time - After install, all the applications I choose to install through Synaptic ( or other) get installed in Home?

Offline longtom

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3339
  • Satellite Station Africa
Re: How does Linux determine folder size?
« Reply #24 on: December 23, 2010, 08:48:53 AM »
You are misinterpreting I think .....  programmes/applications etc  get installed with the OS - in the ' / ' partition.
Your personal data, and configuration files for your installed OS and applications, get installed into ' /home '.
' /home '  is larger because all those settings and configuration files and personal data take up much more space that the OS plus application.


Let me see if I got it right this time.

The OS, and all it's files that get installed by default, are all in the root partition.. even the applications installed at that time - After install, all the applications I choose to install through Synaptic ( or other) get installed in Home?

No.

I am far from a guru - but I can tell you that no program or application is installed in /home/user.  What you can find in /home/user are directories containing files personal to the user, like your e-mail, your browser details like bookmarks, history and the like.

Hope I added a clue to the puzzle.
Regards longtom

PCLinuxOS KDE 32bit
Intel Core 2 Duo E2200 / 2.2 GHz
2GB Ram
Nvidia GT610

Offline JakeLogan

  • Full Member
  • ***
  • Posts: 121
  • Life ain't easy in the fringe
Re: How does Linux determine folder size?
« Reply #25 on: December 23, 2010, 09:03:45 AM »
No.

I am far from a guru - but I can tell you that no program or application is installed in /home/user.  What you can find in /home/user are directories containing files personal to the user, like your e-mail, your browser details like bookmarks, history and the like.

Hope I added a clue to the puzzle.

Thanks..

Here is why i'm still confused by this. all documents, personal data, bookmarks, email, history - they are all tiny and mostly text documents compared to programs you install. I'm still not seeing a good reason to make the Home larger and the root smaller. In my case, I need the most room for installed programs and less room for other stuff.

So, the root folder contains the programs, and the home folder contains all the data output of those programs?

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6471
  • I'm going South
Re: How does Linux determine folder size?
« Reply #26 on: December 23, 2010, 09:20:46 AM »
No.

I am far from a guru - but I can tell you that no program or application is installed in /home/user.  What you can find in /home/user are directories containing files personal to the user, like your e-mail, your browser details like bookmarks, history and the like.

Hope I added a clue to the puzzle.

Thanks..

Here is why i'm still confused by this. all documents, personal data, bookmarks, email, history - they are all tiny and mostly text documents compared to programs you install. I'm still not seeing a good reason to make the Home larger and the root smaller. In my case, I need the most room for installed programs and less room for other stuff.

I depends on what the other stuff consists of. If it's mainly text files you won't need very much space for it. If it's pictures and music you need a lot more. And if you also save movies and other video files no partition is ever going to be big enough.

Most people need more space for their data than for their applications.

Quote
So, the root folder contains the programs, and the home folder contains all the data output of those programs?

Usually, yes. There's really no reason why you shouldn't test an application by installing its executable in /home/<user>/bin or even somewhere else in your home directory, but Synaptic doesn't and, as you know, using Synaptic is the recommended way of installing applications if you don't want to break your system.

Most of the apps you install with Synaptic go into /usr (with their executables in /usr/bin or /usr/sbin); their global configuration files go into /etc, and a user's personal configuration files into /home/<user> (your home directory).

And as having /usr and /etc on separate partitions is not a good idea (uneconomical use of disk space), most apps will be on the root partition ("/"), possibly with some local configuration files on a home partition, where you'll also find most of the output from the apps.
« Last Edit: December 23, 2010, 09:54:21 AM by Bald Brick »
Feed the trolls!
They need it!

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

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11688
  • ----IOFLU----
Re: How does Linux determine folder size?
« Reply #27 on: December 23, 2010, 09:57:47 AM »
No.

I am far from a guru - but I can tell you that no program or application is installed in /home/user.  What you can find in /home/user are directories containing files personal to the user, like your e-mail, your browser details like bookmarks, history and the like.

Hope I added a clue to the puzzle.


Thanks..

Here is why i'm still confused by this. all documents, personal data, bookmarks, email, history - they are all tiny and mostly text documents compared to programs you install. I'm still not seeing a good reason to make the Home larger and the root smaller. In my case, I need the most room for installed programs and less room for other stuff.

So, the root folder contains the programs, and the home folder contains all the data output of those programs?


To understand where things generally go, in a Linux system, read the following.

http://linux.die.net/man/7/hier

The reference to having /usr as a separate partition is generally only for large enterprise scale systems, and not recommended for single user home desktop installations.
« Last Edit: December 23, 2010, 10:04:54 AM by old-polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...