disk larger than 2tbปัจจุบัน harddisk มีขนาดที่ใหญ่มากกว่า 2TB พบเห็นได้ไม่ยาก แต่การจัดการ partition ที่ disk มีขนาดใหญ่กว่า 2TB จะไม่สามารถใช้ fdisk ได้เนื่องจาก fdisk รองรับการสร้าง parition แบบ MBR (ล้าสมัยไปแล้ว) เท่านั้น ซึ่งเป็นข้อจำกัดที่ทำให้ fdisk ไม่สามารถจัดการ disk ที่มีขนาดใหญ่กว่า 2TB ได้ ดังนั้นจำเป็นต้องหาโปรแกรมอื่นที่รองรับ Globally Unique Identifier (GUID) Partition Table (GPT) ซึ่ง partition table นี้สามารถรองรับ disk ที่มีขนาดใหญ่กว่า 2TB

ในปัจจุบันมีโปรแกรมจัดการ parition หลายตัวที่รองรับ GPT แต่มีโปรแกรมหนึ่งที่อยากจะแนะนำให้ลองใช้งาน นั้นคือ gdisk ซึ่งการใช้งานจะคล้ายๆกับการใช้ fdisk แต่สามารถแบ่ง partition ให้กับ disk ที่มีขนาดใหญ่กว่า 2TB และยังสามารถแบ่ง partition ได้มากถึง 128 partition อีกด้วย

วิธีการติดตั้งและใช้งาน gdisk

  1. ให้ติดตั้ง EPEL repo ก่อน โดย Download URL สามารถตรวจสอบได้ที่ RPM repository of RPM add-on packages for Red Hat Enterprise Linux and CentOS
  2. ติดตั้ง gdisk ด้วยคำสั่ง
    [[email protected] ~]# yum install gdisk
  3. รันคำสั่ง gdisk เพื่อทำการแบ่ง partition ของ disk โดยในตัวอย่างด้านล่าง disk จะมีชื่อว่า sdb

    [[email protected] ~]# gdisk /dev/sdb
    GPT fdisk (gdisk) version 0.8.4

    Partition table scan:
    MBR: protective
    BSD: not present
    APM: not present
    GPT: present

    Found valid GPT with protective MBR; using GPT.

  4. จากนั้นให้กด o เพื่อทำการสร้าง GUID partition table
    [shell]Command (? for help): ?
    b back up GPT data to a file
    c change a partition’s name
    d delete a partition
    i show detailed information on a partition
    l list known partition types
    n add a new partition
    o create a new empty GUID partition table (GPT)
    p print the partition table
    q quit without saving changes
    r recovery and transformation options (experts only)
    s sort partitions
    t change a partition’s type code
    v verify disk
    w write table to disk and exit
    x extra functionality (experts only)
    ? print this menu

    Command (? for help): o
    This option deletes all partitions and creates a new protective MBR.
    Proceed? (Y/N): y[/shell]

  5. จากนั้นกด n เพื่อสร้าง partition และตามด้วย 1 จากนั้น enter 2 ครั้ง (เลือกเนื้อที่ทั้งหมด) และกด enter หาก ใช้งานบน linux แต่ถ้าหากใช้งานอย่างอื่น ให้กด L เพื่อดูรายละเอียดชนิดของ partition โดยตัวอย่างนี้จะแสดงการสร้าง partition เพียงแค่ 1 partition เท่านั้น ดังตัวอย่าง

    [shell]Command (? for help): n
    Partition number (1-128, default 1): 1
    First sector (34-19393401950, default = 2048) or {+-}size{KMGTP}:
    Last sector (2048-19393401950, default = 19393401950) or {+-}size{KMGTP}:
    Current type is ‘Linux filesystem’
    Hex code or GUID (L to show codes, Enter = 8300): L
    0700 Microsoft basic data 0c01 Microsoft reserved 2700 Windows RE
    4200 Windows LDM data 4201 Windows LDM metadata 7501 IBM GPFS
    7f00 ChromeOS kernel 7f01 ChromeOS root 7f02 ChromeOS reserved
    8200 Linux swap 8300 Linux filesystem 8301 Linux reserved
    8e00 Linux LVM a500 FreeBSD disklabel a501 FreeBSD boot
    a502 FreeBSD swap a503 FreeBSD UFS a504 FreeBSD ZFS
    a505 FreeBSD Vinum/RAID a800 Apple UFS a901 NetBSD swap
    a902 NetBSD FFS a903 NetBSD LFS a904 NetBSD concatenated
    a905 NetBSD encrypted a906 NetBSD RAID ab00 Apple boot
    af00 Apple HFS/HFS+ af01 Apple RAID af02 Apple RAID offline
    af03 Apple label af04 AppleTV recovery af05 Apple Core Storage
    be00 Solaris boot bf00 Solaris root bf01 Solaris /usr & Mac Z
    bf02 Solaris swap bf03 Solaris backup bf04 Solaris /var
    bf05 Solaris /home bf06 Solaris alternate se bf07 Solaris Reserved 1
    bf08 Solaris Reserved 2 bf09 Solaris Reserved 3 bf0a Solaris Reserved 4
    bf0b Solaris Reserved 5 c001 HP-UX data c002 HP-UX service
    ef00 EFI System ef01 MBR partition scheme ef02 BIOS boot partition
    fd00 Linux RAID
    Hex code or GUID (L to show codes, Enter = 8300): 8300
    Changed type of partition to ‘Linux filesystem'[/shell]

  6. กด p เพื่อตรวจสอบรายละเอียดของ partition ที่ได้สร้างไว้

    [shell]Command (? for help): p
    Disk /dev/sdb: 19393401984 sectors, 9.0 TiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): E7327A36-2410-419C-96F1-4874EE7CAEED
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 19393401950
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 2014 sectors (1007.0 KiB)

    Number Start (sector) End (sector) Size Code Name
    1 2048 19393401950 9.0 TiB 8300 Linux filesystem[/shell]

  7. กด w เพื่อ save
    [shell]Command (? for help): w

    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
    PARTITIONS!!

    Do you want to proceed? (Y/N): y
    OK; writing new GUID partition table (GPT) to /dev/emcpowera.
    The operation has completed successfully.[/shell]

  8. ตรวจสอบดู partition table อีกครั้ง ด้วยคำสั่ง

    [shell][[email protected] ~]# gdisk -l /dev/sdb
    GPT fdisk (gdisk) version 0.8.4

    Partition table scan:
    MBR: protective
    BSD: not present
    APM: not present
    GPT: present

    Found valid GPT with protective MBR; using GPT.
    Disk /dev/sdb: 19393401984 sectors, 9.0 TiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): E7327A36-2410-419C-96F1-4874EE7CAEED
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 19393401950
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 2014 sectors (1007.0 KiB)

    Number Start (sector) End (sector) Size Code Name
    1 2048 19393401950 9.0 TiB 8300 Linux filesystem[/shell]

    จะเห็นว่ามี partition จำนวน 1 partition เพิ่มขึ้นมา ขั้นตอนจากนี้ก็ทำการ format partition ด้วย file system ที่ต้องการได้เลยครับ