磁盘新增分区-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/

二.挂载

  1. 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=文件格式

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 磁盘管理 一、磁盘分区工具和挂载 硬盘分区符认识 MBR概述:全称为Master Boot Record,即硬盘的...
    白色衬衫_f48d阅读 604评论 0 0
  • 磁盘管理 一、磁盘分区工具和挂载 硬盘分区符认识 MBR概述:全称为Master Boot Record,即硬盘的...
    予爷阅读 675评论 0 0
  • 一.分配超过2TB的磁盘(fdisk gdisk) 1. fdisk: [root@localhost ~]#...
    AGod_9141阅读 907评论 0 0
  • 一、分配超过2TB的磁盘 fdisk gdisk 二、mount挂载 临时 ---> 通过执行命令方式都算临时 永...
    曾努力阅读 363评论 0 0
  • 一块硬盘的“艺术”之旅(硬盘空间使用,经历的步骤)•识别硬盘 => 分区规划 => 格式化 => 挂载使用 •分区...
    一个懂点运维上行者阅读 309评论 0 0