246 lines
4.6 KiB
HTML
246 lines
4.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Partition Naming in Linux</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="Partitions-Mass-Storage-Definitions-Naming-HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Drive Naming in Linux"
|
|
HREF="x99.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Device Major and Minor Numbers"
|
|
HREF="x183.html"></HEAD
|
|
><BODY
|
|
CLASS="section"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>Partitions-Mass-Storage-Definitions-Naming-HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x99.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x183.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H1
|
|
CLASS="section"
|
|
><A
|
|
NAME="AEN160"
|
|
></A
|
|
>6. Partition Naming in Linux</H1
|
|
><DIV
|
|
CLASS="section"
|
|
><H2
|
|
CLASS="section"
|
|
><A
|
|
NAME="AEN162"
|
|
></A
|
|
>6.1. Numbers</H2
|
|
><P
|
|
>Partition naming is thanksfully simpler than drive one.
|
|
Partitions are simply given a number from 0 up (decimal).
|
|
Sometime a "p" is appended on front of the number:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
> cat /proc/partitions
|
|
major minor #blocks name
|
|
|
|
8 0 488386584 sda
|
|
8 1 52436128 sda1
|
|
8 2 1 sda2
|
|
8 5 2104483 sda5
|
|
8 6 20972826 sda6
|
|
8 7 52436128 sda7
|
|
8 8 360434308 sda8
|
|
179 0 3979776 mmcblk0
|
|
179 1 3975680 mmcblk0p1
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>As you see, partition devices are listed in
|
|
/proc/partition. This file... is not a real file but is
|
|
created on the fly. Don't worry, for what we need it's a
|
|
file.</P
|
|
><P
|
|
>Notice the "p1" partition name for the SDHC
|
|
card.</P
|
|
><P
|
|
>Max number of partitions is 15 for SCSI and all the
|
|
drives using the new SATA driver, 63 for IDE drives (0 is the
|
|
full drive, 0 to 15 is four bits 0 to 64, 6 bits)</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H2
|
|
CLASS="section"
|
|
><A
|
|
NAME="AEN169"
|
|
></A
|
|
>6.2. Meaning of the Numbers</H2
|
|
><P
|
|
>Not all the numbers have the same meaning. This mess
|
|
come from the PC history. One can divide floppies with
|
|
partitions, but then 4 ones seems sufficient. But then come
|
|
Hard drives :-). So the partitons numbers 1, 2, 3 and 4 are
|
|
<EM
|
|
>primary</EM
|
|
>partitions. One drive can only
|
|
have 4 primaries.</P
|
|
><P
|
|
>To go further, we have to use one of these primary as a
|
|
big one and sub-partition this one, so to have
|
|
<EM
|
|
>logical</EM
|
|
>partitions. The big
|
|
<EM
|
|
>extended</EM
|
|
>partition can be any of the
|
|
4.</P
|
|
><P
|
|
>So, remember, the primary partitions are inside the
|
|
drive and the logical partitions are inside one of the
|
|
primary, called the
|
|
<EM
|
|
>extended</EM
|
|
>partition.</P
|
|
><P
|
|
>Once the logical partitions are created, it's no more
|
|
recommended to write directly to the extended one. Writing to
|
|
an extended partition would erase the logical ones like
|
|
writing directly to a hard drive erase the partitons. Beware,
|
|
|
|
<STRONG
|
|
>it's possible</STRONG
|
|
>!!</P
|
|
><P
|
|
>If, after creating 4 primary partitions, all the disk
|
|
space is not used, the remaining space is lost (unusable), so
|
|
most of the time, create the desired primaries, then at last
|
|
the extended one with all the remaining room.</P
|
|
><P
|
|
>It's not necessary to create 4 primaries. You could use
|
|
only one extended (Linux only), but there are some advantages
|
|
of using primaries.</P
|
|
><P
|
|
>Primaries being 4, the first logical partition is
|
|
always 5. So any partition with number of five and up is a
|
|
logical one.</P
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x99.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x183.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Drive Naming in Linux</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Device Major and Minor Numbers</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |