home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BURKS 2
/
BURKS_AUG97.ISO
/
BURKS
/
LINUX
/
HOWTO
/
mini
/
partitn.txt
< prev
next >
Wrap
Text File
|
1997-07-07
|
26KB
|
600 lines
The Linux Partition mini-HOWTO
by Kristian Koehntopp, kris@koehntopp.de
$Id: howto.txt,v 1.3 97/01/24 13:08:02 kris Exp Locker: kris $
$Log: howto.txt,v $
Revision 1.3 97/01/24 13:08:02 kris
Some minor spelling corrections.
Revision 1.2 96/11/29 13:42:04 kris
Revised and edited for second public release.
Added:
- Introduction
- Introductory chapter on partitions.
- Example
Modified:
- Turned File Systems and Fragmentation into an extra chapter.
Revision 1.1 96/11/29 10:54:06 kris
Initial revision
WHAT IS THIS?
=============
This is a Linux Mini-HOWTO text. A Mini-HOWTO is a small text
explaining some business related to Linux installation and
maintenance tutorial style. It's mini, because either the text
or the topic it discusses are to small for a real HOWTO or even
a book. A HOWTO is not a reference: that's what manual pages
are for.
WHAT IS IN IT? AND RELATED HOWTO DOCUMENTS
==========================================
This particular Mini-HOWTO teaches you how to plan and layout
disk space for your Linux system. It talks about disk hardware,
partitions, swap space sizing and positioning considerations,
file systems, file system types and related topics. The intent
is to teach some background knowlegde, so we are talking mainly
principles and not tools in this text.
Ideally, this document should be read before your first
installation, but this is somehow difficult for most people.
First timers have other problems than disk layout optimization,
too. So you are probably someone who just finished a Linux
installation and is now thinking about ways to optimize this
installation or how to avoid some nasty miscalculations in the
next one. Well, exspect some desire to tear down and rebuild
your installation when you are finished with this text. :-)
This Mini-HOWTO limits itself to planning and layouting disk
space most of the time. It does not discuss the usage of fdisk,
LILO, mke2fs or backup programs. There are other HOWTOs that
address these problems. Please see the Linux HOWTO Index for
current information on Linux HOWTOs. There are instructions for
obtaining HOWTO documents in the index, too.
For instructions and considerations regarding disks with more
that 1024 cylinders, see "Linux Large Disk mini-HOWTO", Andries
Brouwer <aeb@cwi.nl>.
For instructions on disk spanning and striping, see "Linux
Multiple Disks Layout mini-HOWTO", by Gjoen Stein
<gjoen@nyx.net>.
For instructions on limiting disk space usage per user
(quotas), see "Linux Quota mini-HOWTO", by Albert M.C. Tam
<bertie@scn.org>.
Currently, there is no general document on disk backup, but
there are several documents with pointers to specific backup
solutions. See "Linux ADSM Backup mini-HOWTO", by Thomas Koenig
<Thomas.Koenig@ciw.uni-karlsruhe.de> for instructions on
integrating Linux into an IBM ADSM backup environment. See
"Linux Backup with MSDOS mini-HOWTO", by Christopher Neufeld
<neufeld@physics.utoronto.ca> for information about MS-DOS
driven Linux backups.
For instructions on writing and submitting a HOWTO document, see
the Linux HOWTO Index, by Greg Hankins <gregh@sunsite.unc.edu>.
Browsing through /usr/src/linux/Documentation can be very
instructive, too. See ide.txt and scsi.txt for some background
information on the properties of your disk drivers and have a
look at the file systems/ subdirectory.
WHAT IS A PARTITION ANYWAY?
===========================
When PC hard disks were invented people soon wanted to install
multiple operating systems, even if their system had only one
disk. So a mechanism was needed to divide a single physical
disk into multiple logical disks. So that's what a partition
is: A contiguous section of blocks on your hard disk that is
treated like a completely seperate disk by most operating
systems.
It is fairly clear that partitions must not overlap: An
operating system will certainly not be pleased, if another
operationg system installed on the same machine were
overwriting importating information because of overlapping
partitions. There should be no gap between adjacent partitions,
too. While this constellation is not harmful, you are wasting
precious disk space by leaving space between partitions.
A disk need not be partitioned completely. You may decide to
leave some space at the end of your disk that is not assigned
to any of your installed operating systems, yet. Later, when it
is clear which installation is used by you most of the time,
you can partition this left over space and put a file system on
it.
Partitions can not be moved nor can they be resized without
destroying the file system contained in it. So repartitioning
usually involves backup and restore of all file systems touched
during the repartitioning. In fact it is fairly common to mess
up things completely during repartitioning, so you should back
up anything on any disk on that particular machine before even
touching thinks like fdisk.
Well, some partitions with certain file system types on them
actually CAN be split in two without losing any data (if you
are lucky). For example there is a program called "fips" for
splitting MS-DOS partitions into two to make room for a Linux
installation without having to reinstall MS-DOS. You are still
not going to touch these things without carefully backing up
everything on that machine, aren't you?
Tapes are your friend for backups. They are fast, reliable and
easy to use, so you can make backups often, preferably
automatically and without hassle.
Step on soapbox: And I am talking about real tapes, not that
disk controller driven ftape crap. Consider buying SCSI: Linux
does support SCSI natively. You don't need to load ASPI
drivers, you are not losing precious HMA under Linux and once
the SCSI host adapter is installed, you just attach additional
disks, tapes and CD-ROMs to it. No more I/O addresses, IRQ
juggling or Master/Slave and PIO-level matching.
Plus: Proper SCSI host adapters give you high I/O performance
without much CPU load. Even under heavy disk activity you will
experience good response times. If you are planning to use a
Linux system as a major USENET news feed or if you are about to
enter the ISP business, don't even think about deploying a
system without SCSI. Climb of soapbox.
The number of partitions on an Intel based system was limited
from the very beginning: The original partition table was
installed as part of the boot sector and held space for only
four partition entries. These paritions are now called primary
partitions. When it became clear that people needed more
partitions on their systems, extended partitions were invented.
The number of extended partitions is not limited: Each extended
partition contains a pointer to the next extended partition,
so you can have a potentially unlimited chain of partition
entries.
For compatibility reasons, the space occupied by all extended
partitions had to be accounted for. If you are using extended
partitions, one primary partition entry is marked as "extended
partition" and its starting and ending block mark the area
occupied by your extended partitions. This implies that the
space assigned to all extended partitions has to be contiguous.
For certain reasons having to do with device numbering, Linux
cannot handle more than 4 extended partitions per drive. So in
Linux you have 4 primary partitions (3 of the useable, if you
are using extended partitions) and at most 4 extended
partitions.
In Linux, partitions are represented by device files, /dev/hd*
for IDE disks and /dev/sd* for SCSI disks. Disks are numbered
a, b, c and so on, so /dev/hda is your first IDE disk and
/dev/sda is your first SCSI disk. Both devices represent raw
disks, starting at block one. Writing to these devices with the
wrong tools will destroy the master boot loader and partition
table on these disks, rendering all data on this disk unusable
or making your system unbootable. Know what you are doing and,
again, back up before you do it.
Primary partitions on a disk are 1, 2, 3 and 4. So /dev/hda1 is
the first primary partition on the first IDE disk and so on.
Extended partitions have numbers 5 and up, so /dec/sdb5 is the
first extended partition on the s