Anda di halaman 1dari 8

Didn't find what you were looking for? Click Questions & Answers to ask a question.

Good answers await.

HOME ABOUT CONTACT FORUM JOBS SITEMAP PRIVACY POLICY Q&A search... RSS Feed Subscribe by E-m ail

Latest Reviews & Tutorials


Guide to disks and disk partitions in Linux
September 18, 2011
This article is an attempt to provide basic information about disk naming and partition
numbering conventions, in non-technical terms, to those new to Linux. I believe a basic
understanding of all the aspects concerning how a disk is referenced and partitioned will put you
in a better position to troubleshoot installation and disk-related...

Guide to disks and disk partitions in Linux


RECOMMENDED READING, TUTORIALS/TIPS | SEPTEMBER 18, 2011 12:22 AM

This article is an attempt to provide basic information about disk naming and partition numbering conventions, in non-
technical terms, to those new to Linux. I believe a basic understanding of all the aspects concerning how a disk is
referenced and partitioned will put you in a better position to troubleshoot installation and disk-related problems.

Basic information about partition tables and the difference between primary and logical partitions will be covered.

Hard Drive Naming Convention: – The first thing you need to know is there is no “C drive” or “E drive” in Linux. There are
equivalents, but when you come across a reference to a hard drive in a modern Linux system, you will typically see
something like /dev/sda, /dev/sdb, /dev/sdc, … etc. The “dev” is short for device, and in this case, a block storage device.
The “sd” is short for SCSI mass-storage driver. (SCSI stands for Small Computer System Interface.) For the rest of this
article, the “/dev/” will be dropped, so all references to hard drives and partitions will start with the last part only.

The first hard drive detected by a Linux system carries the sda label. In numerical terms, it is hard drive 0 (zero; counting
begins from 0, not 1). The second hard drive is sdb, the third drive, sdc, and so on. In the screenshot below, there are two
hard drives – sda and sdb, detected by the installer.

ADS

SUBSCRIBE

Subscribe to RSS or enter you email to receive new sletter for


new s, articles, and updates about w hat's new .

This screenshot comes from an installation process where three hard drives were attached to the system. enter your email... Subscribe

Q & A ON LINUXBSDOS

Partitioning the HD or not?


Swap does not mount [swapon failed: Device
or resource busy]
I want to make dualboot between
ubuntu11.4 and windows7, when ubuntu11.4
is already installed in my desktop, but how
please answre
question with GRUB bootloader in Fedora-16
alpha
Post-installation disk/Partition management
(LVM) – Debian 6/Win 7 dual boot.
What is “bios boot” in Fedora 16
Recommended disk space for Swap
does linux mint xfce 201108 installer is
simlar like linux mint xfce 201104?
What To Do If Your Mobile Phone Is Lost Or
Stolen
What HP Should Do With WebOS?

MOST RECENT POSTS

Guide to disks and disk partitions in Linux


Partition Tables: – A partition table describes the partitions of a hard drive or any storage device. And there are two ALT Linux 6 Simply review
standards for the layout of the partition table – MBR (Master Boot Record) and GPT (GUID Partition Table). MBR, also know ALT Linux 6 KDesktop review
as ms-dos, is what you might call the first standard. GPT came much later. While MBR is still the most widely used partition Ubuntu 11.10 beta 1 screenshot preview
table, it comes with two major limitations which led to the development of GPT. They are: How to delete DigiNotar CA certificate from
Firefox

1. It does not allow the configuration of more than four main partitions. Those partitions are called primary partitions. Mandriva Desktop 2011 review

2. Disk partitions may not exceed 2TB How to customize Mandriva 2011
Guest account and user management on
Mandriva 2011
The first limitation will be discussed in the next section. Nothing more will be written about the second in this article.
Mandriva 2011 installation and disk
Partitions and Partition Numbering: – To install an operating system on a hard drive, it must first be subdivided into partitioning guide

distinct storage units. Those storage units are called partitions. Under the MBR partitioning scheme, which is the default on Fedora 16 KDE and GNOME 3 Alpha

virtually all Linux distributions, there are three different types of partitions – Primary, Extended, and Logical. Extended, and screenshots

Logical partitions will be discussed further down.


RECENT COMMENTS

With MBR, any partition that is not explicitly created as an extended or logical partition, is a primary partition. And, as stated
Paul: Can you add information about UUID and disk
earlier, there can be no more than four primary partitions. The screenshot below was taken from an installation process labels please? Distributions are going the UUI...
where four primary partitions were created. If you observe closely, you will see that the first primary partition is sda1 and the
last sda4. Unlike hard drives, partition numbers start from 1, not 0 (zero). Any space not allocated to the primary partitions, Sal: I tried to install ubuntu 11.04 from usb stick to
external hard drive(no other internal ha...
is shown as “Free.” But while it may be free, it is, however, unusable. And that is because as far as the system is
concerned, that free space does not exist. darkduck: I'd like to mention that correct name of
distribution is Simply Linux. The fact that it w ...

alex_from_somewhere: Hmm, ok, thanks!! I


agree w ith Tom. Clear, short, easy tutorials like this
are aw esome...

Scott: Thank you so very much, my good man. I


w as severely frustrated w ith the internet before
yo...

SPONSORED LINK ADS

GIA cell phone chips

AD SQUARES WIDGET

YOUR LINKS HERE

Samsung Exhibit Accessories


Toner Cartridges For Printers
Leadership Pratch and Company
Samsung Exhibit Accessories
So if you attempt to create another partition using the free space, the installer will throw up the type of error message
So if you attempt to create another partition using the free space, the installer will throw up the type of error message
Motorola Titanium Accessories
shown in this image. The error message will always say, “not enough free space,” even when you know that there is space
HTC Status Accessories
available. And it does not matter how much that free space is. It will be unusable. Affordable Data Recovery

DESKTOP & SERVER BSD FLAVORS

ALT Linux DesktopBSD


CentOS FreeBSD
Debian MirOS BSD
Fedora NetBSD
Foresight OpenBSD
g OS PC-BSD

To get around the four primary partitions limit of the MBR partition table, the smart guys involved came up with the concept gNewSense TrueBSD

of an extended partition. By tagging a partition as an extended partition, it is then possible to create many more partitions Hymera Open
SECURITY & ROUTER
under the extended partition. Those partitions are called logical partitions, and theoretically, there is no limit to the number Knoppix
Linpus
of logical partitions that you can create. Note: Only one extended partition may be configured on a single hard drive. Astaro Security
Mandriva
Gateway
What the concept of extended partition brings to the table is illustrated in the screenshot below. You can see that there are Mint
BackTrack
three primary partitions (sda1, sda2 and sda3). And the fourth partition is an extended partition, which makes it possible to OzOS
ClearOS
create more partitions (in this example, sda5, sda6 and sda7). Under an extended partition, you can have free space, and Pardus
Devil-Linux
that free space is still usable. So you do not have to allocate all the available free space to the logical partitions of an Parsix
Endian Firewall
PCLinuxOS
extended partition. Community
Sabayon
EnGarde Secure
StartCom
Linux
Ubuntu
Gibraltar
Vine Linux
IPCop
Zenwalk
IPFire

SYSTEM & NETWORK NuFW.Live


pfSense
Clonezilla SmoothWall
GRML Express
Parted Magic Untangle Network
SystemRescueCd Gateway
Vyatta
NAS & SAN
XORP
Zentyal
FreeNAS
Zeroshell
Openfiler

SOURCE-BASED
MOBILE & CLOUD

Gentoo
Android
Lunar
Bada
LiMo
MeeGo
Symbian
Being able to create logical partitions comes in handy when you have to dual-boot with other operating systems like
Windows, PC-BSD or even another Linux distribution, especially if that other operating systems has used up three primary
partitions. In the image below, which was taken while setting up a system to dual-boot Windows 7 and Fedora 15 (see how
to dual-boot Fedora 15 and Windows 7), three Windows 7 partitions already exist on the target hard drive. That meant there
was just one primary partition to play with. Only by setting up the available free space as an extended partition, was it
possible to install the system. What this also shows is that Linux can boot from a logical partition.

LOOKING FOR A JOB?

Jobs by SimplyHired

CATEGORIES

Select category

View
ARCHIVES

Select Month

In the last two screenshots, the extended partitions were the last primary partitions (sda4). But it does not have to be. In this
screenshot, for example, the extended partition is the second primary partition (sda2), and first logical partition number is
still 5 (sda5). So whether an extended partition is the last primary partition or not, the logical partition number always starts
with the number 5.

Not all installation programs broadcast the presence of an extended partition. But if you know what to look for, you can tell if
one exists. In the image below, for example, you can see the partition numbers go from 1, then 5, 6 and 7. The presence of
partition number 5 and above, is the most obvious tell-tale sign of an extended partition. This image, by the way, was taken
while installing Ubuntu.
GPT: – As stated earlier, GPT, or GUID Partition Table, overcomes two limitations of the MBR scheme – maximum of four
primary partitions, and the 2TB limit to partition sizes. In the image below, for example, you can see that there are eight
partitions, with about 45GB still available. The most important point to note here is that all eight partitions are primary
partitions, as the concept of extended and logical partitions, is foreign to GPT.

With GPT, there can always be unallocated space at the end of existing partitions. And unlike the case with an MBR
scheme that has no extended partition, that “unallocated” space can be used to create new or additional partitions, unless
the maximum number of partitions possible with GPT has been reached. In the image below, for example, there are six
partitions and a small unallocated space remaining. The unallocated space may be used to create a new partition.

Currently, Chakra is the only Linux distribution that is configured to use GPT by default. You may read GPT disk partitioning
guide for Chakra to see the steps involved. Fedora 16, which is slated for release in early November 2011, will support
GPT. Test installations of the first beta release show that GPT will be the default on standalone installations. In dual-boot
setups, MBR will be used if there is an existing operating system installed on MBR partitions on the target disk. You may
read feature preview of Fedora 16 installer and Fedora 16 KDE and GNOME alpha screenshots for a few screenshots of
GPT partitions in Anaconda, the Fedora system installer.
0 To have articles like this delivered
saves automatically to your Feed Reader or
Like Save Inbox, subscribe via RSS or email. For
simple comments, use the
commenting system, but for more involved assistance, please use the Question & Answer section.

TAGS: DISK PARTITION, GPT

RELATED POSTS POSTS FROM THE SAME CATEGORY:

Feature preview of Fedora 16 installer

Manual disk partitioning guide for Ubuntu

11.04 The Benefits of Using Linux Logical Volume

GPT disk partitioning guide for Chakra 2011.4 Manager

Ubuntu 10.10 manual disk partitioning guide In search of the perfect Linux and BSD

How to dual-boot Pardus 2011 and Windows 7 desktop distribution

Manual disk partitioning guide for Linux Mint The Free Software Definition

Debian Edition Free software without the freedom?

The Benefits of Using Linux Logical Volume Linux Logical Volume Manager

Manager A Perfect Linux or BSD desktop distribution

Linux Mint 10 manual disk partitioning guide The best Linux, BSD firewall and router

Install Mandriva Desktop 2011 on a btrfs file distributions

system

How to dual-boot Linux Mint Debian Edition

and Windows 7

Hola! Looking for an answer to a question but did not find it?
Then surf on over to the Questions & Answers section. It's a
brand new addition to our site, and we are waiting just to
answer your question(s).

5 Comments

Paul
September 19, 2011 at 3:45 pm

Can you add information about UUID and disk labels please? Distributions are going the UUID route but you can get
around ugly UUIDs by labeling your disks. Much appreciated. Thanks.

REPLY

alex_from_somewhere
September 18, 2011 at 10:16 am

In the 5th picture (counting the error message picture), you point to the free space and say its “Free (and usable)
space”. But that’s only true IF you made the extended partition bigger…? Isn’t it? Cause it’s outside the extended
partition…

REPLY

finid
September 18, 2011 at 3:16 pm

The free space in that image is under the extended partition. It might not be apparent, but it is.

REPLY

alex_from_somewhere
September 19, 2011 at 4:16 am

Hmm, ok, thanks!!


I agree w ith Tom.
Clear, short, easy tutorials like this are aw esome!

REPLY

tom
September 18, 2011 at 9:17 am

This is the Best Article I have ever read on Partitions!! and I’m gonna spread it and use it to tech my friends!

Thank You!!! This has helped me learn the key concepts in partitions, even though I have been using linux for past 4
years!

REPLY

Leave a Reply
Name (required)

Mail (w ill not be published) (required)

Website

ADD REPLY

Notify me of followup comments via e-mail

Trackbacks

Blog Seja Livre » Guia de discos e partições no Linux

Guide to Disks and Disk Partitions in Linux


QUESTIONS & A RECENTLY POPULAR RECOMMENDED

Partitioning the HD or How to dual-boot Fedora A Perfect Linux or BSD


not? 14 and Windows 7 desktop distribution
Swap does not mount How to delete DigiNotar Free software without
[swapon failed: Device or CA certificate... the freedom?
resource busy] Mandriva Desktop 2011 Guide to disks and disk
I want to make dualboot review partitions in Linux
between ubuntu11.4 and How to dual-boot In search of the perfect
windows7, when Windows 7 and Ubuntu... Linux and BSD desktop
ubuntu11.4 is already Ubuntu 10.10 review distribution
installed in my desktop, Linux Mint 8 vs Ubuntu Linux Logical Volume
but how please answre 9.10 Manager
question with GRUB PCLinuxOS 2010 review The Benefits of Using
bootloader in Fedora-16 Manual disk partitioning Linux Logical Volume
alpha guide for... Manager
Post-installation Install Ubuntu 11.04 on The best Linux, BSD
disk/Partition external hard... firewall and router
management (LVM) – PCLinuxOS 2009.1 distributions
Debian 6/Win 7 dual boot. Review The Free Software
What is “bios boot” in Definition
Fedora 16
Recommended disk
space for Swap
does linux mint xfce
201108 installer is simlar
like linux mint xfce
201104?
What To Do If Your
Mobile Phone Is Lost Or
Stolen
What HP Should Do With
WebOS?

Copyright © 2011 — LinuxBSDos.com. All Rights Reserved.

IDGTech Netw ork Logo MORE IN RECOMMENDED READING, TUTORIALS/TIPS


ARTICLES)

How to delete DigiNotar CA certificate from F

Anda mungkin juga menyukai