Tuesday, April 21, 2015

Creating A Partition Size Larger Than 2TB In Ubuntu Server

                                    Normally we cannot create a Linux partition larger than 2 TB using the fdisk command. The fdisk won't create partitions larger than 2 TB.
                                    To solve this problem use GNU parted command with GPT. It supports Intel EFI/GPT partition tables. Partition Table (GPT) is a standard for the layout of the partition table on a physical hard disk. It is a part of the Extensible Firmware Interface (EFI) standard proposed by Intel as a replacement for the outdated PC BIOS, one of the few remaining relics of the original IBM PC. EFI uses GPT where BIOS uses a Master Boot Record (MBR).
                                     Also note that booting from a GPT volume requires support in your BIOS / firmware. This is not supported on non-EFI platforms.
           Legacy BIOS mode = MBR partition required
           UEFI BIOS mode = GPT partition required for Windows (some Linux versions support GPT boot under legacy BIOS with hybrid MBR)
                                    A master boot record (MBR) is a special type of boot sector holds the information on how the logical partitions, containing file systems, are organized on that medium.This MBR code is usually referred to as a boot loader.
                                  The organization of the partition table in the MBR limits the maximum addressable storage space of a disk to 2 TiB (232 × 512 bytes).Therefore, the MBR-based partitioning scheme is in the process of being superseded by the GUID Partition Table (GPT) scheme in new computers. A GPT can coexist with an MBR in order to provide some limited form of backward compatibility for older systems.
1. Find Out Hard Disks Specification :-
root@ubuntu:~# lshw -class disk
 *-disk:0
      description: SCSI Disk
      physical id: 0.0.0
      bus info: scsi@32:0.0.0
      logical name: /dev/sda
      size: 20GiB (21GB)
      capabilities: partitioned partitioned:dos
      configuration: sectorsize=512 signature=000afad3
 *-disk:1
      description: SCSI Disk
      physical id: 0.1.0
      bus info: scsi@32:0.1.0
      logical name: /dev/sdb
      size: 3000GiB (3221GB)
      configuration: sectorsize=512
2. Find Out Newly added HDD detailed Information
root@ubuntu:~# fdisk -l /dev/sdb
Disk /dev/sdb: 3221.2 GB, 3221225472000 bytes
255 heads, 63 sectors/track, 391625 cylinders, total 6291456000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdb doesn't contain a valid partition table
Partition And Format HDD - 3TB gpart File System
1 . Start GNU parted
root@ubuntu:~# parted /dev/sdb
GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
2 . Creates a new GPT disk label - Partition table
(parted) mklabel gpt
(parted)
3 . Set the Default unit to TB
(parted) unit TB
4 . Create a 3TB Partition Size
(parted) mkpart primary 0 0
OR
(parted) mkpart primary 0.00TB 3.00TB
5 . Print the Current Partitions
(parted) print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 3.22TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number  Start   End     Size    File system  Name     Flags
1      0.00TB  3.22TB  3.22TB               primary
6 . Quit and save the changes
(parted) quit
Information: You may need to update /etc/fstab
7. Check the HDD Information on partitioning
root@ubuntu:~# fdisk -l /dev/sdb
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 3221.2 GB, 3221225472000 bytes
255 heads, 63 sectors/track, 391625 cylinders, total 6291456000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1  4294967295  2147483647+  ee  GPT
7 . Format the HDD Partition with valid file system
root@ubuntu:~# mkfs.ext3 /dev/sdb1
OR
root@ubuntu:~# mkfs.ext4 /dev/sdb1
8 . Mount the HDD Partition into path /ictops
root@ubuntu:~# mkdir /ictops
root@ubuntu:~# mount /dev/sdb1 /ictops
9 . List Disk partition Information
root@ubuntu:~# df -H
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-root   18G  1.2G   16G   7% /
none                         4.0K     0  4.0K   0% /sys/fs/cgroup
udev                         983M  4.0K  983M   1% /dev
tmpfs                        199M  612K  199M   1% /run
none                         5.0M     0  5.0M   0% /run/lock
none                         994M     0  994M   0% /run/shm
none                         100M     0  100M   0% /run/user
/dev/sda1                    236M   37M  188M  17% /boot
/dev/sdb1                    2.9T   72M  2.8T   1% /ictops

No comments:

Post a Comment

bloggerwidgets