Usually Linux administrators are used to create partition using fdisk which is probably the most used tool for disk partitioning. But now a days disk requirements are too high that sometimes need larger than 2 TB partition and unfortunately fdisk would not able to create partition larger than 2 TB.
to solve this, we can use parted command and below are the steps to create a 4 TB partition.
Find Out Current Disk Size
Type the following command:
Sample outputs:
# fdisk -l /dev/sdb
Sample outputs:
Disk /dev/sdb: 4398.0 GB, 4398046511104 bytes, 8589934592 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 /dev/sdb doesn't contain a valid partition table
now create 4TB partition size
To create a partition start GNU parted as follows:
Output:
# parted /dev/sdb
Output:
GNU Parted 2.3 Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted)
Creates a new GPT disklabel i.e. partition table:
(parted) mklabel gpt
Sample outputs:
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? yes (parted)
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.0GB 4398.0GB
To print the current partitions, enter:
(parted) print
Sample outputs:
Model: ATA ST33000651AS (scsi) Disk /dev/sdb: 4.00TB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 0.00TB 4.00TB 4.00TB ext4 primary
Quit and save the changes, enter:
(parted) quit
Sample outputs:
Information: You may need to update /etc/fstab.
Now that your partition is ready you can create a xfs filesystem by using the mkfs.xfs command, with the name of the partition you created like this:
# mkfs.xfs /dev/sdb1
Mounting the xfs filesystem
To mount the newly created partition you will have to first create a directory to be a mount point with the mkdir command, in our example we will use /mnt/db. Next you can mount the xfs parttion using the mount command as you would with any partition. Afterwards you can use the mount command to check if the partition was correctly mounted.
# mkdir /mnt/db
# mount /dev/sdb1 /mnt/db
# mount | grep /dev/sdb1
Membuat Partisi dan Format Hardisk Raid diatas 4TB Centos 7
Reviewed by ilham.sp
on
June 29, 2019
Rating:
No comments: