首页 > 系统相关 >Linux基于大于2TB磁盘挂载

Linux基于大于2TB磁盘挂载

时间:2022-11-28 11:01:02浏览次数:41  
标签:Disk 2TB bytes dev LV sdb Linux 挂载 512

Linux基于大于2TB磁盘挂载

首先查看服务器磁盘,这里将LINUX系统安装在sda,应用程序用于存放在sdb

[root@voices-bak ~]# fdisk -l

Disk /dev/sda: 127.0 GB, 126999330816 bytes, 248045568 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000da1b5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200   248045567   122973184   8e  Linux LVM

Disk /dev/sdb: 23998.0 GB, 23997999742976 bytes, 46871093248 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/centos-root: 89.5 GB, 89468698624 bytes, 174743552 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-swap: 36.5 GB, 36452696064 bytes, 71196672 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

这里选择/dev/sdb

[root@voices-bak ~]# parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: LSI LSI (scsi)
Disk /dev/sdb: 24.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start  End  Size  File system  Name  Flags

(parted)
(parted) mklabel gpt
(parted) print
Model: LSI LSI (scsi)
Disk /dev/sdb: 24.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start  End  Size  File system  Name  Flags
(parted) mkpart primary 0 100%		# 将磁盘所有空间进行划分
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore
(parted)
(parted) print
Model: LSI LSI (scsi)
Disk /dev/sdb: 24.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
 1      17.4kB  24.0TB  24.0TB               primary
(parted) quit
Information: You may need to update /etc/fstab.

格式化磁盘

[root@voices-bak ~]#  mkfs.xfs -f /dev/sdb

创建LVM卷

# pvcreate
[root@voices-bak ~]# pvcreate /dev/sdb
WARNING: xfs signature detected on /dev/sdb at offset 0. Wipe it? [y/n]: y
  Wiping xfs signature on /dev/sdb.
  Physical volume "/dev/sdb" successfully created.

# vgcreate Vg01

[root@voices-bak ~]# vgcreate Vg01 /dev/sdb
  Volume group "Vg01" successfully created


[root@voices-bak ~]# lvcreate -l 5721568 -n Lvdata Vg01		# -l 使用"Free  PE / Size       5721568"颗粒数
  Logical volume "Lvdata" created.



[root@voices-bak ~]# lvdisplay

  --- Logical volume ---
  LV Path                /dev/Vg01/Lvdata
  LV Name                Lvdata
  VG Name                Vg01
  LV UUID                x8ZZYf-33Ah-jVlj-sOS3-JQKF-au0s-sjOWgK
  LV Write Access        read/write
  LV Creation host, time voices-bak.hopetele, 2022-11-21 19:35:13 +0800
  LV Status              available
  # open                 0
  LV Size                <21.83 TiB
  Current LE             5721568
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

格式化后并挂载LVM卷

# 格式化
[root@voices-bak ~]# mkfs.xfs /dev/Vg01/Lvdata
[root@voices-bak ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/Vg01/Lvdata
  LV Name                Lvdata
  VG Name                Vg01
  LV UUID                x8ZZYf-33Ah-jVlj-sOS3-JQKF-au0s-sjOWgK
  LV Write Access        read/write
  LV Creation host, time voices-bak.hopetele, 2022-11-21 19:35:13 +0800
  LV Status              available
  # open                 0
  LV Size                <21.83 TiB
  Current LE             5721568
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2


# /dev/Vg01/Lvdata将挂载到/data 目录上
[root@voices-bak ~]# mount UUID='x8ZZYf-33Ah-jVlj-sOS3-JQKF-au0s-sjOWgK' /data

# 运行以下命令查询盘的UUID信息。
[root@voices-bak ~]# blkid
/dev/mapper/Vg01-Lvdata: UUID="85a6adfa-c7f8-4d26-846d-c05d147e66a1" TYPE="xfs"
[root@voices-bak ~]# vim /etc/fstab
UUID=85a6adfa-c7f8-4d26-846d-c05d147e66a1 /data xfs defaults 1 1

# 服务器重启验证
[root@voices-bak ~]# reboot

标签:Disk,2TB,bytes,dev,LV,sdb,Linux,挂载,512
From: https://blog.51cto.com/51inte/5890735

相关文章

  • Linux配置JDK环境
    JDK下载地址:http://jdk.java.net/https://jdk.java.net/archive/https://jdk.java.net/19/wgethttps://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.t......
  • Linux 安装 uwsgi
    一.源码安装1.选择版本下载:https://uwsgi-docs.readthedocs.io/en/latest/Download.html2.解压和安装cd/usr/localtarzxvfuwsgi-2.0.20.tar.gzcduwsgi-2.0.20pyth......
  • 【linux】linux中的文件类型
    普通文件类型最常使用的一类文件,其特点是不包含有文件系统信息的结构信息。通常用户所接触到的文件,比如图形文件、数据文件、文档文件以及声音文件都属于这种文件,这种类......
  • VMware 和 Linux 的安装
    手把手教你安装虚拟机常见的虚拟机软件有VMwareWorkstation(简称VMware)、VirtualBox、MicrosoftVirtualPC等,本文以VMware为例来讲解Linux......
  • Linux 进程通信深剖
    目录​​传统艺能......
  • Qt编写物联网管理平台(支持win/linux/mac/嵌入式linux/modbus等)
    一、前言这个物联网综合管理平台前后迭代了五年,一点一滴慢慢积累起来,从最开始的只有modbus串口协议解析以及简单的表格显示数据,慢慢的逐渐增加了tcp_rtu支持,用户管理模块,......
  • 【转载】查看当前用户的全部系统变量linux,Linux环境变量编程
    参考:https://blog.csdn.net/weixin_42639246/article/details/116556954一、Linux系统环境变量的分类按变量的生存周期来划分,Linux变量可分为两类:**环境变量**:又称为全局变......
  • Linux基础命令
    cd切换路径cd..#切换到上一层目录cd~#切换到家目录cd-#切换到上一次工作目录ls列出文件或目录ls-a#显示所有文件(包含隐藏文件)ls-c#按文件的......
  • linux中使用docker创建nginx容器镜像并部署静态网站项目
      1,先进入服务器root目录,然后创建nginx对应该的配置文件目录/日志目录/静态文件目录等,后面创建nginx容器时要把目录一一挂载上cdroot/mkdirnginxcdnginxmkdir......
  • sublime_text 4143 for Linux 注册
    1. https://hexed.it/2.上传sublime_text,按下面的修改DesciptionOffsetOriginalPatchedInitialLicenseCheck0x003A31F2554157414831C0C3Persisten......