0% found this document useful (0 votes)
5 views4 pages

Hard Disk Partitioning and Filesystems Guide

The document discusses hard disk partitioning and file systems. It explains how hard disks can be logically divided into partitions to install different file systems or separate operating systems from personal data. Common file systems for different operating systems like Linux, Windows, and their properties are also covered.

Uploaded by

games games
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

Hard Disk Partitioning and Filesystems Guide

The document discusses hard disk partitioning and file systems. It explains how hard disks can be logically divided into partitions to install different file systems or separate operating systems from personal data. Common file systems for different operating systems like Linux, Windows, and their properties are also covered.

Uploaded by

games games
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Partitioning and Filesystem

Harddisk Partitions
Harddisks can be logically divided d into partitions. To these partitions filesystems are attached that
provide a interface for storing files.
Dividing harddisks can be useful if you want to install different filesystems on your harddisk or if
you want to separate your private data (like your documents, music, emails,...) from your operating
system.
Separating the personal data from the operating system has the advantage that you can reinstall or
delete your operating system without loosing your personal data.
If you want to install more than one operating system one the same harddisk it is common (and
normally the best choice) to install each operating system on its own partition.
Different operating systems have their own file systems. The standard filesystems for linux are
nowadays ext3 and reiserfs, windows 98 uses fat32 and windows2000 and windowsXP use ntfs. All
these file systems have different properties.

Filesystems
To store data on a physical device it must have a filesystem. The following are the common
filesystems for harddisks.
ext3 and reiserfs are reliable and adjustable linux filesystems. Administrators use them both.
reiserfs shall be a little faster and ext3 is an advanced ext2 filesystem which has many servicing
tools, that have been tested for a long time. They provide the linux file attributes. For windows exist
downloadable programs that can only read ext3 or reiserfs.
ntfs is the microsoft workstation and server filesystem since windows NT. It provides windows file
attributes that are also used in windows 2000 and XP. ntfs can be read by linux, write access does
still not work.
fat32 is the filesystem that was introduced with windows 95 and also used for window 98 and ME
(millenium edition). It provides only a few file attributes and all newer microsoft PC and server
operating systems use ntfs. All of the mentioned operating systems can safely read and write on this
file system. This allowes users of dual boot home PCs to store their personal data on a fat32
partition and have save read/write access with linux and windows. In linux it is often called vfat.

File attributes
The here interesting part of file attributes are file permissions (In the lecture operating systems file
permissions are called protection bits). Reading, writing and execution can be allowed or forbidden
for each file. (For files that are important for running the operating system a write permission
should be denied to ensure that these files are not deleted ore modified by normal users.)
In reiserfs, ext3 and ntfs file
permissions can be different for
different users. This improves
the security of the operating
system and is necessary for
privacy in multi user systems.
(later more about file
permissions)
Partitioning restrictions
Normal harddisks can only be divided into four (primary) partitions. Because of the need for more
partitions on one harddisk, the extended partition was invented. One of the four primary partition
was made to this extended partition that can store up to 16 additional partitions that are called
logical partitions. It is not possible to attach a filesystem to the extended partition.

Partitioning Hints for home PCs


Do not choose more than three primary partitions. It is much more complicated to add partitions to a
harddisk that has already four primary partitions. One has to be deleted (all data will be lost) to
create an extended partition.
Think carefully how your harddisk shall be configured: To get an idea of how many partitions you
need, you should think about :
● How many operating systems will be installed?
● How will the personal data will be organized? (It is useful to have the personal data on a separate
partition because of two reasons: 1. It is easier to backup, 2. If an operating system has to be
reinstalled the personal data are save on their partition.)
● Is a linux swap partition needed? (If linux will be installed a swap partition is recommended.)
To decide which size each partition gets you have to consider its purpose.
● A linux swap partition should have one to two times the size of the computers main memory.
● A linux system needs 2­5 GB of harddisk space depending on the number and sizes of programs,
that have to be installed.
● A windows2000 or XP needs the same size, also depending on the software to be installed.
● How much space do you need for your personal data.
● The sum of your partition sizes should not exceed the size of your harddisk. If it does, you
should think about saving space by installing less operating systems or reserving them less space
or storing for example your mp3 not on your harddisk but on CD.
On modern harddisks the first cylinders are faster. That is a good place for a swap partition.

Naming of harddisks / harddisk partitions


Most Personal Computers have an IDE­Bus as interface to the harddisk(s). Typically they have
controllers that can handle two IDE Buses. On Each bus two devices can be connected. One device
is called master and the other is called slave. In linux every device is an special file that is stored in
the /dev directory. The IDE devices are called hda, hdb, hdc, hdd, ...
IDE ­ Connection Filename
Primary Master hda
Primary Slave hdb
Secondary Master hdc
Secondary Slave hdd
... ...
If our harddisk is connected as the Primary Master to the IDE controller it gets the name hda. The
first partition on that harddisk gets the device filename hda1, the second partition gets hda2 and so
on. The first four numbers are reserved for the primary partitions so that logical partitions start with
hda5 even if we haven't got four primary partitions.

SWAP
If the main memory is full it is not possible to access more and no program can be opened and the
running programs could be blocked, if they need additional memory. To prevent an system hang the
memory can be freed by coping parts of the memory onto a swap partition or file. In linux it is
common to use a swap partition.

Partitioning programs
fdisk [option]... [device]
Command line partition table manipulator. It is capable add and delete partitions, to set the partition
type.
cfdisk [option]... [device]
cfdisk has the same functionality as fdisk but provides a semi­graphical interface. It is a good choice
if you don't have to resize a partition or make a complete new partition table.
qtparted
qtparted is a graphical program that is capable to resize partitions with some filesystems without
data loss. It has still version number 0.4 and is unfortunately not under development. (Programs
usually reach their planned full functionality with version number 1.0. It might have been planned
to make qtparted able to resize all filesystems)
Partition Magic
Partition Magic is a commercial program that should have more functions than the programs
mentioned before. But partitioning is a delicate procedure and Partition Magic has problems with
some partition tables.
mkfs [option]... device
The mkfs command is used to attach filesystems to partitions. It can attach all mentioned and some
more filesystems but ntfs.

The linux filesystem structure


In the linux filesystem hierarchy many physical and logical filesystems can be integrated and the
user does not has to care on which physical device or logical filesystem they are actually stored. The
linux filesystem has a root filesystem (not confuse with the user root), that is indicated with the /.
Normally the root filesystem is on a harddisk partition. On this partition at least the files needed for
the system startup are stored. This implies the programs in /bin and /sbin as well as the libraries in /
lib, the system configuration in /etc and the device files in /dev. Most of the other files like user
programs and user data can be integrated into the filesystem later. Additional filesystems are
mounted via the mount command into (preferable empty) directories of already integrated
filesystems. (The root (or /) filesystem is always already integrated.)
The following example shows how filesystems in linux are connected. (It shows only a little part of
the regular filesystem tree.)
hda2 hda5

hda6

After the execution of


mount /dev/hda5 /home
mount /dev/hda6 /data
hda5 and hda6 are integrated into the filesystem. /home and /data are
called the mount points of hda5 and hda6.

These commands are executed during the system start using the fstab (filesystem table)
configuration, that can be found in /etc.
/etc/fstab on my notebook:

# /etc/fstab: static file system information.


#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 /home ext3 defaults 0 2
/dev/hda6 /data ext3 defaults 0 2
/dev/hda1 none swap sw 0 0
/dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

You might also like