[root@erpbak ~]# parted /dev/vgca0
GNU Parted 1.8.1
Using /dev/vgca0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: Unknown (unknown)
Disk /dev/vgca0: 2222GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
(parted) help
check NUMBER do a simple check on the file system
cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition
help [COMMAND] prints general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER
mkpart PART-TYPE [FS-TYPE] START END make a partition
mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system
move NUMBER START END move partition NUMBER
name NUMBER NAME name partition NUMBER as NAME
print [free|NUMBER|all] display the partition table, a partition, or all devices
quit exit program
rescue START END rescue a lost partition near START and END
resize NUMBER START END resize partition NUMBER and its file system
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version displays the current version of GNU Parted and copyright information
(parted) mklabel
Warning: The existing disk label on /dev/vgca0 will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? y
New disk label type? [gpt]?
(parted)
(parted) gpt
check NUMBER do a simple check on the file system
cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition
help [COMMAND] prints general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER
mkpart PART-TYPE [FS-TYPE] START END make a partition
mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system
move NUMBER START END move partition NUMBER
name NUMBER NAME name partition NUMBER as NAME
print [free|NUMBER|all] display the partition table, a partition, or all devices
quit exit program
rescue START END rescue a lost partition near START and END
resize NUMBER START END resize partition NUMBER and its file system
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version displays the current version of GNU Parted and copyright information
(parted) unit
Unit? [compact]? s
(parted) mkpart
Partition name? []? 2
File system type? [ext2]? ext3
Start? 2048
End? -1
Warning: You requested a partition from 2048s to 4340711423s.
The closest location we can manage is 2048s to 4340711390s. Is this still acceptable to you?
Yes/No? y
(parted) p
Model: Unknown (unknown)
Disk /dev/vgca0: 4340711423s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 2048s 4340711390s 4340709343s 2
(parted) q
Information: Don't forget to update /etc/fstab, if necessary.
[root@erpbak ~]# ll /dev/vg*
crw------- 1 root root 10, 63 Jan 6 2014 /dev/vga_arbiter
brw-r----- 1 root disk 252, 0 Jan 5 21:55 /dev/vgca0
brw-r----- 1 root disk 252, 1 Jan 5 21:55 /dev/vgca0p1
crw-rw-r-- 1 root root 248, 0 Jan 5 21:28 /dev/vgc-fmm
crw-r--r-- 1 root root 247, 4 Jan 5 21:28 /dev/vgcmgmta-bb
crw-r--r-- 1 root root 247, 9 Jan 5 21:28 /dev/vgcmgmta-diags
crw-r--r-- 1 root root 247, 5 Jan 5 21:28 /dev/vgcmgmta-dieid
crw-r--r-- 1 root root 247, 11 Jan 5 21:28 /dev/vgcmgmta-oem_info
crw-r--r-- 1 root root 247, 3 Jan 5 21:28 /dev/vgcmgmta-pecounts
crw-r--r-- 1 root root 247, 8 Jan 5 21:28 /dev/vgcmgmta-vformat
[root@erpbak ~]#
2.然后格式化成ext4, 需要安装包e4fsprogs.x86_64(yum install e4fsprogs.x86_64)即可 。
3.接着用mount挂载分区
4.最后修改/etc/fstab,添加如下两行,让其开机自动挂载.
GNU Parted 1.8.1
Using /dev/vgca0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: Unknown (unknown)
Disk /dev/vgca0: 2222GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
(parted) help
check NUMBER do a simple check on the file system
cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition
help [COMMAND] prints general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER
mkpart PART-TYPE [FS-TYPE] START END make a partition
mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system
move NUMBER START END move partition NUMBER
name NUMBER NAME name partition NUMBER as NAME
print [free|NUMBER|all] display the partition table, a partition, or all devices
quit exit program
rescue START END rescue a lost partition near START and END
resize NUMBER START END resize partition NUMBER and its file system
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version displays the current version of GNU Parted and copyright information
(parted) mklabel
Warning: The existing disk label on /dev/vgca0 will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? y
New disk label type? [gpt]?
(parted)
(parted) gpt
check NUMBER do a simple check on the file system
cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition
help [COMMAND] prints general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER
mkpart PART-TYPE [FS-TYPE] START END make a partition
mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system
move NUMBER START END move partition NUMBER
name NUMBER NAME name partition NUMBER as NAME
print [free|NUMBER|all] display the partition table, a partition, or all devices
quit exit program
rescue START END rescue a lost partition near START and END
resize NUMBER START END resize partition NUMBER and its file system
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version displays the current version of GNU Parted and copyright information
(parted) unit
Unit? [compact]? s
(parted) mkpart
Partition name? []? 2
File system type? [ext2]? ext3
Start? 2048
End? -1
Warning: You requested a partition from 2048s to 4340711423s.
The closest location we can manage is 2048s to 4340711390s. Is this still acceptable to you?
Yes/No? y
(parted) p
Model: Unknown (unknown)
Disk /dev/vgca0: 4340711423s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 2048s 4340711390s 4340709343s 2
(parted) q
Information: Don't forget to update /etc/fstab, if necessary.
[root@erpbak ~]# ll /dev/vg*
crw------- 1 root root 10, 63 Jan 6 2014 /dev/vga_arbiter
brw-r----- 1 root disk 252, 0 Jan 5 21:55 /dev/vgca0
brw-r----- 1 root disk 252, 1 Jan 5 21:55 /dev/vgca0p1
crw-rw-r-- 1 root root 248, 0 Jan 5 21:28 /dev/vgc-fmm
crw-r--r-- 1 root root 247, 4 Jan 5 21:28 /dev/vgcmgmta-bb
crw-r--r-- 1 root root 247, 9 Jan 5 21:28 /dev/vgcmgmta-diags
crw-r--r-- 1 root root 247, 5 Jan 5 21:28 /dev/vgcmgmta-dieid
crw-r--r-- 1 root root 247, 11 Jan 5 21:28 /dev/vgcmgmta-oem_info
crw-r--r-- 1 root root 247, 3 Jan 5 21:28 /dev/vgcmgmta-pecounts
crw-r--r-- 1 root root 247, 8 Jan 5 21:28 /dev/vgcmgmta-vformat
[root@erpbak ~]#
mkfs.ext3 /dev/vgca0p1
目的:在centos 5.4系统下,用parted功能分区12T的硬盘并格式化成ext4,12T共分为2个分区,一个7.5T,另一个4.5T.
在linux 下大磁盘的分区不能再采用fdisk了,MBR分区表只支持2T磁盘,所以大于2T的磁盘必须使用GPT分区表。下面说明下具体的步骤:
1.分为两个主分区
[root@localhost ~]# parted /dev/sdb # 使用parted来对GPT磁盘操作,进入交互式模式
GNU Parted 1.8.1 Using /dev/sdb Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) mklabel gpt # 将MBR磁盘格式化为GPT
(parted) print #打印当前分区
(parted) mkpart primary 0 4.5TB # 分一个4.5T的主分区
(parted) mkpart primary 4.5TB 12TB # 分一个7.5T的主分区
(parted) print #打印当前分区
(parted) quit 退出
Information: Don’t forget to update /etc/fstab, if necessary.
GNU Parted 1.8.1 Using /dev/sdb Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) mklabel gpt # 将MBR磁盘格式化为GPT
(parted) print #打印当前分区
(parted) mkpart primary 0 4.5TB # 分一个4.5T的主分区
(parted) mkpart primary 4.5TB 12TB # 分一个7.5T的主分区
(parted) print #打印当前分区
(parted) quit 退出
Information: Don’t forget to update /etc/fstab, if necessary.
2.然后格式化成ext4, 需要安装包e4fsprogs.x86_64(yum install e4fsprogs.x86_64)即可 。
[root@localhost ~]# mkfs.ext4 /dev/sdb1
[root@localhost ~]# mkfs.ext4 /dev/sdb2
[root@localhost ~]# mkfs.ext4 /dev/sdb2
3.接着用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
[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.最后修改/etc/fstab,添加如下两行,让其开机自动挂载.
/dev/sdb1 /bk ext4 defaults,noatime 1 2
/dev/sdb2 /mail ext4 defaults,noatime 1 2
/dev/sdb2 /mail ext4 defaults,noatime 1 2