Click to See Complete Forum and Search --> : Help me partition my drive


The Coder
07-09-2006, 11:32 PM
I am running SUSE 10.0 right now and want to try Fedora 5. All I really want is a simple partition scheme so I need your help. For now I threw everything into 1 partition. I want to have a partition setup such that the users data(me) and root's data(also me) don't get destroyed when I install various versions of linux. Therefore I want one partion for swap, one for the OS and one for /root and /home(i.e where both directory paths are in the same partition). I have an 80 GB drive to install linux onto and want your advice on how much to give to the /home and /root partions and how much to leave for the OS. The /home and /root partitions will be containing pictures, documents, music and software rpms, sources and such. Also, can the /root and /home directories be put on the same partition? Thanks.

Parcival
07-10-2006, 05:22 AM
No, /root and /home can not be the same partition, you need a seperate one for each of them.

You may also want to create seperate partitions for /var and /tmp since these folders can be easily shared between various distributions. (the same is true for /boot, but it can get a little confusing with the bootloader if you decide to do that)

As for disc space, I can't really tell you what number to use, you know your needs best. I can just give you an idea of a previous installlation oif mine that featured a Gentoo (main system) and a SuSE installation (for rescue when I screwed Gentoo):

/dev/hda1 -> /boot 100MB
/dev/hda2 -> swap 900MB
/dev/hda3 -> /tmp 1GB
/dev/hda4 -> /var 1GB
/dev/hda5 -> / SuSE 7GB
/dev/hda6 -> / Gentoo 20 GB
/dev/hda7 -> /home all remaining space

The Coder
07-10-2006, 11:39 AM
ok, I know you can't tell me specific sizes to make things but let's say you have one partition for data and the other for the OS. What ratio should they be to each other? 50% of the space to data and 50% to the OS? How much space does the OS need rougly(giving some space to grow)? I only have 80 GB(and 1 drive) to play with and I will be using a very simple partition scheme. EX: 30 GB data and 50 OS or 40 GB OS and 40 GB OS etc...

retsaw
07-10-2006, 12:14 PM
/root and /home can be on the same partition.

Two ways to achieve the desired effect. The first is to change root's home dir from /root /home/root, just make a minor change to /ect/passwd fromroot:x:0:0:root:/root:/bin/bashtoroot:x:0:0:root:/home/root:/bin/bash

Alternatively, move /root to /home/root, create an empty at /root and use the bind option for mount to mount /home/root on /root by adding/home/root /root none bind 0 0to your /etc/fstab after the entry to mount your /home partition.


I'd give between 5-10 GB for each OS and the rest for /home.


Given that you have data stored in /root, it would seem you use it for more than administrative purposes, I would point out that it is good practice to keep use of the root account to an absolute minimum and it is fairly easy to perform operations as root when you are logged in as a regular user. I'm not going to get into why since you can find plenty of debates about it if you look, and the choice is up to you.

The Coder
07-10-2006, 12:38 PM
Great. I think I will put the /root and /home on seperate partitions. But you are saying 5 to 10 GBs for the OS, ok. I login as a regular user and su to root to do things, but I figured I would give /root some space incase there were some things you have to do logged in as root. Maybe I am wrong, then I can make /root very small and give all my remaing space to /home.

retsaw
07-10-2006, 02:43 PM
Yes. The amount of space you need depends on how much you want to install, you can do "du -csh /home/" to find out how much space your /home directory is using and then subtract that from the space used on your single partition setup to see how much space your current installation is using and then give it a bit of extra space on top of that to grow.

If you don't store any data in your /root, I would skip on making a partition for it, I suppose there might be configuration files you might want to share between installs, though I haven't got anything I need to keep or share between install there.

IsaacKuo
07-10-2006, 04:00 PM
The /home and /root partitions will be containing pictures, documents, music and software rpms, sources and such.

I suggest you put pictures, documents, music and rpms, sources and such in a large "data" partition which is NOT /home. Funny/undesirable things can happen when you attempt to share /home between distributions or switch distributions. You may end up wanting to just wipe /home and start fresh--at which point having all your bulk data in that partition complicates things.

Instead, I prefer to make a big "data" partition and put a symbolic link in ~ to a directory in that "data" partition. It takes less than 5 minutes after installing a linux distribution to manually create an fstab entry for this "data" partition and creating the relevant symbolic link.

Parcival
07-10-2006, 06:13 PM
I'd give between 5-10 GB for each OS and the rest for /home.

Yes, that's a very good rule of thumb. The reason why I made my Gentoo / bigger is because of games. If you use your Linux box as a gaming machine, you may run out of disk space pretty soon, especially if you install 3D shooters.

Funny/undesirable things can happen when you attempt to share /home between distributions or switch distributions.

Did you pay attention that the every user has the same ID number in all installations?

IsaacKuo
07-10-2006, 07:29 PM
Did you pay attention that the every user has the same ID number in all installations?

Oh, that's the least of the "funny stuff" that can happen. I'm thinking more along the lines of different versions of installed software being confused by configuration files stored in the ~ directory. For example, if you've got KDE3.5 in one distribution but KDE3.4 in another...

The Coder
07-10-2006, 11:51 PM
That's interesting about the home directory, never heard that before but makes sense if there is a .something config file from one version messing with another .something file.
All I want to do is isolate my data(pics, music, text etc) from the OS so that incase I need to reinstall the OS etc, I don't lose my data. I don't plan on playing any games on Linux in the near future. What I want to do is to finally get off Windows when it comes to my critical saved data. I want all this data in Linux and want to use windows as less as possible. I plan to use windows to play games and to use specific apps that will only run in that OS, but most of my regular day to day stuff can be done in Linux.
So back to the partitioning, I want to make sure I have this right. A large "data" partition. So when the installer comes up I would create a swap partition, another partition for "/data" and a third partiton for all the other files and folders in /? Correct? Then have /home/"username" point to a folder for this user that actually resides on the partition that /data is mounted? Correct?

Parcival
07-11-2006, 05:02 AM
So back to the partitioning, I want to make sure I have this right. A large "data" partition. So when the installer comes up I would create a swap partition, another partition for "/data" and a third partiton for all the other files and folders in /? Correct? Then have /home/"username" point to a folder for this user that actually resides on the partition that /data is mounted? Correct?

Almost. If you wanna do it IsaacKuo's way, you don't link e.g. /home/parcival to /data, but /home/parcival/my_documents instead. This way you keep config files and your data nicely seperated. (as long as you are browsing /home/yourname and its subfolders you are in the / partition except when you take the my_documents link which will kick you over to the /data partition)

IsaacKuo
07-11-2006, 10:49 AM
I do it SLIGHTLY differently from what Parcival said. I prefer to put a subdirectory within the "data" partition which is owned by the user, and link the "my_documents" link to that subdirectory. This handles ownership issues more elegantly, and lets you create more subdirectories for more users if you want to add some.

Also, if you're need some space somewhere it's easy to add another symlinked directory within the data partition that's seperate from the "my_documents" directory.

The Coder
07-16-2006, 01:31 AM
Thanks for your help guys. I am finally in the process of transfering all my files off Windows and onto Linux. I decided to go with the following partition scheme

swap = 2 GB
/ = ~25 GB
/data = ~47 GB

A real simple scheme for now and it will probably change once I use linux more and more on a daily basis. Basically I don't want my files lost if I upgrade or try another distro. Right now I am running Ubuntu Dapper Drake. So far so good.

As mentioned above, I created a /data partiton and in it I created a directory for a user, for this example user1. I created a symbolic link called /home/user1/MyFiles -> /data/user1. In this directory I put all my folders with docs, pics etc. So instead of a different symbolic link to each type of folder, i created a symbolic link to the folder that contains all my other folders. Does this ok?

eskaypey
07-16-2006, 02:48 AM
2GB for swap? wow! I have 256Mb on my lappy which is equal my ram.
On -heavy- load server you'd usually have swap several times the size of ram.
But im not sure you should have 2GB for a desktop.

(this *is* a desktop, yeh?) -)

Parcival
07-16-2006, 03:51 AM
So instead of a different symbolic link to each type of folder, i created a symbolic link to the folder that contains all my other folders. Does this ok?

That's what IsaacKuo and I were talking about, yes. If it's okay has to be decided by you since you are the user and you know your needs best. ;)

On your journey through Linux you will still encounter many occasions where there's nothing like a "right thing". Linux is a bunch of options and you are the one to try them out and decide what's best for you.

The same goes for the 2GB of swap, I agree with eskaypey there. Normally, the amount of swap space is 1.5 times the size of your RAM (as a rule of thumb). With 512MB of RAM my swap space would therefore be 768MB, but since I was too lazy to calculate that number until now I just made it 1GB. Others here in the forum say to themselves "I have 1GB of RAM, why would I need any swap at all?". Like I said, Linux is about options.

The Coder
07-16-2006, 09:22 PM
Thanks for your help. I already changed distros, from ubuntu to kubuntu. Gnome drove me nuts. But any way that idea to have a /data was great. Worked great, the install of the new distro was the test and eveything worked fine.
About the 2 GB swap. It seemed a lot to me too, but I always read about making swap double the amount of ram you have. I have 1Gb of ram so I made it 2GB. I probably won't use it, but thats what I did. Maybe in the futher I will reduce it. Not sure what to do. How big should I have made it?

Parcival
07-17-2006, 05:10 AM
How big should I have made it?

You are the only one to tell. As I said in my previous post, it's all a matter of choice. You may stick to your rule of thumb, you may erase the swap entirely if you never need it, or you may even increase it if you are running some memory hogging processes.

The Coder
07-17-2006, 08:55 AM
ok, well it gets used when there isn't enough memory and paging starts. How do I tell how much paging is being done? Is there a file in proc to tell that?

eskaypey
07-18-2006, 08:23 AM
hey bud,
have a look at nmon (http://www-128.ibm.com/developerworks/eserver/articles/analyze_aix/), looks promising..

crow2icedearth
07-19-2006, 01:21 AM
[swap space is 1.5 times the size of your RAM

should be 2x ram.
just basic rule of thumb. of coarse if its a busy server you will want to have more swap space