Anda di halaman 1dari 2

PRIMARY, EXTENDED and LOGICAL PARTITIONS

There is always a lot of confusion about partitions and partition numbers. So


let us try to shed some light:

On an IDE drive, the first drive is called hda, and the partitions are shown as
hda1, hda2 . . . . etc. etc. Your second drive is called hdb.

On a SCSI drive, the first drive is called sda, the partitions are sda1, sda2 . .
The second drive is called sdb.

Now that was relatively simple, but now comes the more complicated part, I
took parts of this from a post of Jason Wallwork ( Linuxdude32 ) because he
was able to explain it better then I can:

QUOTE (Jason @ Forum 2004)


An extended partition is the only kind of partition that can have multiple
partitions inside. Think of it like a box that contains other boxes, the logical
partitions. The extended partition can't store anything, it's just a holder for logical
partitions.
The extended partitions is a way to get around the fact you can only have four
primary partitions on a drive. You can put lots of logical partitions inside it.

hda is the whole drive


hda1 is a primary partition
hda2 is a primary partition
hda4 is an extended partition
hda5 is an logical partition
hda6 is an logical partition

You will never see hda4 mounted, just hda5 and hda6, in this case. Note that
Linux numbers primary partitions 1-4, logical partitions start at 5 and up, even if
there are less than 4 primary partitions.

NOTE: On an IDE drive you can have up to 63 partitions, 3 primary and 60


logical ( contained in one extended partition )
On a SCSI drive the maximum number of partitions is 15

So, in a nutshell: if you start out with one HD that has windows C: and D:
You will see them in Linux as hda1 and hda2 . . . then as you add a distro
and let it automatically use the free space on that drive ( if that distro has
that option like Mandrake ) it will make an extended partition and set up a
partition for / and a partition for /swap plus a /home partition and call them
hda5, hda6 and hda7 ( in that order ). You will see that if you make the
partitions yourself, using preferably a Linux tool to make the partitions, the
result will be more or less the same, only in that case you will be able to
make even more partitions . . . for extra storage, backups, or additional
distros.
You will only need one swap partition as that can be shared by the various
distros.

About mount and umount


The mount command mounts a storage device or filesystem,
making it accessible and attaching it to an
existing directory structure.
The umount command "unmounts" a mounted filesystem,
informing the system to complete any
pending read or write operations, and safely detaching it.

mount -t type device dir

This tells the kernel to attach the filesystem found on device (which
is of type type) at the directory dir.

it means set user ID on executing.

The general attributes are: set user id on executing (setuid), set group id on executing (setgid), and the
sticky bit. These attributes can be set with the command chmod using either method :

chmod u+s - set the setuid bit.


chmod g+s - set the setgid bit.
chmod u+t - set the sticky bit or directories

or numerically:

chmod 4777 - setuid and read/write/execute for everyone.


chmod 2777 - setgid and read/write/execute for everyone.
chmod 1777 - set sticky bit and read/write/passthrough on a directory.

Anda mungkin juga menyukai