LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Partitioning for Linux Installation (https://www.linuxquestions.org/questions/linux-newbie-8/partitioning-for-linux-installation-690258/)

oxblood 12-13-2008 12:35 AM

Partitioning for Linux Installation
 
Hi,

If I am planning to install Linux as a sole OS on a machine with one hard drive, what would be a sensible partitioning scheme? Obviously by planning to place various logical entities on various partitions, I do need to use an extended partition. Doing so, where does the root partition (i.e. "/") is placed and where should the "swap" partition reside? For instance,

One primary partition with the root partition ("/")
One extended with multiple logical partitions ("swap," "/usr," "/home," etc.)

Code:

primary(1) "/"
extended
  logical(1) "swap"
  logical(2) "/usr"
  logical(3) "/home"
  etc.


Or should the root ("/") and swap partitions be placed on a separate but "primary" partitions and the rest ("/usr," "/home," "var," "/db," etc.) be placed on their designated logical partitions?

Code:

primary(1) "/"
primary(2) "swap"
extended
  logical(1) "/var"
  logical(2) "/usr"
  logical(3) "/home"
  logical(4) "/db"
  etc.


Should the swap partition be placed ahead of all other partitions in either case? -- except the root ("/") partition.


Sincerely,

beachboy2 12-13-2008 03:07 AM

The topic is discussed in depth here:
http://www.linuxmint.com/forum/viewt...artition&t=358

SilverBear's article is also worth a read:
http://sblinux.org/pages/symlink-home.html

His main summary is:

1.Make the OS root partition and the /home partition separate
.
2.Make your /home partition and your saved data partition separate.
3.Use symbolic links to access your data partitions [wherever they may be] from within your /home user directory.

I just use:
Primary sda1 root / 12gb
Primary sda2 swap linux-swap 1 or 2gb
Primary sda3 home /home carve up as required
Extended sda4
which contains several Logical partitions as required
sda6
sda7
sda8 etc.......................

aus9 12-13-2008 03:07 AM

hi

can you indicate the size of your hard drive?

2) I am biased thru years of using partimage so I have
/
swap
spare

where home and usr and boot etc is sub-folder to / cos I image / a lot.

3) if you think you are going to try out a lot of hard drive installs, a separate home might be ok
but being an ex-distro slut myself I satisfy my cravings with virtualbox

Duck2006 12-13-2008 04:58 AM

Quote:

Should the swap partition be placed ahead of all other partitions
I would place the swap partition the last partition on the drive.

oxblood 12-13-2008 07:42 AM

Thanks for the replies.

But I still didn't get an answer I was looking for. When partitioning by cylinders (incremental from 1 to whatever), does the smaller cylinder number represent an "outer" edge or an "inner" edge? Why is it that the data placed on the "outer" edge _read_ faster? And vice versa, why is the data on the "inner" edge _written_ faster?


So far this is what came up with (JFS file system):

Code:

primary(1) "/" (everything including /boot, /sbin, /lib, et al.)
extended
  logical(1) "/db"
  logical(2) "/var"
  logical(3) "/usr"
  logical(4) "/home"
  logical(5) "/tmp"
  logical(6) "swap"


oxblood 12-13-2008 10:06 AM

Ok, so the cylinders number from 0 and up are laid out from "outer" to "inner," for instance, if a hard drive contains 7800 cylinders/tracks, then 0 - 635 cylinders are the most "outer" tracks/cylinders and 7400 - 7800 are the most "inner" tracks/cylinders. The "outer" tracks/cylinders are usually read "faster" because the size of the track would accommodate larger number of sectors.

Some people suggest that it's better to have a separate partition for "/boot" in case something goes wrong with the root partition, "/". In this case, creating "/boot" partition should precede the remaining root, "/", partition.

As far as the "swap" partition, this one is a bit tricky. Obviously the outer tracks/cylinders, as I mentioned, are faster to read, so placing the "swap" partition close to the outer edge would improve accessing swap. However, this all depends on a type of application or system that user utilizes. If a program has a large data with sporadic random accesses which reduces the locality of reference and evidently results in huge working set. Obviously the larger the working set, the more swap you need and the more access it probably going to experience therefor, placement of swap becomes vital. Then comes the question of which partition is going to introduce such scenario. Let's say "/db" is one of those partitions that causes such random havoc (i.e. bad bad database design and actual implementation) so the swap should be placed closer to "/db," regardless of where it sits -- "/db" could reside on the middle or on the most inner cylinder/track so "swap" partition shouldn't be too far away from "/db" partition. Of course an unlimited RAM is the biggest plus.


Code:

primary(1) "/boot"
primary(2) "/" (everything else including /sbin, /lib, et al.)
extended
  logical(1) "/db"
  logical(2) "swap"
  logical(3) "/var"
  logical(4) "/usr"
  logical(5) "/home"
  logical(6) "/tmp"



Some other people also mentioned if the swap partition goes over 2 GB, then it's wiser to scatter the amount onto multiple swap partitions (which is something I am not going to do because my RAM doesn't exceed the rule of thumb RAM x 2 amount of 4 GB) but if it was, I could change the partition table to:


Code:

primary(1) "/boot"
primary(2) "/" (everything else including /sbin, /lib, et al.)
extended
  logical(1) "/db"
  logical(2) "swap" (1st, 2GB)
  logical(3) "/var"
  logical(4) "/usr"
  logical(5) "/home"
  logical(6) "/tmp"
  logical(7) "swap" (2nd, 2GB)



And if you have multiple hard drives, then place a swap partition on each of it. Frankly, I do not know about whether that the scattered partitions should have the same exact distance accordingly from the beginning of the outer edge or can be placed base on other partitions' layout and their accessing exigency. Any suggestions?



Sincerely,


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