Archive for December 9, 2014

Linux uses parted partitioning tool at greater than 2T hard disk partition

purpose:In centos 5.4 system,Parted with the partition function 12T hard drive and formatted into ext4,12T divided into two partitions,A 7.5T,Another 4.5T.
In linux large disk partitions can not use the fdisk,2T only support MBR partition table disk,So more than 2T disk must use the GPT partition table。The following describes specific steps:
1.It is divided into two primary partitions

 

[root@localhost ~]# parted /dev/sdb # Using parted to GPT disks operation,Enter the interactive mode
GNU Parted 1.8.1 Using /dev/sdb Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) mklabel gpt # The MBR disk to GPT format
(parted) print # print the current partition
(parted) mkpart primary 0 4.5TB # Points a 4.5T primary partition
(parted) mkpart primary 4.5TB 12TB # Points a 7.5T primary partition
(parted) print # print the current partition
(parted) quit 退出
Information: Don’t forget to update /etc/fstab, if necessary.

 

2.Then formatted into ext4,You need to install the package e4fsprogs.x86_64(yum install e4fsprogs.x86_64)To

[root@localhost ~]# mkfs.ext4 /dev/sdb1
[root@localhost ~]# mkfs.ext4 /dev/sdb2

 

3.Then mount the partition with the mount

[root@localhost]# mount -t ext4 /dev/sdb1 /bk
[root@localhost]# mount -t ext4 /dev/sdb2 /mail
[root@localhost ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev / sda6 ext3 39G 9.4G 28G 26% /
/dev/sda1 ext3 122M 13M 103M 12% /boot
none tmpfs 1004M 0 1004M 0% /dev/shm
/dev/sdb1 ext4 4.1T 194M 3.9T 1% /bk
/dev / sdb2 ext4 6.8T 179M 6.4T 1% /mail

 

4.Last modified / etc / fstab,Add the following two lines,Let it boot automatically mount.

/dev/sdb1 /bk ext4 defaults,noatime 1 2
/dev/sdb2 /mail ext4 defaults,noatime 1 2

 

Comments