Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Operating Systems > Linux, Unix

Reply
 
LinkBack Thread Tools
Old 01-30-05   #1 (permalink)
Overclocker
 
Kittani's Avatar
 
amd nvidia

Join Date: Jan 2005
Location: Castle Rock, CO
Posts: 714

Rep: 109 Kittani is acknowledged by manyKittani is acknowledged by many
Unique Rep: 82
FAQs Submitted: 6
Hardware Reviews: 5
Trader Rating: 1
Default Linux Partitioning Guide


Guide to Partitioning for Linux

In this guide I will take you through some of the tings you need to know when preparing a hard drive for Linux. Some of these things relate to performance, some to security. The first thing you shoudl do before doing any hard drive work is to BACK UP ALL OF YOUR DATA. You've been warned.

Next thing to do is grab a pad and paper and something to drink (non-alcoholic as alcohol and partitioning doesn't mix) Partitioning is one of the lost arts of computer tuning. Let me give you some background on my experience.

First I have been able to load over 15 operating systems on the same hard drive before, all accessible from either the windows or the linux boot managers. I have used programs like partition magic and such but I find that using the FDISK utility that comes with each operating system is just as effective and in mose cases makes for far more stable a system. I have been workign with hard drive geometry for over five years and during that time I have learned quite a few things. The first thing to learn is that you must do everythign on paper first. "Proper Prior Planning Prevents Piss Poor Performance" as my ex-wife's father used to say.... brilliant man.

Now if you're all set we can begin. I can;t use ascii for this since the page doesn't parse spaces correctly.(hey admin... can you make a feature that lets us draw directly into posts?)

Step One: Visualize

Draw a rectangle about the width of the page about an inch high.

Now you have the form with which to begin molding your new drive partition system. If you have multiple drives draw boxes for them too. Don't worry about proportions as this is just to visualize what you are doing.

Step Two: Positional Planning and Taking Stock

Within the box you will need to divide it into separate compartments. Each of these will represent the partition you are creating and will list what types of partitions you are creating. Before you begin slashing up this space you have to plan for what you will be installing. Some people have Windows and Lin ux dual booted, some just use single OS's with removable hard drive kits, still others install many operating systems. This guide will focus on a Windows/Linux Dual boot configuration. If you are just doing one or the other you can refer to the charts at the end of the guide to help you determine what you need to do after reading this guide.

Hard drives work by spinning a disk and moving several arms across the surface to read and write from the surface of the disk. When your computer is off the arms are stowed away off of the surface of the disk. When it boots up the arms move to the edge of the disk and begin reading the first track at the edge... this track 0 and is also known as the MBR. Each track is divided into sectors and again into blocks. The important thing to remember is that like a record player the arm reads data from the outside in. the majority of the time a hard drive spends looking for data is in the process of moving the arm to the appropriate track. If you want to increase system performance you need to do whatever you can to limit the amount of real estate that arm needs to cover to get to any given information.... virtual memory and linux swap spaces included. The system hits these constantly and as such you can find the arm constantly swinging back and forth across the disk surface... causing massive time loss in the long run. The solution is to place these areas of the hard drive as close to the core operating system as possible. In the old days space was limited so this was never a problem. Even today if you have a drive of less than 20 gigs you don;t need to worry about it as you don;t have the real estate to do anything about it. Now with hard drives fast approaching a half a terrabyte... you have the room to tweak this often forgotten aspect.

Now we'll say for the sample of this guide you have a 100 gigabyte drive. The first thing you need to do is take an inventory of all of the software you plan to install. All of your games, all of your applications... for me that's less than 30 gigabytes. This will be your windows partition. Don;t figure in your music or photo collections or any other personal data... we'll get to that later. Just the amount of data space you need for all of your applications. IF you got the number add 10% to whatever it is and round it up to the nearest increment of 5. In my case I figure I needed 30 gigabytes... add the 10% to make it 33 gigs and then rounded up to a nice even 35 gigabytes. Go ahead and draw a line at about that point on your bar. Write in Windows and 35gb in the box (leave some room for additional info as we get to it)

Now we need to separate the windows virtual memory system from the system partition. If you have the luxury of a second hard drive you can put it on there but for now we'll assume you don't. This partition only needs to be a maximum of 2 gigabytes... draw a sliver in the space next to the first box and label it as the windows VM 2gb. You have already started to amplify the speed of your hard drive by more than 50% by cutting out half of the drive you need to search to find anything. That covers windows with 2 partitions, but what about linux?

For linux we need to set up many partitions.. most will be small and will b e located within an extended partition. Windows has to be in a primary partition and so does linux's /boot filesystem. This isn't a problem as we have one primary left to work with. out of the 100 gigabytes we have about 63 left to play with. Linux in total will need no more than 5 gigabytes, 10 if you plan to go wild with many applications. It's no where's near the "bloatware" that windows applications are. The first partition you will need to plan for is the core of the linux OS... the Root. All things come form root and everything in linux.. even hardware... is a file inside of root. It truly is a very zen operating system in this respect. You will need about 4 gigabytes for the root file system... more if you really plan to do some heavy work. I use 10 to be on the safe side. Add in this space to your bar and label it linux root 10gb. Now we only have one more partition left we can actually make as a primary, but several left to make. The rest of the drive will be an extended partition. Write that in and draw a new bar to represent that space. In this example I have 53 gigabytes left of real estate in the extended partiton. For logical dives we will need a swap drive, a temp drive a variable drive, a home drive, and a place to save files from both windows and linux. As with windows you will only ever need 2 gigs of swap space so draw that sliver in first. label it accordingly as a Linux Swap 2gb. The Linux swap is similar to the windows Virtual memory page file in that it's a place for the system to store data that is in the middle of being processed but cannot fit into main memory. Unlike Windows however Linux MUST have a swap space. It is a requirement for the system to even operate, even if you have enough memory for the system to never use it. Now that we have the root and swap planned out let's begin with the rest.

The temporary and Variable /tmp and /var paths in linux respectively are separate for security reasons. These locations are publicly writeable and having them in with the rest of the operating system can cause a denial of service attack. Additionally any user can write to their home directory so you also want that separate from the rest of the root filesystem as possible. If the root filesystem's partiton shoudl ever become completely full the system will crash and most likely be lost. Keeping these areas separate will save you alot of headache in the long run and is much safer than simply setting software disk quotas. Temp can be as small as as 500 megabytes but I like to give some breathing room for large applications to write to so I use 5 gigabytes for both of the /tmp and /var filesystems. This will only bring our total remaining to 41 so it's not a big hit at all. If you plan on running a web server or FTP server the files will be stored in /var... along with system logs and such. If you plan on accessing and using these features then give it some more room as you see fit. draw and label those partitions in accordingly. when you are done you only have the /home area and the shared areas left. if you plan on transferring alot of files between the two systems then make the shared area larger. If you plan to do most of your wirk in Linux and don't need a large area... make the home area bigger. I tend to allow 10 gigs for home and the rest to shared. this leaves us with a 31 gigabyte partiton to make into a shared space. For the sake of simplicity I make the home a little bigger to bring the shared space under the 30 gigabyte FAT32 limit. Linux has a history of disliking NTFS so it should be avoided whenever possible.

Step 3: Partiton Away

Now that the plan is settled go ahead and create your first two partitons using The windows setup and get that OS installed. Once the system is installed you can refer to my guide on windows virtual memory to move it to the second partion. For simplicity you may wish to hide this partiton in windows by using the drive manager to assign no drive letter or path to it. This will effectively remove it from 2000/2003/XP's my computer and prevent you from accidentlaly writing to it. Once that's done it's on to linux.

Once you start up the linux installer you will be bombarded with a bunch of stuff that is difficult to understand at first. There are plenty of how-to's on the net on using the linux FDisk program or the partition manager that comes in such distributions as red hat or whatnot. Just avoid changing the first two partitions and go through creating your other partitions. Most linux installers will give you the option of installing certain filesystems to certain partitions. Go ahead and do that when you are prompted. If no option is given then you may have to do it manually, which is beyond the scope of this guide. Finish the linux install, and set up windows in the linux Boot manager.(usually grub or lilo) There are also how-to's on settign this up available in almost every linux distro's help files. When you get back into windows start up the drive manager and add in the shared partition into the remaining unallocated space at the end of the extended partition. If it shows the whole thing as unallocated you will have to exit there and do it from the linux FDisk. Either way make this partiton Fat 32 and add it to the linux FSTAB file (once again there are how-to's on this on the net)

That's it. Below I will detail showing some different setups for different situations that work for me. If the system is a solo linux system it will also include a /boot to keep the boot files separate. I'll use percentages of total disk space to denote the sizes of the partitions. Note that there are minimums for each area of linux and you may have to adjust your partition sizes accordingly. It's not an exact science so feel free to experiment.

Format:
Partiton Type - Useage - Filesystem - Approx. Size

Windows / Linux dual boot
-------------------------

PRIMARY - Windows - NTFS - 30%
PRIMARY - Windows Paging - NTFS - 2%
PRIMARY - Linux / - EXT3 - 10%
EXTENDED
LOGICAL - Linux Swap - Linux SWAP - 2%
LOGICAL - Linux /TMP - EXT3 - 5%
LOGICAL - Linux /VAR - EXT3 - 5%
LOGICAL - Linux /HOME - EXT3 - 26%
LOGICAL - WIN/LIN Shared - FAT32 - 30%

Linux Solo System
-----------------

PRIMARY - Linux /Boot - EXT3 - 2% (200mb is fine)
PRIMARY - Linux / - EXT3 - 10% (3gb minimum in most cases)
PRIMARY - Linux SWAP - Linux SWAP - 2%
EXTENDED
LOGICAL - Linux /TMP - EXT3 - 5%
LOGICAL - Linux /VAR - EXT3 - 10%
LOGICAL - Linux /HOME - EXT3 - 71%

Windows / Linux Dual boot.. Multiple Hard Drives
----------------------------------------------

Hard Drive 1 (/dev/hda for linux IDE drives)

PRIMARY - Windows - NTFS - 50%
PRIMARY - Linux / - EXT3 - 48%
PRIMARY - Linux SWAP - Linux SWAP - 2%

Hard Drive 2 (/dev/hdb for linux IDE drives)

PRIMARY - Windows Paging - NTFS 2%
PRIMARY - Linux SWAP - Linux SWAP - 2%
PRIMARY - WIN/LIN Shared - FAT32 - 30%
EXTENDED
LOGICAL - Linux /TMP - 5%
LOGICAL - Linux /VAR - 10%
LOGICAL - Linux /HOME - 51%

(note: While more than one space for virtual memory can improve windows performance it isn't usually worth it. On the other hand having 2 linux swap spaces on separate drives will greatly enhance the efficiency of the system.)

Once again these are general IDEAS and you can customize these to suit whatever needs you have. There is no magical scheme that will work for everyone... this is only a guide to get you going on discovering what works for you.

I hope this guide helps you plan your system and helps you understand that software plannign is just as important as hardware planning.
__________________
Linux is ZEN
---------------------------------------------------

Never underestimate the power of the DORK side.

System: My System
CPU
Athlon XP 3000+ 400FSB
Motherboard
Soyo KT880 Dragon 2
Sound Card
Audigy 2 ZS
Power Supply
500w Ultra
Case
Artec Dragon Tower
OS
Multiple
Monitor
Sony CPD E400
Kittani is offline   Reply With Quote
Old 01-30-05   #2 (permalink)
Overclocked N00bLaR
 
Mr.N00bLaR's Avatar
 
intel nvidia

Join Date: Dec 2004
Posts: 4,917

FAQs Submitted: 4
Hardware Reviews: 1
Trader Rating: 0
Default

Kittani! WHERE WERE YOU A MONTH AGO!>? Lol...thatsa great guide dude..I wish i read that liek a month ago...No one told me partition would formatt the disk..lol i used partition magic....POOPY for the noob...

And now I know lol

good joberru!
__________________
System: The 2008 model
CPU
e5200
Motherboard
ASUS P5Q-E
Memory
2x2 G.Skill
Graphics Card
EVGA 9800GTX+
Hard Drive
4x80gig + 1tb
Sound Card
Xmusic
Power Supply
PCPC
Case
T.take Armor (No window)
CPU cooling
Stock Intel
OS
Ubuntu 9.04BETA
Monitor
AOC LM960
Mr.N00bLaR is offline Overclocked Account   Reply With Quote
Old 01-30-05   #3 (permalink)
Off By 340 Undecillion
 
The Bartender Paradox's Avatar
 
amd nvidia

Join Date: Oct 2004
Location: Portland, Oregon
Posts: 2,471

Rep: 368 The Bartender Paradox is a proven memberThe Bartender Paradox is a proven memberThe Bartender Paradox is a proven memberThe Bartender Paradox is a proven member
Unique Rep: 276
Hardware Reviews: 1
Trader Rating: 3
Default

very comrehensive
__________________
Congratulations! You have foundthe secret text! You get a cookie.

System: ½
CPU
AMD A64 3500+ Winchester
Motherboard
DFI nF4 SLi-DR
Memory
OCZ 4000VX
Graphics Card
EVGA 7800GT
Hard Drive
Maxtor 300Gb 16Mb Buffer
Sound Card
computers make sounds?
Power Supply
OCZ PowerStream 520W
Case
None
CPU cooling
Big
GPU cooling
Bigger
OS
XP Pro
Monitor
SOYO LCD
The Bartender Paradox is offline Overclocked Account The Bartender Paradox's Gallery   Reply With Quote
Old 01-30-05   #4 (permalink)
Overclocker
 
Kittani's Avatar
 
amd nvidia

Join Date: Jan 2005
Location: Castle Rock, CO
Posts: 714

Rep: 109 Kittani is acknowledged by manyKittani is acknowledged by many
Unique Rep: 82
FAQs Submitted: 6
Hardware Reviews: 5
Trader Rating: 1
Default

Quote:
Originally Posted by Mr.N00bLaR
Kittani! WHERE WERE YOU A MONTH AGO!>? Lol...thatsa great guide dude..I wish i read that liek a month ago...No one told me partition would formatt the disk..lol i used partition magic....POOPY for the noob...

And now I know lol

good joberru!
Sorry.... I was going to do it sooner but my vid cards were out of commission for a few weeks and I got sidetracked.
__________________
Linux is ZEN
---------------------------------------------------

Never underestimate the power of the DORK side.

System: My System
CPU
Athlon XP 3000+ 400FSB
Motherboard
Soyo KT880 Dragon 2
Sound Card
Audigy 2 ZS
Power Supply
500w Ultra
Case
Artec Dragon Tower
OS
Multiple
Monitor
Sony CPD E400
Kittani is offline   Reply With Quote
Old 01-30-05   #5 (permalink)
Original OCN Gangsta
 
Burn's Avatar
 
intel nvidia

Join Date: Sep 2004
Location: Massachusetts
Posts: 13,688
Blog Entries: 2

FAQs Submitted: 14
Folding Team Rank: 134
Team Name: CPU Burners
Hardware Reviews: 5
Trader Rating: 7
Default

holt *****! that's an awesome guide! extraordinarily in-depth and amazingly comprehensive... amazing job!
__________________
My CNC Mill Project
Quote:
Originally Posted by CyberDruid
Burn + Electricty + Water =
But the man has the patience of a saint...
We cannot change the cards we are dealt, just how we play the hand.
--Randy Pausch
Current Best Benchmark

System: Burning Phoenix
CPU
Intel Q9550
Motherboard
Gigabyte EP45-UD3P
Memory
4GB G.Skill DDR2-1000 5-5-5-15
Graphics Card
eVGA GTX 260 Core 216 SuperClocked
Hard Drive
3 WD 80GB RAID0, Seagate 500GB, WD 1TB Caviar BLCK
Sound Card
Creative SB Audigy 2 ZS
Power Supply
Silverstone OP750
Case
Lian-Li PC-A10B
CPU cooling
D-Tek Fuzion V1
GPU cooling
D-Tek Fuzion GFX + D-Tek Unisink
OS
Windoze 7 Professional
Monitor
Dual Dell E207WFP 20.1" Widescreen LCD's
1 Million+ Folding at Home points
Burn is offline I fold for Overclock.net Overclocked Account Burn's Gallery   Reply With Quote
Old 01-30-05   #6 (permalink)
Overclocker
 
amd

Join Date: Jul 2004
Location: Las Vegas, NV, USA
Posts: 973

Rep: 46 setite is acknowledged by some
Unique Rep: 28
Hardware Reviews: 2
Trader Rating: 0
Default

ill assume that was a good guide... i got bored... sorry... but yea i noticed you talking abotu 2gigs for swap and bla bla... did you add that most decent distros will automatically do that for you... i know ubuntu does... and fedora before that did...

EDIT: I'm about to set some space aside for Ubuntu64 now as my rig is finally working
__________________
System: My System
CPU
Athlon 64 62W 3400+
Motherboard
DFI LP UT NF3
Sound Card
Audigy 2 ZS
Power Supply
ULTRA X-Connect 500w
Case
Chenming 601 Server
OS
Windoze XP
Monitor
Dell 2005FPW
setite is offline   Reply With Quote
Old 01-30-05   #7 (permalink)
Overclocker
 
Kittani's Avatar
 
amd nvidia

Join Date: Jan 2005
Location: Castle Rock, CO
Posts: 714

Rep: 109 Kittani is acknowledged by manyKittani is acknowledged by many
Unique Rep: 82
FAQs Submitted: 6
Hardware Reviews: 5
Trader Rating: 1
Default

Quote:
Originally Posted by setite
ill assume that was a good guide... i got bored... sorry... but yea i noticed you talking abotu 2gigs for swap and bla bla... did you add that most decent distros will automatically do that for you... i know ubuntu does... and fedora before that did...

EDIT: I'm about to set some space aside for Ubuntu64 now as my rig is finally working
The problem with automatic partitioning is that sometimes it messes up. I have seen it actually corrupt the existing windows partitions.. plus this guide is for people that don;t have that luxury or wish to do it manually for the learning experience.
__________________
Linux is ZEN
---------------------------------------------------

Never underestimate the power of the DORK side.

System: My System
CPU
Athlon XP 3000+ 400FSB
Motherboard
Soyo KT880 Dragon 2
Sound Card
Audigy 2 ZS
Power Supply
500w Ultra
Case
Artec Dragon Tower
OS
Multiple
Monitor
Sony CPD E400
Kittani is offline   Reply With Quote
Old 01-30-05   #8 (permalink)
Retired Section Director
 
Xaimus's Avatar
 
amd nvidia

Join Date: Dec 2004
Posts: 576

Trader Rating: 0
Default

The root filesystem should only be 256 MiB max, since it alone is only supposed to hold tools vital to usage in single-user mode for recovery purposes. "/usr", on the other hand, should be a separate, large partition. The captive-ntfs "driver" allows full read/write access to an NTFS volume, and I think there are some ext2/ext3/ufs read/write drivers for Windows.

Also, does Linux really need a swap partition? I find that rather odd, considering that FreeBSD does not require one.

Anyway, excellent guide.
Xaimus is offline Overclocked Account   Reply With Quote
Old 01-30-05   #9 (permalink)
Site Old-timer
 
Lostnhell's Avatar
 
amd nvidia

Join Date: Sep 2004
Location: Virginia Beach, VA
Posts: 5,765

Rep: 491 Lostnhell is a proven memberLostnhell is a proven memberLostnhell is a proven memberLostnhell is a proven memberLostnhell is a proven member
Unique Rep: 265
FAQs Submitted: 10
Hardware Reviews: 11
Trader Rating: 3
Default

Quote:
Originally Posted by Xaimus
does Linux really need a swap partition? I find that rather odd, considering that FreeBSD does not require one.
.
According to my understanding the swap partition is like recondary RAM, and with my beleifs about computers I would rather have overkill in RAM than too little. Yes, with how much RAM most of us have it seems unneeded, but if you are a supreme number-cruncher the swap partition helps to minimize errors because of disorganized information being sent to the CPU.

If I am wrong about anything in this posting please notify me, I don't want to spread bad information.
__________________
System: My System
CPU
Athlon 3200+
Sound Card
onboard
OS
Slackware-current
Lostnhell is offline Overclocked Account   Reply With Quote
Old 01-31-05   #10 (permalink)
Overclocker
 
Kittani's Avatar
 
amd nvidia

Join Date: Jan 2005
Location: Castle Rock, CO
Posts: 714

Rep: 109 Kittani is acknowledged by manyKittani is acknowledged by many
Unique Rep: 82
FAQs Submitted: 6
Hardware Reviews: 5
Trader Rating: 1
Default

Quote:
Originally Posted by Xaimus
The root filesystem should only be 256 MiB max, since it alone is only supposed to hold tools vital to usage in single-user mode for recovery purposes. "/usr", on the other hand, should be a separate, large partition. The captive-ntfs "driver" allows full read/write access to an NTFS volume, and I think there are some ext2/ext3/ufs read/write drivers for Windows.

Also, does Linux really need a swap partition? I find that rather odd, considering that FreeBSD does not require one.

Anyway, excellent guide.
for simplicity sake you need to have a swap. The linux kernel would need to be reconfigured and parts would have to be re-coded to allow for the absence of a swap partition. That is far beyond the scope of the intended audience for this guide. And you are correct in that /usr can be split off as well, but until the users get familiar with the entire system and how to make static and dynamic links it should be with the rest of the root system. Also, not all software installs to the same place due in no small part to the lack of centrallization of the linux platform. Leaving the /usr filesystem with the rest of root can save alot of headaches later on.
__________________
Linux is ZEN
---------------------------------------------------

Never underestimate the power of the DORK side.

System: My System
CPU
Athlon XP 3000+ 400FSB
Motherboard
Soyo KT880 Dragon 2
Sound Card
Audigy 2 ZS
Power Supply
500w Ultra
Case
Artec Dragon Tower
OS
Multiple
Monitor
Sony CPD E400
Kittani is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -5. The time now is 09:20 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.18558 seconds with 8 queries