LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Partitioning question. (http://www.linuxquestions.org/questions/linux-newbie-8/partitioning-question-819998/)

McCordRM 07-15-2010 12:03 PM

Partitioning question.
 
So I've been playing with installing Linux to get a feel for the process as part of my self-training.

I have discovered that creating a seperate partition for some directories helps you keep your setup backed up in case of a re-install or upgrade- specifically, the /home directory.

Anyhow, I'm trying to figure out the best file size combination for the directories and which ones I actually need to create a seperate partition for.

Thus far, for my 150GB hard drive I have:

*************************************
1. / : Root at 70GB
2. /boot : Boot at 100 meg
3. /swap : Swap file at 2GB
4. /home : Home at rest of the drive
**************************************

This would keep my personal settings (UI, documents, downloads, etc) backed up. Should I create a partition for /etc to keep from having to re-install programs? And how do my size allocations look?

trickykid 07-15-2010 12:07 PM

At a minimum I always create /boot at atlest 100MB, / at a minimum of 1024M, swap depends on how much memory you have and if it's a desktop or server. /home I always start low but add when necessary as I'll now point out I hope you are using LVM, it will make your life easier.

I always recommend separate /usr, /tmp and /var at a minimum as well. /usr is where most executables for applications go, along with libraries. With most distro's you can setup a 8192M partition and be okay forever for the life of the install. /tmp and /var, just depends, but starting at 1024M or 2048M is usually reasonable. The main reason these have their own partitions is tmp can grow fast, it's world writeable. so if it fills up, you don't want it sitting on / and you run out of space, because then things stop working til space is cleared. Same goes for /var, it's mostly for logging, if a process goes wacko and fills up /var, if it's on /, same scenario as above.

saikee 07-15-2010 12:21 PM

I do exactly the opposite as I don't run a server and can afford to install a Linux with just one partition so that /boot, /var, /home etc are all subdirectories inside. I have one swap to serve all the Linux I install.

It is much easier to resize one partition if the total space runs out.

No Linux distro ever refused to be installed in one partition but Red Hat family distros always try to sell the user the LVM which cannot be read by a boot loader and so /boot is mandatory if LVM is opted for.

I put my own personal data in a separate partition accessible by all operating systems.

McCordRM 07-15-2010 12:41 PM

Obviously, I'm missing something.

Saikee: If you put all your personal data in a separate partition... but aren't putting /home in a seperate partition... what exactly are you saying there?

Trickykid: I'm running as a Desktop, with the intent being to be able to upgrade to a newer version of Mint in the future, or perform a re-install on a whim if I like and still have the same desktop configuration and programs ready to run.
You said to have / be at 1024M minimum... would I actually want it that low? Ever? And what about top-end? How big is too big for "/"?

trickykid 07-15-2010 12:52 PM

Quote:

Originally Posted by McCordRM (Post 4034220)
You said to have / be at 1024M minimum... would I actually want it that low? Ever? And what about top-end? How big is too big for "/"?

Sure, when you separate the other partitions, / takes up very little space, most will end up being /etc which is configuration files that take little space. The bulk of an base install will end up in /usr. My own desktops, / usually accounts anywhere between 200-400MB of total disk space usage, never really growing either.

Most people on desktops are fine with just having one big / partition, some get away with just a /, /boot and swap. I like to keep them separated for filesystem integrity, etc.

saikee 07-15-2010 01:10 PM

A data partition can be mounted freely in any Linux. It doesn't has to be /home and can be any name. It is also very difficult to have one /home for several Linux because every desktop would want to keep its own settings. A data-only partition can be any filing system too and much easier to access by other operating systems, though it is possible to load a driver in a MS Windows to read a Ext2/3 partition.

McCordRM 07-15-2010 01:28 PM

Ah, now that answers my question. I'm still trying to learn where everything gets stored in Linux.
Overall, it seems a lot more logical and straight-forward. But I still don't understand program installs.

In Windows, if you install a program called Bob then a directory named Bob will appear in Program Files. However, not ALL of Bob's files will be in that directory: some may go to System32 directory, some may go elsewhere. Then there are dependancy links all over the place so even if you kept the Bob directory in tact during a re-install the program still wouldn't work because you need to re-install the program to re-create the dependancy links, registry entries, etc.

So it sounds to me like I really need to have a setup like:

1. / :About 1 gig to be safe.
2. /boot :Keep at 100 megs
3. /swap :2gig is fine
4. /home : 25% disk space
5. /usr : 75% disk space

But what about /etc? I thought configuration was mostly in your /home directory?

trickykid 07-15-2010 02:04 PM

Quote:

Originally Posted by McCordRM (Post 4034272)
Ah, now that answers my question. I'm still trying to learn where everything gets stored in Linux.
Overall, it seems a lot more logical and straight-forward. But I still don't understand program installs.

In Windows, if you install a program called Bob then a directory named Bob will appear in Program Files. However, not ALL of Bob's files will be in that directory: some may go to System32 directory, some may go elsewhere. Then there are dependancy links all over the place so even if you kept the Bob directory in tact during a re-install the program still wouldn't work because you need to re-install the program to re-create the dependancy links, registry entries, etc.

So it sounds to me like I really need to have a setup like:

1. / :About 1 gig to be safe.
2. /boot :Keep at 100 megs
3. /swap :2gig is fine
4. /home : 25% disk space
5. /usr : 75% disk space

But what about /etc? I thought configuration was mostly in your /home directory?

Okay, first rule, drop all Windows knowledge and how it's setup or you'll just find yourself with more questions.

I would not allocate 75% of your space to /usr unless you plan on installing tons and tons of applications, which most distro's come with just about everything you need already.

The beauty of using LVM is you can grow when necessary. Most spaced used are user files, usually stored in /home directories.

As for configuration files, conf files in /home directories are usually pertained to user settings, not OS settings. /etc is the place for OS and services settings/configurations.

Honestly, I'd say something like this would work:

/ = 2048M A little bigger, provides a little more wiggle room, especially if you don't want a separate /var or /tmp.
/boot = 100M is usually sufficient in almost all cases, unless you like having dozens and dozens of different kernels to boot from.
swap = equal or double size of RAM installed. If this workstation isn't going to do really heavy RAM intensive applications, half of your RAM (that's if you have 1-4GB of RAM installed) is sometimes sufficient. But you're 2GB is likely fine and you're not wasting a bunch of disk space if you have a 150GB drive.
/usr = 8192M is usually plenty to start with. A likely distro install will start with roughly 2-5GB of disk usage, leaving around 4-5GB of space to grow into with more applications.
/home = rest of space or start a little larger if you plan to place all your user files here. I always start with say, 20GB and grow it on the fly if I need more.
/var = I still always say create a separate /var partition with at least 1024M in size, it might save you one day if it happens to fill up / and services and processes stop working suddenly.

Everything except /boot can be on an LVM layout, go with LVM is another recommendation.

salasi 07-15-2010 04:32 PM

Quote:

Originally Posted by McCordRM (Post 4034272)
But what about /etc? I thought configuration was mostly in your /home directory?

/etc contains (largely) configuration for system services, the configuration for an individual user is within their /home/username structure as hidden files.

And don't even think about giving /etc its own partition; it can be done, but its hardly a newbie option.

Try reading this or this for the general background.

McCordRM 07-15-2010 04:46 PM

The only reason I mentioned Windows was to point out the program installation method. In Windows, you always know where a program installs (default is program files folder), but not necessarily where all the files for that program go, or all the registry entries it requires. Now, I'm trying to figure the same stuff out for Linux.

For example, let's say I add a program to Linux. Instead of sticking with Firefox, I decide to install Chrome. If I re-install Linux, what folder should I leave alone (IE: Don't format) to have it ready to go as soon as the install is done? Kind of like having my settings saved because my /home partition is saved.

I understand not worrying about the /dev directory because in the event that I upgrade my hardware this could change anyhow. Whereas the "look" of my system is something I stick with once I have it right, thus partitioning /home. Which is also why I'd like to keep my programs directory seperate... I tend to stick with the same programs once I have the ones I like.

As for /var and /temp... what's a good reason to keep them seperate? I thought they were dynamic in that they both have to do with "right now" file writing. The files in those folders right now don't really do any good later on, or especially after a re-install.

pierre2 07-16-2010 07:48 AM

& I do even more different:=

what I do, is to install any O/S's / into it's own partition, which is about 10Gb in size,
& have a common /home.

Each O/S has a different UserName, so they can all use that same /home partition,
which is aways in a extended/logical partition,, this extented partition also has the /swap partition in it.

Generally, I only ever run three O/Ss, so they are all Primary partitions, for their / .

the 4th Primary contains the rest of the hdd as the extended partition.

MTK358 07-16-2010 07:53 AM

Personally I don't have a separate /home partition, because I know I won't put so much data in it that it chokes up the system.

And AFAIK having a separate /boot partition was because of a hardware limitation of older PCs, and completely useless now. Correct me if I'm wrong about this.

saikee 07-16-2010 09:02 AM

MTK358 ,

Your are not wrong. There was a time when both Lilo and Grub could not boot beyond 1024 cylinders. /boot could therefore be position earlier at the start of the hard disk to overcome this hurdle.

The other usage is Grub1 (not sure about Grub2) and Lilo cannot read a LVM so /boot has to be placed outside the LVM.

Users like to follow with questioning the purpose.

trickykid 07-16-2010 11:59 AM

Quote:

Originally Posted by MTK358 (Post 4035190)
And AFAIK having a separate /boot partition was because of a hardware limitation of older PCs, and completely useless now. Correct me if I'm wrong about this.

No, it's used again because most use LVM, so /boot has to be on a non-LVM partition.

McCordRM 07-17-2010 12:19 AM

Well, I only plan to use one Operating System.
There was absolutely no point to installing Linux with Windows since Windows did everything I needed. Jumping out of a game and rebooting to Linux seemed time consuming and stupid just to write a document or surf the 'Net.

Now that I'm switching, I plan to leave Windows far, far behind for exactly the same reason- no sense switching back and forth depending on what I'm doing at that specific time. I'll figure out how to get Linux to do what I want and be done with it... for free.

Right now I'm working on Arch Linux. It's going to be a pain in the ass to learn, but at least I'll have exactly the system I want in the end. I ALMOST did Linux From Scratch... but that was way over my knowledge level and desire to learn for the moment. I figured Arch was the next best thing.


All times are GMT -5. The time now is 04:59 AM.