磁盘大于2T
[root@localhost ~]# parted
GNU Parted 3.1
使用 /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) select /dev/sda
[root@localhost ~]# parted
GNU Parted 3.1
使用 /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) select /dev/sda #换成实际要分区的磁盘
使用 /dev/sda
(parted) mklabel gpt
警告: 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
(parted) mkpart primary 2048s 100%
(parted) print
Model: ATA HUS726040ALA610 (scsi)
Disk /dev/sda: 4001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:Number Start End Size File system Name 标志1 1049kB 4001GB 4001GB ext4 primary(parted) toggle 1 lvm
(parted) p
Model: ATA HUS726040ALA610 (scsi)
Disk /dev/sda: 4001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:Number Start End Size File system Name 标志1 1049kB 4001GB 4001GB ext4 primary lvm(parted) quit
信息: You may need to update /etc/fstab.
- 创建逻辑卷:
- 创建pv:
[root@localhost ~]# pvcreate /dev/sda1Physical volume "/dev/sda1" successfully created
[root@localhost ~]# pvcreate /dev/sdb1Physical volume "/dev/sdb1" successfully created
[root@localhost ~]# pvcreate /dev/sdc1Physical volume "/dev/sdc1" successfully created
[root@localhost ~]# pvcreate /dev/sdd1Physical volume "/dev/sdd1" successfully created
[root@localhost ~]# pvcreate /dev/sde1Physical volume "/dev/sde1" successfully created
[root@localhost ~]# pvcreate /dev/sdf1Physical volume "/dev/sdf1" successfully created
[root@localhost ~]# vgcreate vgdata /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1Volume group "vgdata" successfully created
[root@localhost ~]# vgdisplay--- Volume group ---VG Name vgdataSystem ID Format lvm2Metadata Areas 6Metadata Sequence No 1VG Access read/writeVG Status resizableMAX LV 0Cur LV 0Open LV 0Max PV 0Cur PV 6Act PV 6VG Size 21.83 TiBPE Size 4.00 MiBTotal PE 5723166Alloc PE / Size 0 / 0 Free PE / Size 5723166 / 21.83 TiBVG UUID RBJX0A-sDxX-1vMA-1esu-IPxw-6zb7-uyAnfb
[root@localhost ~]# lvcreate -L 21.8TB vgdata -n lvdataRounding up size to full physical extent 21.80 TiBLogical volume "lvdata" created.[root@localhost ~]# mkfs.ext4 /dev/vgdata/lvdata
mke2fs 1.42.9 (28-Dec-2013)
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
365744128 inodes, 5851893760 blocks
292594688 blocks (5.00%) reserved for the super user
第一个数据块=0
178586 block groups
32768 blocks per group, 32768 fragments per group
2048 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, 1934917632,2560000000, 3855122432, 5804752896Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
[root@localhost data]# mount /dev/vgdata/lvdata /data
[root@localhost data]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/sdh2 25G 1.2G 23G 5% /
devtmpfs 95G 0 95G 0% /dev
tmpfs 95G 0 95G 0% /dev/shm
tmpfs 95G 9.1M 95G 1% /run
tmpfs 95G 0 95G 0% /sys/fs/cgroup
/dev/sdh1 988M 99M 823M 11% /boot
tmpfs 19G 0 19G 0% /run/user/0
/dev/mapper/vgdata-lvdata 22T 20K 21T 1% /data
添加重启自动识别分区(添加最后一行红色字体部分):
[root@localhost data]# vi /etc/fstab
# /etc/fstab
# Created by anaconda on Wed Jun 28 16:40:07 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=0cb3e9b9-be91-4ce9-b0fb-ebcc8fe6dbfc / ext4 defaults 1 1
UUID=14b028a4-65f2-4283-bf46-8b2715fb26ee /boot ext4 defaults 1 2
UUID=46a1f2df-78ac-4c42-9627-5491f20ba0a9 swap swap defaults 0 0
/dev/mapper/vgdata-lvdata /data ext4 defaults 0 0==
~
~
~