Partitions order? Need some clarification...

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
15,395
Location
www.poralix.com
Hello,

I'm used to following the guide without a step aside. And I have always been doing partitioning the way suggested on this page. In my understanding all partitions should be ordered exactly as it is suggested by the guide, i.e.

/dev/sda1 /boot
/dev/sda2 swap
/dev/sda3 /tmp
/dev/sda5 /
/dev/sda6 /var
/dev/sda7 /usr
/dev/sda8 /home

So, my question is, how critically important and strict is the order of the partitions?

I've met different views on the subject and diametrically opposed opinions.

As for swap and /tmp:

The first partition of a disk has a theoretically higher speed, being located on the outer edge of the disk. So putting swap first would appear to give better swap performance, at the expense of slower access to other partitions. However, this is one of those areas where theory and practice are distant cousins, at best. Disks no longer use fixed sectors as in the old days, so it makes little, if any, difference.

If swap access is a serious performance bottleneck, you should be considering more memory.

Found here http://www.linuxformat.com/forums/viewtopic.php?p=68490#68484

http://www.faqs.org/docs/Linux-mini/Partition.html#SWAPPLACEMENT

So if to take the fact that modern disks no longer use fixed sectors into consideration, does the strict order has any sense nowadays?
 
Order is not important at all. There is no mention of order being important in the guide. Once the filesystems are mounted, most everything is handled via file paths.
 
Anyway I'm a little bit frustrated and confused, as I have not found any official information on the subject. Even wiki.centos.org does not give a one-figure answer.
 
I've been using Linux since kernels previous to 1.0, and I've never seen, read, nor heard, of any importance to partition order.

When installing CentOS (v 1 - v 5 anyway) it doesn't matter in what order you enter them, the installer may change the order, but as far as I can tell, that's just for efficiency in using all sectors of a drive.

/boot, of course, needs to the first partition (though we haven't needed it for years, even on 2TB drives [though we do use it, for safety]), but if you don't set it up first, as long as you mark it that it must be a primary partition, CentOS installer will put it as the first partition after the MBR. More important is that data (/home /var, /tmp, and swap, generally) should be on different drives, to avoid delays in moving the heads.

Jeff
 
OK, for now it seems to me to be more or less clear. But still there is a little confusion about the fact, that I can't even remember what was it, that made me think that the order was very important.

And then is there any logical answer, why do the partitions on this page come in that order? Even though there is not a word, that one should strictly follow the order, there is no a word either, that the order can be freely changed.
 
OK, for now it seems to me to be more or less clear. But still there is a little confusion about the fact, that I can't even remember what was it, that made me think that the order was very important.
You've gotten me thinking (always a dangerous thing :)). So I decided to look through my various systems administration books I've bought through the years to see what I can find that may have influenced my thinking. My original Linux book, bought in 1995, if I recall correctly, from a small company in Long Beach NY (the same Long Beach NY featured so many times in this past weekend's hurricane coverage on CNN), is long gone, and so is the company.

The second Linux book I checked, from the M&T Books SLACKWARE Series, specificlly the book Linux Configuration & Installation, written by Patrick Volkerding (of Slackware fame) and others. A good source, I thought. But they describe only (horrors!) a single partition install sharing space with an MS Windows installation.

Then I looked for my Linux Bible. I couldn't find it either, but it brought back a great memory of the time I reading it while sitting in a fast food restaurant and a young Christian missionary passed by my table and asked me which version of the Bible it was :).

Next I checked Linux Complete, a printed version of the Linux Documentation Project. It doesn't document any specific order.

Then I saw on my bookshelf Building a Linux Internet Server. Published in 1995, though I didn't buy it until at least 1998. Included an old copy of Slackware on CD-ROM, perhaps the same one I used to build my first webserver in 1995. I don't know because I'd never opened the CD-ROM, probably never even read the book. No luck. No information at all on which partitions to create.

I've given up. Maybe it was in that Linux Bible, but if so, I no longer have it to check.
And then is there any logical answer, why do the partitions on this page come in that order? Even though there is not a word, that one should strictly follow the order, there is no a word either, that the order can be freely changed.
That order has only one minor difference from the order I've been using for years. I've always put /usr before /var, perhaps because that appeals to my alphabetically oriented mind.

Why then do we put /home at the end? Probably because the Red Hat, and later the CentOS partition setup makes it easier to see how much space we've given /home, when we tell it to create a partition using the balance of the drive.

Maybe John can tell you why there's a specific order on the DirectAdmin installation screen; all I can tell you is that it works.

Jeff
 
OK, my first server was running FreeBSD, and here is a picture with auto defaults, suggested by sysinstall. That might be the reason. It's hard to find the source now.

Yes, it would be great if John explain us the order.
 

Attachments

  • disklabel-auto[1].png
    disklabel-auto[1].png
    4.3 KB · Views: 122
You've definitely refreshed my memory...

Before I used Linux i used BSD OS (not freeBSD); perhaps I got the idea from there.

And before I used BSD OS I used Xenix. Perhaps I got the idea from there.

Ask John; maybe he can tell you :).

Jeff
 
I'm not sure the order really matters.
I believe the order in the install guide is from a sample build box we had a while ago.

As far as performance goes, I'm not sure it would make any difference. The drive's arm still needs to move to a spot on the disk, and continuous reads would be the same speed (roughly) from any spot, once the arm is reading.

The only reason you'd want to adjust the sizes is for the varying amount of data you have, where it's stored, and the size of your drive.

If you've got a 6gig drive, you may want to put it all on /.
If you have a larger drive, separating partitions can be handy to prevent (for example) out-of-control Users on /home from filling up /var.

But at the same time, if you make one too small, (eg: /var), then it's difficult to allow room to expand.

With the segregation of partitions, it's good because you can set them to noexec/nosuid, where appropriate.

It's ultimately up to you and what you need. DA itself doesn't care what partitions there are, as long as the paths exist. Keeping /home on it's own might be good, as quota would be working on fewer files, but I'm not sure if the difference would even be noticeable.

As for the order, I can't say that I can think of any reason to have one order vs another since disk access times are almost negligible these days. If you wanted, put your "busy" partition in the middle, so the arm is never more than 1/2 way away ;) As for which one is the busiest, it depends on what you've got on the disk.

I personally wouldn't be worrying about the order.

John
 
Thanks Jeff, thanks John. You both helped me a lot. And if a question come, now I have a link to this thread, and I'll definitely will give it.

Nobody knows how much time I've spend struggling with Anaconda (OS installer on an installation CD/DVD) and making my own kickstart file for PXE booting?! That was done to get partitions directly ordered as it shown in the guide.

Uhh, now it will be much easier.
 
The general idea of having no order is security .. not everybody wants the same paths.

I would recommend looking at these manuals :

http://docs.redhat.com/docs/en-US/R...tallation_Guide/s2-diskpartrecommend-x86.html

I do remember the slackware days and dialup 28800 ,

always had In all cases
/boot

- the rest .. according to the needs/drives


/var should be on it's own pair of drive at least.


some tips and tricks for mounting /tmp :

Nice thing you can do with /tmp , just to gain some more speed , create a Raid-0 array only for /tmp , that way you also got a larger /tmp , and even a faster one.

the tempfs for /tmp should do well also but that depends on your memory usage profile.
 
Last edited:
I do remember the slackware days and dialup 28800 ,

always had In all cases
/boot

- the rest .. according to the needs/drives

I do believe that had to do with the old BIOS, where the bootable/active partition needed to be below the 1024 cylinder. More recent computers don't have that limitation.
 
The general idea of having no order is security .. not everybody wants the same paths.
What does partitioning have to do with paths?
The generalities are okay, but forget about the numbers in table 9.3; won't come close to adequate on a hosting server.
I do remember the slackware days and dialup 28800 ,

always had In all cases
/boot
No longer required on modern systems. We do use it; usually a GB, so we don't have to keep emptying out old kernels.
/var should be on it's own pair of drive at least.
Why a pair? Do you mean for RAID?
the tempfs for /tmp should do well also but that depends on your memory usage profile.
And remember that anything kept in a tempfs filesystem will be lost on system reboot. While traditionalists never put anything in /tmp which needs to survive a reboot, we're all not that good at keeping track of what we may put into /tmp.

Jeff
 
What does partitioning have to do with paths?

I knew this question would come up.

when you partition disks ( normally on RAID arrays ), you select which partition will hold which path( according to the psychical disks arrays ).

/dev/sda1 path for /boot
/dev/sda2 path for /
/dev/sdb1 path for /var
/dev/sdc1 path for /home
/dev/sdd1 path for /tmp

to explain better, I use separate arrays on the same machine, like we said .. for each his own setup :)


No longer required on modern systems. We do use it; usually a GB, so we don't have to keep emptying out old kernels.
done for old times sake .. ( sanity check not required anymore, but it's still sanity without a check we like a place for kernel and configs. . .)

Why a pair? Do you mean for RAID?

Yes I think this topic should be about production systems, so RAID is part of it from my point of view.

And remember that anything kept in a tempfs filesystem will be lost on system reboot. While traditionalists never put anything in /tmp which needs to survive a reboot, we're all not that good at keeping track of what we may put into /tmp.

Jeff

++
 
I knew this question would come up.

when you partition disks ( normally on RAID arrays ), you select which partition will hold which path( according to the psychical disks arrays ).

/dev/sda1 path for /boot
/dev/sda2 path for /
/dev/sdb1 path for /var
/dev/sdc1 path for /home
/dev/sdd1 path for /tmp

to explain better, I use separate arrays on the same machine, like we said .. for each his own setup :)
And I still don't understand what this has to do with it, since you can path anyway you want, and partition any way you want.

However, for sanity sake, just forget I asked :).

Jeff
 
Back
Top