磁盘新增分区-GPT方式,大于2T磁盘
和XFS方式基本一样,区别是命令不同:gdisk /dev/sdb
需要安装gdisk命令
一.分配超过2TB的磁盘(fdisk gdisk)
fdisk:
[root@localhost ~]# fdisk /dev/sdb
WARNING: The size of this disk is 4.4 TB (4398046511104 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID
partition table format (GPT).
[警告:这个磁盘的大小是4.4 TB(4398046511104字节)。
DOS分区表格式不能用于卷的驱动器上
对于512字节扇区,大于(2199023255040字节)。使用parted(1)和GUID
分区表格式(GPT).]
gdisk:
[root@localhost ~]# gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.10
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries.
(创建新的GPT条目)
2.使用gdisk对大于2TB的硬盘进行分区
[root@localhost ~]# gdisk /dev/sdb
Command (? for help): n
Partition number (1-128, default 1):
First sector (34-8589934558, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-8589934558, default = 8589934558) or {+-}size{KMGTP}: +2048G
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
3.对磁盘分区进行格式化
[root@localhost ~]# mkfs.xfs /dev/sdb1
[root@localhost ~]# mkfs.xfs /dev/sdb2
4.创建挂载点
[root@localhost ~]# mount /dev/sdb1 /sdb1/
[root@localhost ~]# mount /dev/sdb2 /sdb2/
二.挂载
-
mount(-t 指定挂载的设备类型)(-o 指定挂载的参数【rw 读写】【ro只读】)
临时———通过执行命令方式都算临时
[root@localhost ~]# mount /dev/sdb1 /sdb1/
[root@yum-test ~]# mount -t xfs -o ro /dev/sdc1 /data/test3
(将设备sdc1挂载到/data/test3目录,指定为xfs类型,但是只允许读,不允许写)
临时通过设备的UUID进行挂载(blkid)
永久———将信息写入配置文件(vim /etc/fstab)
UUID=c2493762-e206-4f4d-9400-42456831ec62 /data/test1 xfs defaults 0 0
UUID=/dev/dab1=要挂载的设备或要挂载谁被的UID /data/test1=挂载点 xfs=文件格式