LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 12-13-2008, 12:35 AM   #1
oxblood
Member
 
Registered: Jan 2004
Location: Atlanta, GA
Distribution: Slackware 12.2
Posts: 82

Rep: Reputation: 17
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,
 
Old 12-13-2008, 03:07 AM   #2
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,974
Blog Entries: 33

Rep: Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466
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.......................
 
Old 12-13-2008, 03:07 AM   #3
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
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
 
Old 12-13-2008, 04:58 AM   #4
Duck2006
Member
 
Registered: Sep 2006
Distribution: Ubuntu 8.04 Hardy Heron LST
Posts: 346

Rep: Reputation: 33
Quote:
Should the swap partition be placed ahead of all other partitions
I would place the swap partition the last partition on the drive.
 
Old 12-13-2008, 07:42 AM   #5
oxblood
Member
 
Registered: Jan 2004
Location: Atlanta, GA
Distribution: Slackware 12.2
Posts: 82

Original Poster
Rep: Reputation: 17
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"
 
Old 12-13-2008, 10:06 AM   #6
oxblood
Member
 
Registered: Jan 2004
Location: Atlanta, GA
Distribution: Slackware 12.2
Posts: 82

Original Poster
Rep: Reputation: 17
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,

Last edited by oxblood; 12-13-2008 at 10:51 AM.
 
  


Reply



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
study of linux(SUSE 10.1) operating system installation with partitioning nids Linux - Newbie 1 04-06-2008 03:27 AM
LXer: Partitioning - one of the hardest steps in a Linux installation LXer Syndicated Linux News 0 10-25-2006 05:54 PM
RH Linux 9.0 installation step "Auto partitioning" not able to read partition table awahab Linux - Newbie 5 05-19-2005 07:53 AM
Partitioning for installation trotsky Linux - Newbie 6 12-24-2004 04:54 AM
Partitioning after installation stingerbee Linux - Software 10 08-04-2004 06:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:36 PM.

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
Open Source Consulting | Domain Registration