2016-04-01

Linux Creating a Partition Size Larger Than 2TB

#17:00 2016.04.01
#http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html
#Linux Creating a Partition Size Larger Than 2TB


#__________________________________STATUS:
root@srv152bk:~# lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME                      FSTYPE        SIZE MOUNTPOINT LABEL
sda                                     5.5T           
sdb                                     1.8T           
├─sdb1                    ext4         46.6G /          #Dinh dang EXT4
├─sdb2                                    1K           
├─sdb5                    swap          7.5G [SWAP]    
└─sdb6                    LVM2_member   1.8T           
  └─vg_srv152-lv01 (dm-0) ext4          7.2T /disk1    
sdc                                     5.5T           
└─sdc1                    LVM2_member   5.5T           
  └─vg_srv152-lv01 (dm-0) ext4          7.2T /disk1    
sdd                                     1.8T           
└─sdd1                    ntfs          1.8T            2tb_2016.03.29
#__________________________________
root@srv152bk:~# fdisk -l | grep dev
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/mapper/vg_srv152-lv01 doesn't contain a valid partition table
Disk /dev/sda: 6001.2 GB, 6001175126016 bytes
Disk /dev/sdc: 6001.2 GB, 6001175126016 bytes
/dev/sdc1               1  4294967295  2147483647+  ee  GPT
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
/dev/sdb1   *        2048    97656831    48827392   83  Linux
/dev/sdb2        97658878  3907028991  1904685057    5  Extended
/dev/sdb5        97658880   113281023     7811072   82  Linux swap / Solaris
/dev/sdb6       113283072  3907028991  1896872960   83  Linux
Disk /dev/mapper/vg_srv152-lv01: 7938.5 GB, 7938475294720 bytes
Disk /dev/sdd: 2000.4 GB, 2000365289472 bytes
/dev/sdd1            2048  3906963455  1953480704    7  HPFS/NTFS/exFAT

'


#__________________________________To create a partition start GNU parted as follows:
#root@srv152bk:~# parted /dev/sda
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.


#Creates a new GPT disklabel i.e. partition table:
#(parted) mklabel gptWarning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No?Yes


#Next, set the default unit to TB, enter:
#(parted) unit TB


#To create a 3TB partition size, enter:
#(parted) mkpart primary 0 0
OR
#(parted) mkpart primary 0.00TB 6.00TB (CHOOSE THIS COMMAND)



#To print the current partitions, enter:
#(parted) print                                                           
Model: ATA WDC WD6001FSYZ-0 (scsi)
Disk /dev/sda: 6.00TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      0.00TB  6.00TB  6.00TB               primary



#Quit and save the changes, enter:
#(parted) quit
Information: You may need to update /etc/fstab



#root@srv152bk:~# fdisk -l | grep dev
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/mapper/vg_srv152-lv01 doesn't contain a valid partition table
Disk /dev/sda: 6001.2 GB, 6001175126016 bytes
/dev/sda1               1  4294967295  2147483647+  ee  GPT #<<GPT




#Use the mkfs.ext4 command to format the file system, enter:
#root@srv152bk:~# mkfs.ext4 /dev/sda1
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
183144448 inodes, 1465130240 blocks
73256512 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
44713 block groups
32768 blocks per group, 32768 fragments per group
4096 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848, 512000000, 550731776, 644972544

Allocating group tables: done                           
Writing inode tables: done                           
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done      



#Type the following commands to mount /dev/sda1, enter:
# mkdir /data
# mount /dev/sda1 /data
# df -H



root@srv152bk:~# fdisk -l | grep dev
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/mapper/vg_srv152-lv01 doesn't contain a valid partition table
Disk /dev/sda: 6001.2 GB, 6001175126016 bytes
/dev/sda1               1  4294967295  2147483647+  ee  GPT


No comments:

Post a Comment