LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-23-2009, 09:51 AM   #1
WingZero
LQ Newbie
 
Registered: Sep 2009
Posts: 1

Rep: Reputation: 0
best way of partitioning + huge swap file


Hi all,

I am goign to buy myself e new pc and am wondering what the best way is to parition my two 1terra Hd's?

1 terra is going to be /home/name/video

but the other one is going to be the root os

but i do not know how mych i need to have for my

"/"
"/tmp"
"/boot"
etc..

if that all is done the rest is going for "/home"


Also the swap partition is a blury thing, because i;ve read that it is best for the swap to be twice as big as the physical memor, but i will have 12gig of phisycal memory, so i don't think i will need to have 24 gig of swap do i?

i will run virtualisations, like windows or a server or testing puposes on this machine, so i dont know if that influences the decision in swap.

Also for the root some say 10gig is more than enough, but i will install quite a lot on wine or other general programs so is 10 eneough? keep in mind the hd is 1terra and another terra for videos.
 
Old 09-23-2009, 10:13 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by WingZero View Post
i do not know how mych i need to have for my

"/"
"/tmp"
"/boot"
etc..
I don't know if there is any good reason in your situation to split those apart and need to decide individual sizes. Maybe you want that drive to just be /, /home and swap

If you do want to decide on a size for /tmp and partition it outside / then you are probably better off using a tmpfs so /tmp is effectively inside swap (and of course take that into account when sizing swap).

Quote:
i;ve read that it is best for the swap to be twice as big as the physical memor,
It is so hard to come up with a correct answer for swap size from the minimal info available in these situations, so many people using formulas like that, that have no real basis.

Quote:
i will run virtualisations,
I'm not sure how those interact with swap space. I think the virtual machine must be allocated physical memory, so it does not use the host system's swap space in any way. Then there is no automatic demand balancing of memory between the two, so the host might use its swap space because too little physical ram was left after what it gave the virtual OS (even if the virtual OS has no real need for so much) or the virtual OS might use its own swap space because it wasn't allocated enough physical ram (even if physical ram is free at that moment in the host). But I'm really unsure of all such details.

Forgetting virtual OSs running under the host, you want swap space to be big enough for everything that might use swap space:

If you have a tmpfs for /tmp (or other purposes) then active files would be in ram and inactive files or inactive pages of active files would be in swap). Linux programs tend to be more limited in their use of /tmp and to clean up after themselves better than Windows programs so you might not have many inactive files in /tmp waiting for the next reboot to clean them up. But I don't know your use of /tmp. I will point out that for sloppy use of /tmp a big swap partition and a tmpfs should be no scarier than a big /tmp partition if you were considering that.

If you have a lot of background tasks sitting around idle, all their private pages ought to fit in swap space. This is the reason some server systems may need very large swap areas compared to physical ram. If you don't have a lot of background tasks or your background tasks don't spend a lot of time idle, you may have very little need for the traditional uses of swap space.

Swap space was also traditionally used for running tasks whose active memory use was bigger than physical ram. I feel safe assuming you don't need that.

Last edited by johnsfine; 09-23-2009 at 10:15 AM.
 
Old 09-23-2009, 11:02 AM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by WingZero View Post
Hi all,

I am goign to buy myself e new pc and am wondering what the best way is to parition my two 1terra Hd's?

1 terra is going to be /home/name/video

but the other one is going to be the root os
For a typical desktop machine, this would usually mean that you would probably be using less than 5% on that disk, and even that is an exaggeration unless you are an intensive gamer and plan to install a lot of big games in /

A tipical linux installation for a desktop can take somewhere between 4-10gb, it can be less, it could be more depending on what do you install and how do you use your machine.

Quote:
but i do not know how mych i need to have for my

"/"
"/tmp"
"/boot"
etc..
If you really don't know, I suggest you to make a 10-20 gb partition for /, allocate some swap, and use the rest for /home, which is where you want the space to be (or so it seems to me).

And forget about all these extra partitions until you have a clearer vision about what they are used for, and anyway the size for them can vary greatly depending on how do you use your box (for example, a mail or printing server usually would require a big /var partition).

Quote:
Also the swap partition is a blury thing, because i;ve read that it is best for the swap to be twice as big as the physical memor, but i will have 12gig of phisycal memory, so i don't think i will need to have 24 gig of swap do i?
Rules without base, much less nowadays. The size of swap you want will depend greatly on the task at hand, but in any case, by the time your system is swapping a few gb's you really need more ram because it will become completely unresponsive.

In any case, don't give this much thought, you can always use a swap file later, and add as many as them as you need them dynamically on the fly.

Quote:
Also for the root some say 10gig is more than enough, but i will install quite a lot on wine or other general programs so is 10 eneough? keep in mind the hd is 1terra and another terra for videos.
All the stuff you install with wine goes to your home directory (you should really never use wine as root, that's asking for trouble).
 
Old 09-23-2009, 11:08 AM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by johnsfine View Post
I'm not sure how those interact with swap space. I think the virtual machine must be allocated physical memory, so it does not use the host system's swap space in any way.
All the applications (and vm's are not an exception, at least not in principle unless they use some kernel module to do something strange) are completely ignorant about memory. They just ask the kernel to allocate some virtual memory for them. Where that virtual memory is physically, is completely irrelevant to the applications. It's up to the kernel to decide what to do at a given moment, depending on the whole panorama and not just on the greed of a silly application whose programmer thought that his app is the coolest of all apps and should monopolize the ram and cpu time.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu AMD64 8.10 - Swap Partitioning dtla1730 Linux - Newbie 2 01-18-2009 03:47 PM
Partitioning My Hard Drive: /swap and /home drpixel404 Linux - General 2 07-16-2007 09:01 AM
Swap partitioning of hard drive @er<> Mandriva 1 11-17-2006 08:41 PM
hard disk partitioning swap partition sasqpodalian Linux - Hardware 1 09-12-2006 06:26 PM
Partitioning hangs and blames swap paxmark Ubuntu 1 05-04-2005 01:46 PM


All times are GMT -5. The time now is 07:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration