7 Replies Latest reply: Jul 9, 2013 6:17 PM by Catch-22 RSS

    Linux Partitions

    wmorriso

      Hello,

           I am a newbie to linux and need some basic help.  I have installed Oracle Linux and now want to create some virtual drive on my partitioned hard drive.  When I try to use fdisk I am getting no more sectors available on the 500 gig hard disk.  This should not be the case.

      This is the result of fdisk -l:

       

      Disk /dev/sdb: 500.1 GB, 500107862016 bytes

      255 heads, 63 sectors/track, 60801 cylinders

      Units = cylinders of 16065 * 512 = 8225280 bytes

      Sector size (logical/physical): 512 bytes / 4096 bytes

      I/O size (minimum/optimal): 4096 bytes / 4096 bytes

      Disk identifier: 0x000372b3

       

         Device Boot      Start         End      Blocks   Id  System

      /dev/sdb1   *           1          64      512000   83  Linux

      Partition 1 does not end on cylinder boundary.

      /dev/sdb2              64       60802   487873536   8e  Linux LVM

       

      Disk /dev/sda: 1000.2 GB, 1000204886016 bytes

      255 heads, 63 sectors/track, 121601 cylinders

      Units = cylinders of 16065 * 512 = 8225280 bytes

      Sector size (logical/physical): 512 bytes / 512 bytes

      I/O size (minimum/optimal): 512 bytes / 512 bytes

      Disk identifier: 0xe37e2acd

       

         Device Boot      Start         End      Blocks   Id  System

      /dev/sda1   *           1      119817   962423808    7  HPFS/NTFS

      /dev/sda2          119817      121602    14336000    7  HPFS/NTFS

       

      Disk /dev/mapper/vg_oraclelinux-lv_root: 53.7 GB, 53687091200 bytes

      255 heads, 63 sectors/track, 6527 cylinders

      Units = cylinders of 16065 * 512 = 8225280 bytes

      Sector size (logical/physical): 512 bytes / 4096 bytes

      I/O size (minimum/optimal): 4096 bytes / 4096 bytes

      Disk identifier: 0x00000000

       

       

      Disk /dev/mapper/vg_oraclelinux-lv_swap: 8371 MB, 8371830784 bytes

      255 heads, 63 sectors/track, 1017 cylinders

      Units = cylinders of 16065 * 512 = 8225280 bytes

      Sector size (logical/physical): 512 bytes / 4096 bytes

      I/O size (minimum/optimal): 4096 bytes / 4096 bytes

      Disk identifier: 0x00000000

       

       

      Disk /dev/mapper/vg_oraclelinux-lv_home: 161.1 GB, 161061273600 bytes

      255 heads, 63 sectors/track, 19581 cylinders

      Units = cylinders of 16065 * 512 = 8225280 bytes

      Sector size (logical/physical): 512 bytes / 4096 bytes

      I/O size (minimum/optimal): 4096 bytes / 4096 bytes

      Disk identifier: 0x00000000

        • 1. Re: Linux Partitions
          RCC

          I recommend some basic reading.  Partitioning with fdisk (old but good).  What you posted though clearly shows you used all of the /dev/sdb drive.  /dev/sdb2 starts on cylinder 64 and ends on 60802.  Oddly enough, that's one cylinder past the max and I don't usually see that.  Since /dev/sdb2 is using all the space, and you think you should have more then you need to use the LVM commands, you no longer should be thinking at the disk partition level.  Try running "pvs" and "vgs" to see what your volume manager devices are saying.  You may have space to create a new logical volume, which you would do with "lvcreate".

           

          Disk /dev/sdb: 500.1 GB, 500107862016 bytes

          255 heads, 63 sectors/track, 60801 cylinders

          Units = cylinders of 16065 * 512 = 8225280 bytes

          Sector size (logical/physical): 512 bytes / 4096 bytes

          I/O size (minimum/optimal): 4096 bytes / 4096 bytes

          Disk identifier: 0x000372b3

           

             Device Boot      Start         End      Blocks   Id  System

          /dev/sdb1   *           1          64      512000   83  Linux

          Partition 1 does not end on cylinder boundary.

          /dev/sdb2              64       60802   487873536   8e  Linux LVM

          • 2. Re: Linux Partitions
            Catch-22

            I am a newbie to linux and need some basic help.  I have installed Oracle Linux and now want to create some virtual drive on my partitioned hard drive.  When I try to use fdisk I am getting no more sectors available on the 500 gig hard disk.  This should not be the case.

             

            What do you mean by a virtual drive? Are you running some kind of virtualization software? Please provide more details.

             

            Please show the command you are using including the error as it appears on your screen. You can open a remote terminal session to enter the commands and copy and paste the results. Details are important.

             

            When using fdisk under OL6, please use the -c flag to turn off DOS compatibility mode, e.g. fdisk -cl /dev/sda


            You might want to do some readings to understand the difference between partitions and filesystems and understand the basic concepts of LVM.

            • 3. Re: Linux Partitions
              Catch-22

              ...Oddly enough, that's one cylinder past the max and I don't usually see that.

               

              It seems to be normal:

               

              # fdisk -cl /dev/sda

               

              Disk /dev/sda: 21.5 GB, 21474836480 bytes

              255 heads, 63 sectors/track, 2610 cylinders

              Units = cylinders of 16065 * 512 = 8225280 bytes

              Sector size (logical/physical): 512 bytes / 512 bytes

              I/O size (minimum/optimal): 512 bytes / 512 bytes

              Disk identifier: 0x000881f0

               

                 Device Boot      Start         End      Blocks   Id  System

              /dev/sda1   *           1          64      512000   83  Linux

              /dev/sda2              64        2611    20458496   8e  Linux LVM

              • 4. Re: Linux Partitions
                RCC

                Ok. Maybe not so odd, in fact I stand corrected, it should be much more common going forward.  I looked at a bunch of my OEL 5 systems before posting  and they all end on the last cylinder not after.  But then I found a few servers that I know I partitioned using sector counts instead for alignment purposes and it they have the extra cylinder count.  A little googling indicates fdisk has been changed to use sectors by default which will make this display much more common place.  That's why I said "I don't usually see that" instead of "it's wrong." or something to that effect.

                • 5. Re: Linux Partitions
                  Catch-22

                  From what I understand, cylinder alignment was a common practice in the past and has become obsolete. CHS addressing and fdisk DOS compatiblty mode was used for very old disks using a floppy disk schema. For some reason DOS compatiblity mode is turned on as default in fdisk under RHEL 6, which is probalby a mistake. All modern hard drives use LBA, so the values fdisk uses are going to be translated by the disk anyway to match the actual disk alignment and geometry.

                  • 6. Re: Linux Partitions
                    Tommyreynolds-Oracle

                    > that I understand, cylinder alignment was a common practice in the past and has become obsolete.

                     

                    Not so obsolete.  Even on SAN storage, having the extents align to the physical boundaries can make a big difference in performance.  You may have a block I/O that spans a cylinder boundary and miss a rotation while doing the write or read.  Caches are great, but they don't fix every problem.

                    • 7. Re: Linux Partitions
                      Catch-22

                      Are you sure? I think some SAN systems provide a CHS address translation mode for compatibilty reasons with some operating systems (BIOS), but not for performance.

                       

                      Cylinder-head-sector - Wikipedia, the free encyclopedia

                      Logical block addressing - Wikipedia, the free encyclopedia