Loading ...
Sorry, an error occurred while loading the content.

Re: Informational: Hard drives, partitions and Linux

Expand Messages
  • Stephen Sankarsingh
    No errors that I can find and all very interesting. May be able to copy and paste it wholesale unto our wiki when it s installed and then expand it to include
    Message 1 of 10 , Apr 30, 2008
    • 0 Attachment
      No errors that I can find and all very interesting. May be able to
      copy and paste it wholesale unto our wiki when it's installed and then
      expand it to include LVMs.

      /Stephen

      --- In TTLUG@yahoogroups.com, "Richard Bailey" <rmjb@...> wrote:
      >
      > Partition Magic had a tool PTEdit that allowed you to manually edit a
      > partition table. All it brought up was a table of numbers and you could
      > change them as you saw fit.
      >
      > On Wed, Apr 30, 2008 at 10:44 AM, Hassan Voyeau <hassan.voyeau@...>
      > wrote:
      >
      > > How did you go about manually changing the partition table?
      > >
      > > On Wed, Apr 30, 2008 at 10:33 AM, Nissan Dookeran <
      > > nissan.dookeran@... <nissan.dookeran%40gmail.com>>
      > > wrote:
      > >
      > >
      > > > Great stuff Richard...would you mind it being posted to the Wiki for
      > > > content?
      > > > -Nissan
      > > >
      > > > On Wed, Apr 30, 2008 at 10:17 AM, Richard Bailey
      <rmjb@...<rmjb%40mail.com>
      > > <rmjb%40mail.com>>
      > >
      > > > wrote:
      > > > >
      > > > >
      > > > >
      > > > >
      > > > >
      > > > >
      > > > > Just thought I'd share a little about hard drives, partitions and
      > > Linux,
      > > > if
      > > > > this generates a discussion that would be great. If not at least I
      > > hope
      > > > it
      > > > > will help some.
      > > > >
      > > > > * IDE drives, device naming and SCSI drives
      > > > >
      > > > > Traditionally, hard drives in a typical PC were IDE based.
      These would
      > > > > usually be in two channels, Primary and Secondary, with each
      channel
      > > > > capable
      > > > > of having two drives, Master and Slave. This gives a total of
      4 drives
      > > > that
      > > > > can exist. These devices show up as /dev/hda, /dev/hdb,
      /dev/hdc and
      > > > > /dev/hdd in Linux with Primary Master first, then Primary
      Slave, then
      > > > > Secondary Master then Secondary Slave. It's worth noting that
      if you
      > > > only
      > > > > have one drive on the Primary and two on the Secondary then your
      > > devices
      > > > > would be hda, hdc and hdd; any missing devices are left out.
      > > > >
      > > > > SCSI drives are a little trickier with respect to device naming.
      > > > Firstly,
      > > > > SCSI devices are named /dev/sda, /dev/sdb, /dev/sdc and so on.
      > > However,
      > > > > SCSI
      > > > > has no concept or Master or Slave. SCSI does have the concept of
      > > > > enumeration
      > > > > however, and a device with a lower number (i.e. device 1
      instead of
      > > > device
      > > > > 7) would get the first SCSI device name and so on. This typically
      > > means
      > > > > that
      > > > > there are usually no gaps in SCSI device names as there can be
      in IDE
      > > > > device
      > > > > names.
      > > > >
      > > > > Serial ATA drives and USB drives show up as SCSI devices under
      Linux
      > > and
      > > > > undergo the same naming scheme. Also, a CD-ROM or DVD-ROM
      device is
      > > > still a
      > > > > drive and still gets a name like all the others.
      > > > >
      > > > > * Partitions, limitations and extended partitions
      > > > >
      > > > > In a typical PC the de facto partition table format is the MS DOS
      > > > partition
      > > > > table, even on Linux. There are other partition table formats out
      > > there,
      > > > > but
      > > > > they are not common on PCs. The MS DOS partition table is limited
      > > > however
      > > > > to
      > > > > only four entries. That is right, there can be only four
      partitions in
      > > a
      > > > > partition table.
      > > > >
      > > > > A partition table entry will list the starting block, the
      ending block
      > > > or
      > > > > the length (I can't remember which one) and the partition
      type. These
      > > > three
      > > > > entries are all that is required for the drive to keep track
      of its
      > > > > partitions. These partitions are called Primary Partitions.
      > > > >
      > > > > Partitions are accessed under Linux by simply tacking on a
      number from
      > > 1
      > > > to
      > > > > 4 to the end of the device name, for example /dev/hda1, /dev/sdb2,
      > > etc.
      > > > > Therefore, when you want to repartition a disk you run fdisk
      against
      > > the
      > > > > drive, not the partition, i.e. you run 'fdisk /dev/sda' not 'fdisk
      > > > > /dev/sda1'.
      > > > >
      > > > > You may be wondering how you can add seemingly unlimited
      partitions to
      > > a
      > > > > drive if there is a 4 partition limitation. One of the Primary
      > > > Partitions
      > > > > is
      > > > > allowed to be an Extended Partition. This can be any one, not
      only the
      > > > last
      > > > > one. An Extended Partition can then contain any number of Logical
      > > > Drives.
      > > > >
      > > > > * Logical Drives
      > > > >
      > > > > In an Extended Partition there can be any number of Logical
      Drives. In
      > > > > Linux
      > > > > these drives start numbering from 5 upward. It does not matter if
      > > there
      > > > are
      > > > > less than 4 partitions on the drive, logical drives always
      start at 5,
      > > > i.e.
      > > > > /dev/sda5, /dev/sda6, etc. The information about the logical
      drives is
      > > > not
      > > > > stored in the partition table but rather in the extended
      partition,
      > > this
      > > > > means that there is no limitation on the number of logical
      drives that
      > > > can
      > > > > exist.
      > > > >
      > > > > Remember that a drive must have an extended partition before
      you can
      > > > create
      > > > > logical drives.
      > > > >
      > > > > * Partition Types
      > > > >
      > > > > The partition type tells the operating system what is the type of
      > > > > information in the partition. It is a two character code and has a
      > > > specific
      > > > > meaning. For example 0b or 0c is a FAT32 partition (the
      traditional
      > > > > DOS/Windows filesystem), 83 is a Linux partition which can be
      > > formatted
      > > > > into many filesystems that Linux supports and 83 is a Linux swap
      > > > partition.
      > > > > Each partition and logical drive will have a partition type.
      Windows
      > > > > typically ignores all partitions/logical drives that are not a
      > > partition
      > > > > type it recognises.
      > > > >
      > > > > * Other partition table formats
      > > > >
      > > > > There are other partition table formats in existence. The most
      common
      > > in
      > > > > PCs
      > > > > is the MS DOS format but PCs can use other formats. Due to the
      rigid
      > > > > structure of the partition table a MS DOS table cannot represent
      > > > partitions
      > > > > on very large disks (a few terabytes), the numbers that are
      stored in
      > > > the
      > > > > table can't go up that high. One other format that is catching
      on is
      > > GPT
      > > > > (GUID Partition Table) which is a modern format that has
      worked around
      > > > > these
      > > > > limitations. I believe that Intel Macs use this format
      exclusively.
      > > > Linux
      > > > > and later versions of Windows can also use this format.
      > > > >
      > > > > * How do I know this
      > > > >
      > > > > I gathered this knowledge from reading, poking around my own
      systems
      > > and
      > > > > getting into trouble and having to get myself out. One time I
      > > > accidentally
      > > > > deleted all but one of my partitions and spent the whole night
      reading
      > > a
      > > > > learning about how partition tables are stored on disk and
      then by 4
      > > am
      > > > I
      > > > > tried my hand at manually entering the numbers in the
      partition table
      > > > and
      > > > > all my drives came back with all the data in tact. It was all very
      > > > > harrowing
      > > > > and very interesting.
      > > > >
      > > > > ---
      > > > >
      > > > > I hope this information was interesting/useful to some. If
      I've made
      > > any
      > > > > errors feel free to point it out on list so everyone will be
      > > corrected.
      > > > >
      > > > > - RB
      > > > >
      > > > > --
      > > > > Reporter: What is your opinion on the obesity problem?
      > > > > King: I prefer it to the famine problem
      > > > > - Wizard of ID
      > > > >
      > > > > [Non-text portions of this message have been removed]
      > > > >
      > > > >
      > > >
      > >
      > > [Non-text portions of this message have been removed]
      > >
      > >
      > >
      >
      >
      >
      > --
      > Reporter: What is your opinion on the obesity problem?
      > King: I prefer it to the famine problem
      > - Wizard of ID
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • cancer76tt
      It may be more accurate to state that the partition table is not really the MS-DOS partition table, it is based on the MBR (Master Boot Record) of a hard
      Message 2 of 10 , May 1, 2008
      • 0 Attachment
        It may be more accurate to state that the partition table is not
        really the MS-DOS partition table, it is based on the MBR (Master Boot
        Record) of a hard drive.

        --- In TTLUG@yahoogroups.com, "Richard Bailey" <rmjb@...> wrote:
        >
        > Posted, link here:
        >
        http://ttlug.pbwiki.com/Informational%3AHard%20drives%2C%20partitions%20and%20Linux
        >
        > Is the wiki crawled by google?
        >
        > On Wed, Apr 30, 2008 at 10:33 AM, Nissan Dookeran <nissan.dookeran@...>
        > wrote:
        >
        > > Great stuff Richard...would you mind it being posted to the Wiki for
        > > content?
        > > -Nissan
        > >
        > >
        > > On Wed, Apr 30, 2008 at 10:17 AM, Richard Bailey
        <rmjb@...<rmjb%40mail.com>>
        > > wrote:
        > > >
        > > >
        > > >
        > > >
        > > >
        > > >
        > > > Just thought I'd share a little about hard drives, partitions
        and Linux,
        > > if
        > > > this generates a discussion that would be great. If not at least
        I hope
        > > it
        > > > will help some.
        > > >
        > > > * IDE drives, device naming and SCSI drives
        > > >
        > > > Traditionally, hard drives in a typical PC were IDE based. These
        would
        > > > usually be in two channels, Primary and Secondary, with each channel
        > > > capable
        > > > of having two drives, Master and Slave. This gives a total of 4
        drives
        > > that
        > > > can exist. These devices show up as /dev/hda, /dev/hdb, /dev/hdc and
        > > > /dev/hdd in Linux with Primary Master first, then Primary Slave,
        then
        > > > Secondary Master then Secondary Slave. It's worth noting that if you
        > > only
        > > > have one drive on the Primary and two on the Secondary then your
        devices
        > > > would be hda, hdc and hdd; any missing devices are left out.
        > > >
        > > > SCSI drives are a little trickier with respect to device naming.
        > > Firstly,
        > > > SCSI devices are named /dev/sda, /dev/sdb, /dev/sdc and so on.
        However,
        > > > SCSI
        > > > has no concept or Master or Slave. SCSI does have the concept of
        > > > enumeration
        > > > however, and a device with a lower number (i.e. device 1 instead of
        > > device
        > > > 7) would get the first SCSI device name and so on. This
        typically means
        > > > that
        > > > there are usually no gaps in SCSI device names as there can be
        in IDE
        > > > device
        > > > names.
        > > >
        > > > Serial ATA drives and USB drives show up as SCSI devices under
        Linux and
        > > > undergo the same naming scheme. Also, a CD-ROM or DVD-ROM device is
        > > still a
        > > > drive and still gets a name like all the others.
        > > >
        > > > * Partitions, limitations and extended partitions
        > > >
        > > > In a typical PC the de facto partition table format is the MS DOS
        > > partition
        > > > table, even on Linux. There are other partition table formats
        out there,
        > > > but
        > > > they are not common on PCs. The MS DOS partition table is limited
        > > however
        > > > to
        > > > only four entries. That is right, there can be only four
        partitions in a
        > > > partition table.
        > > >
        > > > A partition table entry will list the starting block, the ending
        block
        > > or
        > > > the length (I can't remember which one) and the partition type.
        These
        > > three
        > > > entries are all that is required for the drive to keep track of its
        > > > partitions. These partitions are called Primary Partitions.
        > > >
        > > > Partitions are accessed under Linux by simply tacking on a
        number from 1
        > > to
        > > > 4 to the end of the device name, for example /dev/hda1,
        /dev/sdb2, etc.
        > > > Therefore, when you want to repartition a disk you run fdisk
        against the
        > > > drive, not the partition, i.e. you run 'fdisk /dev/sda' not 'fdisk
        > > > /dev/sda1'.
        > > >
        > > > You may be wondering how you can add seemingly unlimited
        partitions to a
        > > > drive if there is a 4 partition limitation. One of the Primary
        > > Partitions
        > > > is
        > > > allowed to be an Extended Partition. This can be any one, not
        only the
        > > last
        > > > one. An Extended Partition can then contain any number of Logical
        > > Drives.
        > > >
        > > > * Logical Drives
        > > >
        > > > In an Extended Partition there can be any number of Logical
        Drives. In
        > > > Linux
        > > > these drives start numbering from 5 upward. It does not matter
        if there
        > > are
        > > > less than 4 partitions on the drive, logical drives always start
        at 5,
        > > i.e.
        > > > /dev/sda5, /dev/sda6, etc. The information about the logical
        drives is
        > > not
        > > > stored in the partition table but rather in the extended
        partition, this
        > > > means that there is no limitation on the number of logical
        drives that
        > > can
        > > > exist.
        > > >
        > > > Remember that a drive must have an extended partition before you can
        > > create
        > > > logical drives.
        > > >
        > > > * Partition Types
        > > >
        > > > The partition type tells the operating system what is the type of
        > > > information in the partition. It is a two character code and has a
        > > specific
        > > > meaning. For example 0b or 0c is a FAT32 partition (the traditional
        > > > DOS/Windows filesystem), 83 is a Linux partition which can be
        formatted
        > > > into many filesystems that Linux supports and 83 is a Linux swap
        > > partition.
        > > > Each partition and logical drive will have a partition type. Windows
        > > > typically ignores all partitions/logical drives that are not a
        partition
        > > > type it recognises.
        > > >
        > > > * Other partition table formats
        > > >
        > > > There are other partition table formats in existence. The most
        common in
        > > > PCs
        > > > is the MS DOS format but PCs can use other formats. Due to the rigid
        > > > structure of the partition table a MS DOS table cannot represent
        > > partitions
        > > > on very large disks (a few terabytes), the numbers that are
        stored in
        > > the
        > > > table can't go up that high. One other format that is catching
        on is GPT
        > > > (GUID Partition Table) which is a modern format that has worked
        around
        > > > these
        > > > limitations. I believe that Intel Macs use this format exclusively.
        > > Linux
        > > > and later versions of Windows can also use this format.
        > > >
        > > > * How do I know this
        > > >
        > > > I gathered this knowledge from reading, poking around my own
        systems and
        > > > getting into trouble and having to get myself out. One time I
        > > accidentally
        > > > deleted all but one of my partitions and spent the whole night
        reading a
        > > > learning about how partition tables are stored on disk and then
        by 4 am
        > > I
        > > > tried my hand at manually entering the numbers in the partition
        table
        > > and
        > > > all my drives came back with all the data in tact. It was all very
        > > > harrowing
        > > > and very interesting.
        > > >
        > > > ---
        > > >
        > > > I hope this information was interesting/useful to some. If I've
        made any
        > > > errors feel free to point it out on list so everyone will be
        corrected.
        > > >
        > > > - RB
        > > >
        > > > --
        > > > Reporter: What is your opinion on the obesity problem?
        > > > King: I prefer it to the famine problem
        > > > - Wizard of ID
        > > >
        > > > [Non-text portions of this message have been removed]
        > > >
        > > >
        > >
        > > --
        > > Nissan Dookeran
        > > http://redditech.blogspot.com
        > > ----
        > > "The manager administers; the leader innovates."
        > > "The manager is a copy; the leader is an original."
        > > "The manager does things right; the leader does the right thing."
        > > Warren Bennis - On Becoming a Leader
        > >
        > >
        >
        >
        >
        > --
        > Reporter: What is your opinion on the obesity problem?
        > King: I prefer it to the famine problem
        > - Wizard of ID
        >
        >
        > [Non-text portions of this message have been removed]
        >
      • Richard Bailey
        That is very true. I guess I thought of it as MS DOS because I think that s how fdisk in Linux calls it. ... -- Reporter: What is your opinion on the obesity
        Message 3 of 10 , May 3, 2008
        • 0 Attachment
          That is very true. I guess I thought of it as MS DOS because I think that's
          how fdisk in Linux calls it.

          On Thu, May 1, 2008 at 11:25 AM, cancer76tt <cancer76tt@...> wrote:

          > It may be more accurate to state that the partition table is not
          > really the MS-DOS partition table, it is based on the MBR (Master Boot
          > Record) of a hard drive.
          >
          >
          > --- In TTLUG@yahoogroups.com <TTLUG%40yahoogroups.com>, "Richard Bailey"
          > <rmjb@...> wrote:
          > >
          > > Posted, link here:
          > >
          >
          > http://ttlug.pbwiki.com/Informational%3AHard%20drives%2C%20partitions%20and%20Linux
          > >
          > > Is the wiki crawled by google?
          > >
          > > On Wed, Apr 30, 2008 at 10:33 AM, Nissan Dookeran <nissan.dookeran@...>
          > > wrote:
          > >
          > > > Great stuff Richard...would you mind it being posted to the Wiki for
          > > > content?
          > > > -Nissan
          > > >
          > > >
          > > > On Wed, Apr 30, 2008 at 10:17 AM, Richard Bailey
          > <rmjb@...<rmjb%40mail.com>>
          >
          > > > wrote:
          > > > >
          > > > >
          > > > >
          > > > >
          > > > >
          > > > >
          > > > > Just thought I'd share a little about hard drives, partitions
          > and Linux,
          > > > if
          > > > > this generates a discussion that would be great. If not at least
          > I hope
          > > > it
          > > > > will help some.
          > > > >
          > > > > * IDE drives, device naming and SCSI drives
          > > > >
          > > > > Traditionally, hard drives in a typical PC were IDE based. These
          > would
          > > > > usually be in two channels, Primary and Secondary, with each channel
          > > > > capable
          > > > > of having two drives, Master and Slave. This gives a total of 4
          > drives
          > > > that
          > > > > can exist. These devices show up as /dev/hda, /dev/hdb, /dev/hdc and
          > > > > /dev/hdd in Linux with Primary Master first, then Primary Slave,
          > then
          > > > > Secondary Master then Secondary Slave. It's worth noting that if you
          > > > only
          > > > > have one drive on the Primary and two on the Secondary then your
          > devices
          > > > > would be hda, hdc and hdd; any missing devices are left out.
          > > > >
          > > > > SCSI drives are a little trickier with respect to device naming.
          > > > Firstly,
          > > > > SCSI devices are named /dev/sda, /dev/sdb, /dev/sdc and so on.
          > However,
          > > > > SCSI
          > > > > has no concept or Master or Slave. SCSI does have the concept of
          > > > > enumeration
          > > > > however, and a device with a lower number (i.e. device 1 instead of
          > > > device
          > > > > 7) would get the first SCSI device name and so on. This
          > typically means
          > > > > that
          > > > > there are usually no gaps in SCSI device names as there can be
          > in IDE
          > > > > device
          > > > > names.
          > > > >
          > > > > Serial ATA drives and USB drives show up as SCSI devices under
          > Linux and
          > > > > undergo the same naming scheme. Also, a CD-ROM or DVD-ROM device is
          > > > still a
          > > > > drive and still gets a name like all the others.
          > > > >
          > > > > * Partitions, limitations and extended partitions
          > > > >
          > > > > In a typical PC the de facto partition table format is the MS DOS
          > > > partition
          > > > > table, even on Linux. There are other partition table formats
          > out there,
          > > > > but
          > > > > they are not common on PCs. The MS DOS partition table is limited
          > > > however
          > > > > to
          > > > > only four entries. That is right, there can be only four
          > partitions in a
          > > > > partition table.
          > > > >
          > > > > A partition table entry will list the starting block, the ending
          > block
          > > > or
          > > > > the length (I can't remember which one) and the partition type.
          > These
          > > > three
          > > > > entries are all that is required for the drive to keep track of its
          > > > > partitions. These partitions are called Primary Partitions.
          > > > >
          > > > > Partitions are accessed under Linux by simply tacking on a
          > number from 1
          > > > to
          > > > > 4 to the end of the device name, for example /dev/hda1,
          > /dev/sdb2, etc.
          > > > > Therefore, when you want to repartition a disk you run fdisk
          > against the
          > > > > drive, not the partition, i.e. you run 'fdisk /dev/sda' not 'fdisk
          > > > > /dev/sda1'.
          > > > >
          > > > > You may be wondering how you can add seemingly unlimited
          > partitions to a
          > > > > drive if there is a 4 partition limitation. One of the Primary
          > > > Partitions
          > > > > is
          > > > > allowed to be an Extended Partition. This can be any one, not
          > only the
          > > > last
          > > > > one. An Extended Partition can then contain any number of Logical
          > > > Drives.
          > > > >
          > > > > * Logical Drives
          > > > >
          > > > > In an Extended Partition there can be any number of Logical
          > Drives. In
          > > > > Linux
          > > > > these drives start numbering from 5 upward. It does not matter
          > if there
          > > > are
          > > > > less than 4 partitions on the drive, logical drives always start
          > at 5,
          > > > i.e.
          > > > > /dev/sda5, /dev/sda6, etc. The information about the logical
          > drives is
          > > > not
          > > > > stored in the partition table but rather in the extended
          > partition, this
          > > > > means that there is no limitation on the number of logical
          > drives that
          > > > can
          > > > > exist.
          > > > >
          > > > > Remember that a drive must have an extended partition before you can
          > > > create
          > > > > logical drives.
          > > > >
          > > > > * Partition Types
          > > > >
          > > > > The partition type tells the operating system what is the type of
          > > > > information in the partition. It is a two character code and has a
          > > > specific
          > > > > meaning. For example 0b or 0c is a FAT32 partition (the traditional
          > > > > DOS/Windows filesystem), 83 is a Linux partition which can be
          > formatted
          > > > > into many filesystems that Linux supports and 83 is a Linux swap
          > > > partition.
          > > > > Each partition and logical drive will have a partition type. Windows
          > > > > typically ignores all partitions/logical drives that are not a
          > partition
          > > > > type it recognises.
          > > > >
          > > > > * Other partition table formats
          > > > >
          > > > > There are other partition table formats in existence. The most
          > common in
          > > > > PCs
          > > > > is the MS DOS format but PCs can use other formats. Due to the rigid
          > > > > structure of the partition table a MS DOS table cannot represent
          > > > partitions
          > > > > on very large disks (a few terabytes), the numbers that are
          > stored in
          > > > the
          > > > > table can't go up that high. One other format that is catching
          > on is GPT
          > > > > (GUID Partition Table) which is a modern format that has worked
          > around
          > > > > these
          > > > > limitations. I believe that Intel Macs use this format exclusively.
          > > > Linux
          > > > > and later versions of Windows can also use this format.
          > > > >
          > > > > * How do I know this
          > > > >
          > > > > I gathered this knowledge from reading, poking around my own
          > systems and
          > > > > getting into trouble and having to get myself out. One time I
          > > > accidentally
          > > > > deleted all but one of my partitions and spent the whole night
          > reading a
          > > > > learning about how partition tables are stored on disk and then
          > by 4 am
          > > > I
          > > > > tried my hand at manually entering the numbers in the partition
          > table
          > > > and
          > > > > all my drives came back with all the data in tact. It was all very
          > > > > harrowing
          > > > > and very interesting.
          > > > >
          > > > > ---
          > > > >
          > > > > I hope this information was interesting/useful to some. If I've
          > made any
          > > > > errors feel free to point it out on list so everyone will be
          > corrected.
          > > > >
          > > > > - RB
          > > > >
          > > > > --
          > > > > Reporter: What is your opinion on the obesity problem?
          > > > > King: I prefer it to the famine problem
          > > > > - Wizard of ID
          > > > >
          > > > > [Non-text portions of this message have been removed]
          > > > >
          > > > >
          > > >
          > > > --
          > > > Nissan Dookeran
          > > > http://redditech.blogspot.com
          > > > ----
          > > > "The manager administers; the leader innovates."
          > > > "The manager is a copy; the leader is an original."
          > > > "The manager does things right; the leader does the right thing."
          > > > Warren Bennis - On Becoming a Leader
          > > >
          > > >
          > >
          > >
          > >
          > > --
          > > Reporter: What is your opinion on the obesity problem?
          > > King: I prefer it to the famine problem
          > > - Wizard of ID
          > >
          > >
          > > [Non-text portions of this message have been removed]
          > >
          >
          >
          >



          --
          Reporter: What is your opinion on the obesity problem?
          King: I prefer it to the famine problem
          - Wizard of ID


          [Non-text portions of this message have been removed]
        • cancer76tt
          Great article tho, I didn t know the order scheme for Linux IDE drives worked like that... ... think that s ... Boot ... Bailey ... 20partitions%20and%20Linux
          Message 4 of 10 , May 4, 2008
          • 0 Attachment
            Great article tho, I didn't know the order scheme for Linux IDE
            drives worked like that...

            --- In TTLUG@yahoogroups.com, "Richard Bailey" <rmjb@...> wrote:
            >
            > That is very true. I guess I thought of it as MS DOS because I
            think that's
            > how fdisk in Linux calls it.
            >
            > On Thu, May 1, 2008 at 11:25 AM, cancer76tt <cancer76tt@...> wrote:
            >
            > > It may be more accurate to state that the partition table is not
            > > really the MS-DOS partition table, it is based on the MBR (Master
            Boot
            > > Record) of a hard drive.
            > >
            > >
            > > --- In TTLUG@yahoogroups.com <TTLUG%40yahoogroups.com>, "Richard
            Bailey"
            > > <rmjb@> wrote:
            > > >
            > > > Posted, link here:
            > > >
            > >
            > > http://ttlug.pbwiki.com/Informational%3AHard%20drives%2C%
            20partitions%20and%20Linux
            > > >
            > > > Is the wiki crawled by google?
            > > >
            > > > On Wed, Apr 30, 2008 at 10:33 AM, Nissan Dookeran
            <nissan.dookeran@>
            > > > wrote:
            > > >
            > > > > Great stuff Richard...would you mind it being posted to the
            Wiki for
            > > > > content?
            > > > > -Nissan
            > > > >
            > > > >
            > > > > On Wed, Apr 30, 2008 at 10:17 AM, Richard Bailey
            > > <rmjb@<rmjb%40mail.com>>
            > >
            > > > > wrote:
            > > > > >
            > > > > >
            > > > > >
            > > > > >
            > > > > >
            > > > > >
            > > > > > Just thought I'd share a little about hard drives,
            partitions
            > > and Linux,
            > > > > if
            > > > > > this generates a discussion that would be great. If not at
            least
            > > I hope
            > > > > it
            > > > > > will help some.
            > > > > >
            > > > > > * IDE drives, device naming and SCSI drives
            > > > > >
            > > > > > Traditionally, hard drives in a typical PC were IDE based.
            These
            > > would
            > > > > > usually be in two channels, Primary and Secondary, with
            each channel
            > > > > > capable
            > > > > > of having two drives, Master and Slave. This gives a total
            of 4
            > > drives
            > > > > that
            > > > > > can exist. These devices show up
            as /dev/hda, /dev/hdb, /dev/hdc and
            > > > > > /dev/hdd in Linux with Primary Master first, then Primary
            Slave,
            > > then
            > > > > > Secondary Master then Secondary Slave. It's worth noting
            that if you
            > > > > only
            > > > > > have one drive on the Primary and two on the Secondary then
            your
            > > devices
            > > > > > would be hda, hdc and hdd; any missing devices are left out.
            > > > > >
            > > > > > SCSI drives are a little trickier with respect to device
            naming.
            > > > > Firstly,
            > > > > > SCSI devices are named /dev/sda, /dev/sdb, /dev/sdc and so
            on.
            > > However,
            > > > > > SCSI
            > > > > > has no concept or Master or Slave. SCSI does have the
            concept of
            > > > > > enumeration
            > > > > > however, and a device with a lower number (i.e. device 1
            instead of
            > > > > device
            > > > > > 7) would get the first SCSI device name and so on. This
            > > typically means
            > > > > > that
            > > > > > there are usually no gaps in SCSI device names as there can
            be
            > > in IDE
            > > > > > device
            > > > > > names.
            > > > > >
            > > > > > Serial ATA drives and USB drives show up as SCSI devices
            under
            > > Linux and
            > > > > > undergo the same naming scheme. Also, a CD-ROM or DVD-ROM
            device is
            > > > > still a
            > > > > > drive and still gets a name like all the others.
            > > > > >
            > > > > > * Partitions, limitations and extended partitions
            > > > > >
            > > > > > In a typical PC the de facto partition table format is the
            MS DOS
            > > > > partition
            > > > > > table, even on Linux. There are other partition table
            formats
            > > out there,
            > > > > > but
            > > > > > they are not common on PCs. The MS DOS partition table is
            limited
            > > > > however
            > > > > > to
            > > > > > only four entries. That is right, there can be only four
            > > partitions in a
            > > > > > partition table.
            > > > > >
            > > > > > A partition table entry will list the starting block, the
            ending
            > > block
            > > > > or
            > > > > > the length (I can't remember which one) and the partition
            type.
            > > These
            > > > > three
            > > > > > entries are all that is required for the drive to keep
            track of its
            > > > > > partitions. These partitions are called Primary Partitions.
            > > > > >
            > > > > > Partitions are accessed under Linux by simply tacking on a
            > > number from 1
            > > > > to
            > > > > > 4 to the end of the device name, for example /dev/hda1,
            > > /dev/sdb2, etc.
            > > > > > Therefore, when you want to repartition a disk you run fdisk
            > > against the
            > > > > > drive, not the partition, i.e. you run 'fdisk /dev/sda'
            not 'fdisk
            > > > > > /dev/sda1'.
            > > > > >
            > > > > > You may be wondering how you can add seemingly unlimited
            > > partitions to a
            > > > > > drive if there is a 4 partition limitation. One of the
            Primary
            > > > > Partitions
            > > > > > is
            > > > > > allowed to be an Extended Partition. This can be any one,
            not
            > > only the
            > > > > last
            > > > > > one. An Extended Partition can then contain any number of
            Logical
            > > > > Drives.
            > > > > >
            > > > > > * Logical Drives
            > > > > >
            > > > > > In an Extended Partition there can be any number of Logical
            > > Drives. In
            > > > > > Linux
            > > > > > these drives start numbering from 5 upward. It does not
            matter
            > > if there
            > > > > are
            > > > > > less than 4 partitions on the drive, logical drives always
            start
            > > at 5,
            > > > > i.e.
            > > > > > /dev/sda5, /dev/sda6, etc. The information about the logical
            > > drives is
            > > > > not
            > > > > > stored in the partition table but rather in the extended
            > > partition, this
            > > > > > means that there is no limitation on the number of logical
            > > drives that
            > > > > can
            > > > > > exist.
            > > > > >
            > > > > > Remember that a drive must have an extended partition
            before you can
            > > > > create
            > > > > > logical drives.
            > > > > >
            > > > > > * Partition Types
            > > > > >
            > > > > > The partition type tells the operating system what is the
            type of
            > > > > > information in the partition. It is a two character code
            and has a
            > > > > specific
            > > > > > meaning. For example 0b or 0c is a FAT32 partition (the
            traditional
            > > > > > DOS/Windows filesystem), 83 is a Linux partition which can
            be
            > > formatted
            > > > > > into many filesystems that Linux supports and 83 is a Linux
            swap
            > > > > partition.
            > > > > > Each partition and logical drive will have a partition
            type. Windows
            > > > > > typically ignores all partitions/logical drives that are
            not a
            > > partition
            > > > > > type it recognises.
            > > > > >
            > > > > > * Other partition table formats
            > > > > >
            > > > > > There are other partition table formats in existence. The
            most
            > > common in
            > > > > > PCs
            > > > > > is the MS DOS format but PCs can use other formats. Due to
            the rigid
            > > > > > structure of the partition table a MS DOS table cannot
            represent
            > > > > partitions
            > > > > > on very large disks (a few terabytes), the numbers that are
            > > stored in
            > > > > the
            > > > > > table can't go up that high. One other format that is
            catching
            > > on is GPT
            > > > > > (GUID Partition Table) which is a modern format that has
            worked
            > > around
            > > > > > these
            > > > > > limitations. I believe that Intel Macs use this format
            exclusively.
            > > > > Linux
            > > > > > and later versions of Windows can also use this format.
            > > > > >
            > > > > > * How do I know this
            > > > > >
            > > > > > I gathered this knowledge from reading, poking around my own
            > > systems and
            > > > > > getting into trouble and having to get myself out. One time
            I
            > > > > accidentally
            > > > > > deleted all but one of my partitions and spent the whole
            night
            > > reading a
            > > > > > learning about how partition tables are stored on disk and
            then
            > > by 4 am
            > > > > I
            > > > > > tried my hand at manually entering the numbers in the
            partition
            > > table
            > > > > and
            > > > > > all my drives came back with all the data in tact. It was
            all very
            > > > > > harrowing
            > > > > > and very interesting.
            > > > > >
            > > > > > ---
            > > > > >
            > > > > > I hope this information was interesting/useful to some. If
            I've
            > > made any
            > > > > > errors feel free to point it out on list so everyone will be
            > > corrected.
            > > > > >
            > > > > > - RB
            > > > > >
            > > > > > --
            > > > > > Reporter: What is your opinion on the obesity problem?
            > > > > > King: I prefer it to the famine problem
            > > > > > - Wizard of ID
            > > > > >
            > > > > > [Non-text portions of this message have been removed]
            > > > > >
            > > > > >
            > > > >
            > > > > --
            > > > > Nissan Dookeran
            > > > > http://redditech.blogspot.com
            > > > > ----
            > > > > "The manager administers; the leader innovates."
            > > > > "The manager is a copy; the leader is an original."
            > > > > "The manager does things right; the leader does the right
            thing."
            > > > > Warren Bennis - On Becoming a Leader
            > > > >
            > > > >
            > > >
            > > >
            > > >
            > > > --
            > > > Reporter: What is your opinion on the obesity problem?
            > > > King: I prefer it to the famine problem
            > > > - Wizard of ID
            > > >
            > > >
            > > > [Non-text portions of this message have been removed]
            > > >
            > >
            > >
            > >
            >
            >
            >
            > --
            > Reporter: What is your opinion on the obesity problem?
            > King: I prefer it to the famine problem
            > - Wizard of ID
            >
            >
            > [Non-text portions of this message have been removed]
            >
          • Richard Bailey
            There is an additional complication where naming comes in, especially with SCSI drive naming. In a PC you can have more than one drive controller, even more
            Message 5 of 10 , May 4, 2008
            • 0 Attachment
              There is an additional complication where naming comes in, especially with
              SCSI drive naming. In a PC you can have more than one drive controller, even
              more than one SCSI drive controller. In the case of SCSI the controller that
              gets initialised first gets the higher order names on it's drives. Then the
              other controller(s) get the names that follow.

              This is key when your root filesystem is on /dev/sda and you've installed an
              additional SCSI controller in your PC/server. This is part of the reason in
              fstab these days you'd see LABEL or UUID being used instead of the typical
              name.

              We have had this happen on some RedHat servers that had a built in SCSI
              controller and then we added a
              HBA<http://en.wikipedia.org/wiki/Host_Bus_Adapter>to a SAN. The SAN
              drives got named /dev/sda, /dev/sdb etc and the local
              drives became /dev/sdl and /dev/sdm and so on. There is a way to give
              preference to one controller over another, but I can't remember it now, I
              check it in work and let you all know.

              On Sun, May 4, 2008 at 1:42 PM, cancer76tt <cancer76tt@...> wrote:

              > Great article tho, I didn't know the order scheme for Linux IDE
              > drives worked like that...
              >
              >
              > --- In TTLUG@yahoogroups.com <TTLUG%40yahoogroups.com>, "Richard Bailey"
              > <rmjb@...> wrote:
              > >
              > > That is very true. I guess I thought of it as MS DOS because I
              > think that's
              > > how fdisk in Linux calls it.
              > >
              > > On Thu, May 1, 2008 at 11:25 AM, cancer76tt <cancer76tt@...> wrote:
              > >
              > > > It may be more accurate to state that the partition table is not
              > > > really the MS-DOS partition table, it is based on the MBR (Master
              > Boot
              > > > Record) of a hard drive.
              > > >
              > > >
              > > > --- In TTLUG@yahoogroups.com <TTLUG%40yahoogroups.com> <TTLUG%
              > 40yahoogroups.com>, "Richard
              > Bailey"
              > > > <rmjb@> wrote:
              > > > >
              > > > > Posted, link here:
              > > > >
              > > >
              > > > http://ttlug.pbwiki.com/Informational%3AHard%20drives%2C%
              > 20partitions%20and%20Linux
              > > > >
              > > > > Is the wiki crawled by google?
              > > > >
              > > > > On Wed, Apr 30, 2008 at 10:33 AM, Nissan Dookeran
              > <nissan.dookeran@>
              > > > > wrote:
              > > > >
              > > > > > Great stuff Richard...would you mind it being posted to the
              > Wiki for
              > > > > > content?
              > > > > > -Nissan
              > > > > >
              > > > > >
              > > > > > On Wed, Apr 30, 2008 at 10:17 AM, Richard Bailey
              > > > <rmjb@<rmjb%40mail.com>>
              > > >
              > > > > > wrote:
              > > > > > >
              > > > > > >
              > > > > > >
              > > > > > >
              > > > > > >
              > > > > > >
              > > > > > > Just thought I'd share a little about hard drives,
              > partitions
              > > > and Linux,
              > > > > > if
              > > > > > > this generates a discussion that would be great. If not at
              > least
              > > > I hope
              > > > > > it
              > > > > > > will help some.
              > > > > > >
              > > > > > > * IDE drives, device naming and SCSI drives
              > > > > > >
              > > > > > > Traditionally, hard drives in a typical PC were IDE based.
              > These
              > > > would
              > > > > > > usually be in two channels, Primary and Secondary, with
              > each channel
              > > > > > > capable
              > > > > > > of having two drives, Master and Slave. This gives a total
              > of 4
              > > > drives
              > > > > > that
              > > > > > > can exist. These devices show up
              > as /dev/hda, /dev/hdb, /dev/hdc and
              > > > > > > /dev/hdd in Linux with Primary Master first, then Primary
              > Slave,
              > > > then
              > > > > > > Secondary Master then Secondary Slave. It's worth noting
              > that if you
              > > > > > only
              > > > > > > have one drive on the Primary and two on the Secondary then
              > your
              > > > devices
              > > > > > > would be hda, hdc and hdd; any missing devices are left out.
              > > > > > >
              > > > > > > SCSI drives are a little trickier with respect to device
              > naming.
              > > > > > Firstly,
              > > > > > > SCSI devices are named /dev/sda, /dev/sdb, /dev/sdc and so
              > on.
              > > > However,
              > > > > > > SCSI
              > > > > > > has no concept or Master or Slave. SCSI does have the
              > concept of
              > > > > > > enumeration
              > > > > > > however, and a device with a lower number (i.e. device 1
              > instead of
              > > > > > device
              > > > > > > 7) would get the first SCSI device name and so on. This
              > > > typically means
              > > > > > > that
              > > > > > > there are usually no gaps in SCSI device names as there can
              > be
              > > > in IDE
              > > > > > > device
              > > > > > > names.
              > > > > > >
              > > > > > > Serial ATA drives and USB drives show up as SCSI devices
              > under
              > > > Linux and
              > > > > > > undergo the same naming scheme. Also, a CD-ROM or DVD-ROM
              > device is
              > > > > > still a
              > > > > > > drive and still gets a name like all the others.
              > > > > > >
              > > > > > > * Partitions, limitations and extended partitions
              > > > > > >
              > > > > > > In a typical PC the de facto partition table format is the
              > MS DOS
              > > > > > partition
              > > > > > > table, even on Linux. There are other partition table
              > formats
              > > > out there,
              > > > > > > but
              > > > > > > they are not common on PCs. The MS DOS partition table is
              > limited
              > > > > > however
              > > > > > > to
              > > > > > > only four entries. That is right, there can be only four
              > > > partitions in a
              > > > > > > partition table.
              > > > > > >
              > > > > > > A partition table entry will list the starting block, the
              > ending
              > > > block
              > > > > > or
              > > > > > > the length (I can't remember which one) and the partition
              > type.
              > > > These
              > > > > > three
              > > > > > > entries are all that is required for the drive to keep
              > track of its
              > > > > > > partitions. These partitions are called Primary Partitions.
              > > > > > >
              > > > > > > Partitions are accessed under Linux by simply tacking on a
              > > > number from 1
              > > > > > to
              > > > > > > 4 to the end of the device name, for example /dev/hda1,
              > > > /dev/sdb2, etc.
              > > > > > > Therefore, when you want to repartition a disk you run fdisk
              > > > against the
              > > > > > > drive, not the partition, i.e. you run 'fdisk /dev/sda'
              > not 'fdisk
              > > > > > > /dev/sda1'.
              > > > > > >
              > > > > > > You may be wondering how you can add seemingly unlimited
              > > > partitions to a
              > > > > > > drive if there is a 4 partition limitation. One of the
              > Primary
              > > > > > Partitions
              > > > > > > is
              > > > > > > allowed to be an Extended Partition. This can be any one,
              > not
              > > > only the
              > > > > > last
              > > > > > > one. An Extended Partition can then contain any number of
              > Logical
              > > > > > Drives.
              > > > > > >
              > > > > > > * Logical Drives
              > > > > > >
              > > > > > > In an Extended Partition there can be any number of Logical
              > > > Drives. In
              > > > > > > Linux
              > > > > > > these drives start numbering from 5 upward. It does not
              > matter
              > > > if there
              > > > > > are
              > > > > > > less than 4 partitions on the drive, logical drives always
              > start
              > > > at 5,
              > > > > > i.e.
              > > > > > > /dev/sda5, /dev/sda6, etc. The information about the logical
              > > > drives is
              > > > > > not
              > > > > > > stored in the partition table but rather in the extended
              > > > partition, this
              > > > > > > means that there is no limitation on the number of logical
              > > > drives that
              > > > > > can
              > > > > > > exist.
              > > > > > >
              > > > > > > Remember that a drive must have an extended partition
              > before you can
              > > > > > create
              > > > > > > logical drives.
              > > > > > >
              > > > > > > * Partition Types
              > > > > > >
              > > > > > > The partition type tells the operating system what is the
              > type of
              > > > > > > information in the partition. It is a two character code
              > and has a
              > > > > > specific
              > > > > > > meaning. For example 0b or 0c is a FAT32 partition (the
              > traditional
              > > > > > > DOS/Windows filesystem), 83 is a Linux partition which can
              > be
              > > > formatted
              > > > > > > into many filesystems that Linux supports and 83 is a Linux
              > swap
              > > > > > partition.
              > > > > > > Each partition and logical drive will have a partition
              > type. Windows
              > > > > > > typically ignores all partitions/logical drives that are
              > not a
              > > > partition
              > > > > > > type it recognises.
              > > > > > >
              > > > > > > * Other partition table formats
              > > > > > >
              > > > > > > There are other partition table formats in existence. The
              > most
              > > > common in
              > > > > > > PCs
              > > > > > > is the MS DOS format but PCs can use other formats. Due to
              > the rigid
              > > > > > > structure of the partition table a MS DOS table cannot
              > represent
              > > > > > partitions
              > > > > > > on very large disks (a few terabytes), the numbers that are
              > > > stored in
              > > > > > the
              > > > > > > table can't go up that high. One other format that is
              > catching
              > > > on is GPT
              > > > > > > (GUID Partition Table) which is a modern format that has
              > worked
              > > > around
              > > > > > > these
              > > > > > > limitations. I believe that Intel Macs use this format
              > exclusively.
              > > > > > Linux
              > > > > > > and later versions of Windows can also use this format.
              > > > > > >
              > > > > > > * How do I know this
              > > > > > >
              > > > > > > I gathered this knowledge from reading, poking around my own
              > > > systems and
              > > > > > > getting into trouble and having to get myself out. One time
              > I
              > > > > > accidentally
              > > > > > > deleted all but one of my partitions and spent the whole
              > night
              > > > reading a
              > > > > > > learning about how partition tables are stored on disk and
              > then
              > > > by 4 am
              > > > > > I
              > > > > > > tried my hand at manually entering the numbers in the
              > partition
              > > > table
              > > > > > and
              > > > > > > all my drives came back with all the data in tact. It was
              > all very
              > > > > > > harrowing
              > > > > > > and very interesting.
              > > > > > >
              > > > > > > ---
              > > > > > >
              > > > > > > I hope this information was interesting/useful to some. If
              > I've
              > > > made any
              > > > > > > errors feel free to point it out on list so everyone will be
              > > > corrected.
              > > > > > >
              > > > > > > - RB
              > > > > > >
              > > > > > > --
              > > > > > > Reporter: What is your opinion on the obesity problem?
              > > > > > > King: I prefer it to the famine problem
              > > > > > > - Wizard of ID
              > > > > > >
              > > > > > > [Non-text portions of this message have been removed]
              > > > > > >
              > > > > > >
              > > > > >
              > > > > > --
              > > > > > Nissan Dookeran
              > > > > > http://redditech.blogspot.com
              > > > > > ----
              > > > > > "The manager administers; the leader innovates."
              > > > > > "The manager is a copy; the leader is an original."
              > > > > > "The manager does things right; the leader does the right
              > thing."
              > > > > > Warren Bennis - On Becoming a Leader
              > > > > >
              > > > > >
              > > > >
              > > > >
              > > > >
              > > > > --
              > > > > Reporter: What is your opinion on the obesity problem?
              > > > > King: I prefer it to the famine problem
              > > > > - Wizard of ID
              > > > >
              > > > >
              > > > > [Non-text portions of this message have been removed]
              > > > >
              > > >
              > > >
              > > >
              > >
              > >
              > >
              > > --
              > > Reporter: What is your opinion on the obesity problem?
              > > King: I prefer it to the famine problem
              > > - Wizard of ID
              > >
              > >
              > > [Non-text portions of this message have been removed]
              > >
              >
              >
              >



              --
              Reporter: What is your opinion on the obesity problem?
              King: I prefer it to the famine problem
              - Wizard of ID


              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.