LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 09-23-2009, 11:18 PM   #1
Pupil
LQ Newbie
 
Registered: Sep 2009
Location: HOT 'Lanta
Distribution: trying Linux Mint and Sabayon now
Posts: 7

Rep: Reputation: 2
Partition Planning Help Needed Please!


hello - after I mapped partitioning for my new WD 500 GB on HPa520n, some choices in the Mint 7 installer didn't seem to jive and I hesitate to do any work on this computer until my partitioning has been reviewed by someone experienced (don't want to have to adjust later):

/dev/sda
/dev/sda1../boot.........200MB..ext2..primary
/dev/sda2../..............15GB..ext4..primary
/dev/sda3.."do not use"..100GB..ext4..primary
(no place for "extended"; did I do this right?)

/dev/sda5../usr...........10GB..ext4..LV
(I read /usr should be right before or after "/", but couldn't seem to get that to happen)

/dev/sda6../opt...........40GB...ext4..LV
/dev/sda7../srv...........30GB...ext4..LV
/dev/sda8../var...........30GB...ext4..LV
/dev/sda9../usr/local.....10GB...ext4..LV
/dev/sda10../tmp..........20GB...ext4..LV
/dev/sda11../home........170GB...ext4..LV
/dev/sda12../swap..........4GB...swap
also:
?: the 'free space' left looks weird: I have one block of 174080MB, I think (somehow ended up with) another of 55471MB and I definitely remember about seven blocks of 8MB that I couldn't change the amount of MB to be large enough to do anything with (I did write all this down but it got a little scribbly towards the end). Should I have formatted that 'free space'? The choices didn't look like what I'd read to do. does this look okay?

?: I thought after making /dev/sda3 'extended', LV's set up after that would be named 'hda' instead of 'sda' as they did. Is this ok?

NOTE: as there are arguments for and against using ext4 yet, I don't want to have to 'upgrade' everything later and I will keep daily backups, I went ahead with ext4.

I plan to set up this desktop as a home server and will be learning to design a site that will grow a lot ... probably with a shared database if/when I can figure it out.

thanks so much for your time and assistance
!!!!!
 
Old 09-24-2009, 04:02 AM   #2
manwithaplan
Member
 
Registered: Nov 2008
Location: ~/
Distribution: Arch || Sidux
Posts: 393

Rep: Reputation: 45
Wow..! I think your partitioning is way over thought out. I prefer simple and direct. I have a /home, / (root) partitions only. Its simplified, so whenever I do backups I can choose either to be restored.

I would have 4 partitions max... /(root), /home, /opt or /var, /swap.

sda is fine .. its usually associated with sata drives...

I personally use ext4 and reiserfs on all partitions. In my opinion, ext4 has great performance.


I would do this:

/dev/sda1 / ........ 20G Primary Partition EXT4
/dev/sda2 Extended Partition ........ 80G
/dev/sda3 /home ........ 70G LV EXT4
/dev/sda4 /opt ........ 6G LV EXT4
/dev/sda5 SWAP ........ 4G
/dev/sda6 REST OF DRIVE FOR STORAGE (Mount in fstab) ........ 400G EXT3 or 4


By doing this you have an extra partition to throw movies and music and backups ... just all the miscellaneous data.

Last edited by manwithaplan; 09-24-2009 at 04:22 AM.
 
Old 09-24-2009, 04:32 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,546
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
You're not going to go far wrong with that setup and it is a good basis for playing with, getting a feel for the system's space needs and how you like to administer it.

Don't worry too much. Even if there is a "perfect" solution for your server today, between the opposing design tendencies of "KISS" (keep it simple, stupid) and "divide and rule", your server's space needs will change and make it less perfect as time goes on.

Besides, it's easy to change (assuming your not running 365x24x7 yet) as long as you have some spare space (with a 500 GB disk you have plenty of play space for now).

Some people like to spread the partitions about on disk so they can easily be enlarged, leaving a (say) 50 GB band of free space between partitions. Others decry the performance hit of doing that and prefer to keeping all the free space in one place so they have plenty of it for moving stuff around.

Consider also the time taken to boot. Periodically (say every 30 file system mounts), the booting system will check (fsck) a file system before mounting it. With many (and hence smaller) file systems that happens more often but takes less time. With few (and hence larger) file systems that happens less often and takes more time.

There are no right answers (there are a few bad answers!), there are only choices. You can make those choices better with first-hand experience of the pros and cons -- and it varies from computer to computer, depending on usage.

Last edited by catkin; 09-24-2009 at 04:35 AM. Reason: Polishing
 
Old 09-24-2009, 06:49 AM   #4
tallship
Member
 
Registered: Jul 2003
Location: On the Beaches of Super Sunny Southern San Clemente, California USA
Distribution: Slackware - duh!
Posts: 520
Blog Entries: 3

Rep: Reputation: 112Reputation: 112
Thumbs up Kinda whacky if you ask me....

Alright, you've gone coo coo for coco puffs dude.

First off, you've made these huge partitions that are going to hold a lot of empty space for no good reason, and you've stuffed /usr into 10 GBytes while /usr/local has its own 10 GBytes. How much source code for local compiles are you going to be maintaining?

You have a pretty huge /home too - is this going to be a public machine where hundreds of people have shell accounts? Or are you going to be providing some sort of hosting services where everything is stored into home directories for your subscribers?

Little things like the above need to be taken into consideration. is this a production server w/huge amounts of logs? Is it a database server? or what are the average kinds of files this machine is going to be handling?

I'll lay out a fav schemata I like, and you make of it what you will - dump all that in between space, and cut down on your partitions. Read up on disk migrations and how much more you're complicating matters by having all these unneccessary partitions - make it simple.

use fdisk - and not cfdisk to create your partitions. cfisk is nice but I use it afterwards.

/dev/sda1 ext2 P /boot 20Mbytes (5 or 8 would prolly suffice nicely unless you do a lot of kernel compiles)

/dev/sda2 xfs P /usr 40GB

/dev/sda3 xfs P / 80GB

Those are your three primary partitions. The fourth primary, is going to be the rest, and all of your other partitions are going to be contained within an extended partition schemata spanning the device

/dev/sda4 Linux Swap /SWAP 4GB (I don't know why you want it that big though)

/dev/sda5 xfs /home 500MB (Adjust accordingly)

/dev/sda6 xfs /stuff (the rest of the space).

under /stuff, you can put anything, including, the mount point for /home for 10 different systems, NFS or SAMBA share points, huge repositories via links from points withing the limited /home you have - basically, a utilitarian space to make seem like it's something else.

Depending upon the files that you serve, you may want to use ResierFS instead of XFS - but until development for the Hammer FS port for Linux has been completed I think I'll stick with XFS myself, or use Sun stuff as cheap NAS.

Basically, you can jog it around but you seem to be getting to high on how much space you have, verses what you need.

So typically I look at the partitions this way:

/boot 10 Megs Ext2
/
/usr
/home
/SWAP

And that's it. If you're not going to have a bunch of users, make / bigger - cause between that and the one or two users on your system, that's all the storage for /home you're going to need and the rest will be wasted

So you know what you need for /boot, and you know what you need for /SWAP - so decide how much storage you really need for /home/you and be done with that, keeping in mind that a lot of stuff you do d/l will be kept in /usr/local/src or /root/

/home is a very easy tree to move at any time, while /boot is just a throw back to enable crude recovery. You don't even need it, prolly ever (I must confess I have a /boot in ext2 of about 20 megs on all my machines though)

So now that you've read all the posts you should have even more to ponder. Right?

One more thing, you're obsessive preponderance of such possibilities, and your desire to tweak these factors long before you're ever going to take advantage of such tweaks - and almost certainly before you find yourself partitioning/fdisking/formatting/mounting/installing all over again anyway, means you are probably a Slackware person anyway - so go and download slackware 13.0 (released a couple of weeks back), apply the update for Firefox, and then you're in a real sandbox, capable of withstanding rocks being thrown at you by the big kids And you'll be having fun then

Hope that helps!

Kindest regards

.
 
Old 09-24-2009, 08:13 PM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Actually, having a /var partition can be useful if you get a runaway process, tends to fill the /var/log area.
This can potentially stop you logging in if its part of / (root).
Some filesystem types reserve 5% of each partition for avoiding fragmentation and/or root user use only.
YMMV
 
Old 09-24-2009, 10:56 PM   #6
Smartpatrol
Member
 
Registered: Sep 2009
Posts: 196

Rep: Reputation: 38
...

Last edited by Smartpatrol; 03-11-2010 at 09:38 PM.
 
Old 09-25-2009, 06:59 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,900

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
I believe that the OP actually means a logical partition vs logical volume. Does Mint support LVM out of the box?
 
Old 09-28-2009, 04:58 PM   #8
Pupil
LQ Newbie
 
Registered: Sep 2009
Location: HOT 'Lanta
Distribution: trying Linux Mint and Sabayon now
Posts: 7

Original Poster
Rep: Reputation: 2
I really appreciate all the hints and clues. Mint supports logical 'partitions' out of the box. I really struggled with install (but Fedora wouldn't install at all); the 'limited version' of gparted in install had a mind of its own - also insisted on inserting 8 (mg I think) between partitions and crashing in the fourth partition. I finally saw that the full gparted is included in Mint and you can use it in the LiveCD prior to install, which was better but still could only use predefined partition names.

I got this setup from the guy that runs the Mint forum, who sounded very experienced, from a production environment: http://forums.linuxmint.com/viewtopi...artition&t=358 . All very confusing when new to Linux with the differing opinions and dated info via google. I noted not having enough room in your partitions can cause crashing, that this setup will confine spam and file corruption, easier ghost mirroring & backups by partition to avoid basically shutting the system down, cuts down boot file checks and to put at the end s/b what's accessed mostly since outer cylinders spin faster, and I like to plan ahead.

we have a little home business set to grow and I'm about to dive into site design which will build up to being very complicated with database and a ton of extremely detailed definitions and discussion including chat tied into crm with accounting, email response and links to provider sites. I might even host a personal site as well ... we have tons of pictures and videos and want to centralize ... we have four (5 to 9 yr old) computers, pentium M's or AMDs with maxed RAM ... I have a new 750gb exterior drive to back up to. this is the newest computer. I read you should hv double your RAM for swap ... after redoing a number of times, I now have:

/boot 300mb
/ 30gb
/usr 40 gb
/opt 40 gb
/srv 30 gb
/var 40 gb
/usr/local 20 gb
/tmp 20 gb
/pers 20 gb (personal, not shared) ******COULDN'T SET MOUNT POINT, left unformatted; this still needs to be resolved*******
/home the rest of the 500gb, I didn't write that down
/swap 4 gb

thanks SO much again for taking the time with all your comments!!
 
Old 09-28-2009, 06:43 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,900

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
FYI logical volumes i.e LV and logical partitions are not the same thing.

The 2x RAM size for swap rule of thumb does not really apply anymore. It really depends on the computers intended use and what applications it runs.
 
Old 09-28-2009, 06:47 PM   #10
Pupil
LQ Newbie
 
Registered: Sep 2009
Location: HOT 'Lanta
Distribution: trying Linux Mint and Sabayon now
Posts: 7

Original Poster
Rep: Reputation: 2
yes, I realize that ...

about LVM and logical partitions not being the same thing ... but that's about as far as I've gotten on that subject.

So what is the newer way of determining how to calculate proper swap, please? thanks!
 
Old 09-28-2009, 07:12 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,900

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
Have no idea what type of applications you are going to be running.
Having more then required is not going to hurt.
 
Old 09-28-2009, 07:52 PM   #12
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Re post #8; this sounds like you want a system to run a business on.
In that case I'd recommend not using ext4, it's still relatively new. I'm waiting until it's the default on eg RHEL/Centos; then I know it's fully baked.
In a similar vein, I'd recommend a long term stable distro like Centos (free verson of RHEL), comes with 5-7 yrs of updates and very stable.
Just my option btw...

As for partitions, I'd prob go with

/boot
/
/home
/var
swap
possibly a separate partition for apps/data. Enables you to upgrade or even re-install without trashing /home & apps/data.
Always do a backup before major upgrades though.
 
Old 09-29-2009, 06:22 AM   #13
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,902

Rep: Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775Reputation: 775
Some general comments on 'partition-ology'
  • you can make this as simple or as complicated as you like, there are some things that would point you one way or another
  • if you are worried about the exact allocation of space between partitions, heading towards the 'one big partition' style is advised
  • OTOH, if you are worried about performance, and the machine is a server and you can identify which disk areas will be heavily used, there is a case for fine-tuning the partition system in light of that
  • equally, if there is a concern about a process 'running out of control' or trying to take all the space for its files, there is a case for using the partition system to constrain the out-of-control usage of disk space
  • if you want to set up different disk areas with different characteristics, putting those areas on different partitions is the way to go

Another possibility, which has been alluded to, would to use LVM to manage the space and that means that you don't have to do so much to predict space requirements in advance.

It is clear that your current preference is for quite an involved partition system; mine used to be too, but in recent years have tended to simplify things with fewer partitions. I really don't think you'll see an identifiable problem with a rather simpler partitioning scheme, but then you probably won't see a problem with the schemes that you suggest, either.

@chrism01
Quote:
As for partitions, I'd prob go with

/boot
/
/home
/var
swap
I'd be happy with that, unless there was a recommendation from the database that I was intending using for some particular treatment of the partition upon which its data files reside.

Quote:
Originally Posted by Pupil View Post
...you should hv double your RAM for swap..../dev/sda12../swap..........4GB...swap
In most cases, if you are actually using 4G of swap, you have a rather lower performance than you could have, if you had more ram. I think if I was concerned that I might need that much swap, I'd use two 2G swap partitions, so I could decide not to use one later, if it became apparent that 4G was unnecessary. In any case, double is almost certainly an irrelevant recommendation these days, not even having been a particularly generally applicable idea back when it was formulated back in the late 80s.

Quote:
NOTE: as there are arguments for and against using ext4 yet, I don't want to have to 'upgrade' everything later and I will keep daily backups, I went ahead with ext4.
Quote:
...to run a business on.
In that case I'd recommend not using ext4, it's still relatively new. I'm waiting until it's the default on eg RHEL/Centos; then I know it's fully baked.
Neither are unreasonable positions; I think ext4 will be the default in the next version of OpenSuSE and is becoming the default in Ubuntu (not sure which version), so I think that point at which it is becoming sufficiently reliable, in general usage, is quite close. (But, just because one distro has it sufficiently reliable does not mean that another is using the same patched and up-to-date sources). It is also true if the system can be considered to be mission critical the bar must be set higher and it would be nice to see ext4 as default in something more enterprise-versioned like RedHat, SLES/SLED or Debian.

Quote:
I plan to set up this desktop as a home server
Does this mean that you have desktop hardware, but you intend to use it as a server? If it is mission critical for your business, I certainly would not encourage you to use your desktop-use machine as your server. (Alternatively, if it is true that it is desktop hardware, just hope that it is reasonable quality hardware...on cheaper machines, the power supply and the fans are often of, errr, less than the highest quality.)

Quote:
probably with a shared database if/when I can figure it out.
If you intend to use the machine for serious database purposes, I would look carefully at the recommendations for that particular database. I believe that the situation for Oracle is that they recommend a raw volume for the database files. Other databases will have different recommendations. For light usage, probably anything will work.

Here is a link:
http://en.opensuse.org/SDB:Basics_of...,_mount_points
which, while it specifically concerns OpenSuSE, is a nice backgrounder.
 
Old 09-29-2009, 08:27 AM   #14
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,084

Rep: Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110Reputation: 1110
If you don't understand why you are partitioning (and most of us don't) then you probably are partitioning incorrectly enough that simpler would be much better. Maybe go all the way to just / and swap.

Lots of ideas about partitioning are left over from long ago, when a primary goal of partitioning was damage control in case of a corrupted filesystem. You wanted to maximize the probability that after a filesystem was corrupted you could pull together enough of a working system to use as a platform from which to run the salvage operation on the rest. But current filesystems, such ext3, are enough more robust that such problems are less likely and current liveCDs are complete enough that a liveCD, not a fraction of your installed system, is the logical platform to use for a salvage operation.

So maybe you want partitioning to divide directories by how likely they are to try to take more space than you want them to have vs. how important is it to protect them from other directories that may want to take more space than you want them to have. But probably you don't understand how any of that actually applies to your situation. Also disk space is very cheap so none of your directories are ever likely to try to take more than you want them to have (at least not faster than is best dealt with by occasionally finding and deleting obsolete files). Also you don't know in advance how much you will want them to have. So the best protection against unpredicted growth anywhere is to put everything together sharing one big pool of free space.

So maybe you want to use partitioning to control the physical disk positions of files to optimize performance.

If the disk will be heavily used and the frequently accessed partitions will be accessed two to five times more often than non frequently accessed partitions, then you probably want the frequently accessed stuff near the middle of the drive to cut down seek times to and from the frequently accessed stuff from/to elsewhere on the disk.

If the drive is less heavily used and/or the frequently accessed partitions will be accessed more than five times more often than non frequently accessed partitions, then you probably want the frequently accessed stuff near the beginning of the drive, because the beginning of the disk is about twice as fast as the end.

But probably you don't know enough about the likely access pattern and you have enough ram that file caching will work well and nothing on disk will be accessed enough to need that optimization and a single / partition will be a lot easier.

Where should SWAP go: On a system with too little ram, SWAP is heavily used and SWAP accesses are significantly mixed with non SWAP accesses, so the SWAP partition belongs near the middle to minimize seek time to/from it. On a system with plenty of ram, SWAP is long term parking for the anonymous pages of idle background processes, plus it is unused space as a safety valve for high memory loads that probably won't happen. So it should get the very end of the drive which is slowest and furthest out of the way of everything else. If the amount of ram is somewhere in between (not clearly too little but not "plenty") the location of SWAP is a trickier choice.

In all the above "beginning", "middle" and "end" of a drive are as viewed by a partitioning program. On the physical drive the outer edge is the partitioning "beginning" and the edge closest to the center is the partitioning "end". So I want to make clear that by "middle" I meant half way between outer and center. I didn't mean center is middle (hope that helped rather than further confused).

Last edited by johnsfine; 09-29-2009 at 08:44 AM.
 
Old 09-29-2009, 10:59 PM   #15
Smartpatrol
Member
 
Registered: Sep 2009
Posts: 196

Rep: Reputation: 38
...

Last edited by Smartpatrol; 03-11-2010 at 09:38 PM.
 
  


Reply

Tags
fdisk, partitioning, reiserfs, rpms, slackware, slackware13, xfs


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
Partition advice needed aerogate Mandriva 11 12-16-2005 06:40 AM
/boot partition needed? Seiken Linux - General 4 04-18-2005 01:28 PM
Time planning software needed mcle Linux - Software 4 04-18-2005 10:23 AM
urgent partition help needed tedivm Linux - Laptop and Netbook 12 09-02-2004 01:03 PM
is swap partition really needed ? rajorshi Linux - General 10 07-27-2003 07:12 PM


All times are GMT -5. The time now is 05:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration