Pages

Friday, November 26, 2010

Vision

Vision


How can I create a disk partition on a disk that is greater than 2TB in size?

Posted: 25 Nov 2010 08:46 PM PST

  • The fdisk command only supports the legacy MBR partition table format (also known as msdos partition table)
    • MBR partition table do not support disks greater than 2.1TB, and therefore fdisk is also unable to create partition tables on these devices.
    • Note that some older versions of fdisk may permit a larger size to be created but the resulting partition table will be invalid.
  • The parted command can create disk labels using MBR (msdos), GUID Partition Table (GPT), SUN disk labels and many more types.
    • The GPT disk label overcomes many of the limitations of the DOS MBR including restrictions on the size of the disk, the size of any one partition and the overall number of partitions.
    • Note that booting from a GPT labelled volume requires firmware support and this is not commonly available on non-EFI platforms (including x86 and x86_64 architectures).

    Procedure:
  • Use the parted tool to access the partition table of the device:
    # parted /dev/sdj Using /dev/sdj Welcome to GNU Parted! Type 'help' to view a list of commands. (parted)
     
  • Once at the parted prompt, create a GPT label on the disk:
    (parted) mklabel Warning: The existing disk label on /dev/sdj will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? Yes                                                                  New disk label type?  [gpt]? gpt                                           (parted)
    Note: This will remove any existing partition table and partitions on the device.
  • Use the print command to show the size of the disk as reported by parted.  We need this later:
    (parted) print                                                              Model: Linux device-mapper (dm) Disk /dev/sdj: 5662310.4MB Sector size (logical/physical): 512B/512B Partition Table: gpt  Number  Start  End  Size  File system  Name  Flags
     
  • Create a primary partition on the device.  In this example, the partition will encompass the entire disk (using size from the step above):
    (parted) mkpart primary 0 5662310.4MB
     
  • Unlike fdisk, you do not have to write out the partition table changes with parted.  Display your new partition and quit.
    (parted) print  Model: Linux device-mapper (dm) Disk /dev/mapper/VolGroup00-gpttest: 5662310.4MB Sector size (logical/physical): 512B/512B Partition Table: gpt  Number  Start   End          Size         File system  Name     Flags  1      17.4kB  5662310.4MB  5662310.4MB               primary         (parted) quit                                                              Information: Don't forget to update /etc/fstab, if necessary.
     
  • You can now create a filesystem on the device /dev/sdj1


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.