linuxnewbie.org.gif
Tuesday, 12-Dec-2000 10:32:08 EST
Newbized Help Files articles discussion board bookshelf sensei's log advertising info

How to create a multiple partition system

by Danny "Strike" DiPaolo

( IMPORTANT PREFACE: Doing this has a decent probability of completely destroying any and all data on your system. Back up all important data before attempting ANY of these measures, and do read the entire NHF before proceeding. Any time you mess with partitions, it is a risk of data loss and proper precautions MUST be taken. )

This NHF is aimed at those who wish to know what this business with multiple partitions is all about. Here's a quick breakdown of what I consider a few pros and cons of each to be:

Single Partition (just / and swap)
Pros:

  • Simple, and easy to manage
  • Non-restrictive to size of subdirectories
Cons:
  • Putting all your eggs in one basket - lose this partition and you've lost everything
  • Not share-able with other distributions

Multiple Partitions
Pros:i

  • Lots of control over size of directories
  • Easy maintenance
Cons:
  • Complex
  • Have to keep track of sizes of each subdirectory

So, it's not like one is necessarily BETTER than another (although people won't hesitate to tell you that their scheme is better). It is merely a preferential thing. I've used both systems but prefer the control of multiple partitions versus the simplicity of the single partition scheme.

And, because of this, I want people to be able to try the multiple partition scheme without having to wipe out their hard drive and reinstall. So, in order to do that, we have to do a lots of moving of data and creation of partitions and filesystems, etc. So, we'll go through this real slowly.

First, I'd recommend that you read 7DS's NHF on the basic filesystem stuff - knowing that will be a great help with this NHF, and I'm going to assume from this point on that you have read it. It's located at:

http://linuxnewbie.internet.com/nhf/intel/filesys/filesysintro.html

Well, now that we know the way the filesystem in Linux is generally organized and the way partitions are set up on drives, you need to go read my NHF on using fdisk to create and delete partitions, and then my NHF on creating filesystems on existing partitions, and you should be done. The only other thing we need to cover is laying out your multi-partition plan. This is something you should do before messing with partitions in fdisk.

Now what? Well, if you are doing this from a drive that already has stuff on it, then that has a little bit of a different approach than if you were simply planning on building a multi- partition system when you install. Both are possible, of course, but installing on a clean system is easier.

Either way, the first thing you will want to do is create a plan for how you want your partitions laid out. This is not something I can really give you a formula for. You have to play around with it (and, after this NHF, you shouldn't be too scared to play around with partitions) in order to get it to your liking. As an example, though. Here's what all those Linux partitions represent to me - my partition scheme is:

/dev/hdb1  = 1.49GB  - (FreeBSD sits here)
/dev/hdb2  = 133MB   - my swap partition
/dev/hdb3  = (extended partition)
/dev/hdb5  = 2GB     - /home
/dev/hdb6  = 251MB   - /var
/dev/hdb7  = 204MB   - /tmp
/dev/hdb8  = 1GB     - /
/dev/hdb9  = <unused>
/dev/hdb10 = <unused>
/dev/hdb11 = 2GB     - /usr
/dev/hdb12 = 2GB     - /usr/local
(plus 1141 unused cylinders at the end of the drive)

I also have partitions containing Windows stuff on /dev/hda, but that's unimportant to this NHF. You may be asking why I picked such weird numbers like 1.49GB and 133MB. Well, actually I didn't. A partition has to begin and end on a cylinder, and since my cylinders are locked in at a certain size, any and all of the partitions I create have to be a multiple of that size, so this was close as I could get to the sizes I requested. I actually wanted 1.5GB, 128MB, 250MB, and 200MB for the BSD, swap, /var, and /tmp partitions respectively. In fact, the 1GB and 2GB partitions aren't exactly 1GB and 2GB either.

For those of you who have an existing installation, you actually have an advantage in this area. You can simply take a look at how much space your directories take and then plan your strategy for partitioning accordingly. To see how much space a specific directory takes on your system, simply issue this command:


du -s -H 

For example, I want to see how much space all of the stuff I have in /usr takes up, so I do this:


du -s -H /usr

and I get back this:


1.6G    /usr

That's the size of all the files in that directory. If you do this as a normal user, you may get a bunch of permissions errors, and you might get a wrong answer, so su to root to do this first.

For those of you who don't have an existing installation, you can either use mine above as an example or ask around (or just wing it, I suppose).

Now, go plan out your partition strategy and then come back and we'll continue. Before going, though, I'd suggest that you leave space at the end of the drive (like I did) for further shifting around. For now I'd only make partitions a little bigger than you think you NEED.

[- next page: I've got my plan! -]


Would you like to have your article published online? Send them in to newfiles@linuxnewbie.org

The Linux Channel at internet.com
Linux Planet
Linux Today
Linux Central
Linuxnewbie.org
PHPBuilder
Just Linux
Linux Programming
Linux Start
BSD Today
Apache Today
Enterprise Linux Today
BSD Central
All Linux Devices
SITE DESCRIPTIONS
[-What's New-]
Order a Linuxnewbie T-Shirt
Easy Webcam NHF
Directory Navigation NHF
Installing Snort 1.6.3 on SuSE 6.x-7.x
Customizing vim
The SysVinit NHF
Installing ALSA for the VT82C686 integrated sound
USB Creative Video Blaster II for Linux
Configuring the Intellimouse Explorer in XFree86 V4+
The beginnings of a distro NHF
Getting Past Carnivore?
Getting and Installing PGP
Getting your ATI Rage 128 Working
How to create a multiple partition system
Using Fdisk
Introduction to Programming in C/C++ with Vim
Adding a Hard drive in Linux -- In five steps
Installing ALSA for the Yamaha DS-XG Sound Card
Getting your Diamond Rio Mp3 Player to work with Linux
Bash Programming Cheat Sheet
Installing NVIDIA Drivers for Mandrake
Setting up Portsentry
Hard Drive Speed Tweak for Linux
Sensei's Log
Chat room
Join: Linuxnewbie.org SETI Black Belts!
Send in your news
Click the image to add Linuxnewbie.org to your MyNetscape Page
[-LNO Newsletter-]

[-Archive-]
The beginnings of a distro NHF
Connecting to the Internet using KPPP
Getting your SBLive to work
Unreal Tournament NHF
LWE Day 2 Pictures
LWE Day 1 Pictures
The LNO FAQ!
WoW (Words of Wisdom)
Other sites news
What is Linux?
What is Linux? part deux (ups & downs)
Search newsgroups
The List
ALS Report
Feedback Form
jobs.linuxtoday.com.gif
Match: Format: Sort by:
Search:
[-Quick Links-]

Copyright 2000 internet.com Corp. All Rights Reserved. Legal Notices Privacy Policy

internet.com.gif