首页 > 其他分享 >将12块硬盘挂载到一个分区

将12块硬盘挂载到一个分区

时间:2024-03-15 16:23:25浏览次数:22  
标签:12 Disk sectors bytes dev 挂载 512 硬盘 size

fdisk -l 查看硬盘信息

[root@PPlive-RHEL73 ~]# fdisk -l


Disk /dev/sda: 146.8 GB, 146815733760 bytes, 286749480 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: 0x00033e86


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   105883647    52428800   83  Linux
/dev/sda3       105883648   110077951     2097152   82  Linux swap / Solaris
/dev/sda4       110077952   286748671    88335360    5  Extended
/dev/sda5       110080000   151039999    20480000   83  Linux
/dev/sda6       151042048   286748671    67853312   83  Linux


Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x0005fe17


   Device Boot      Start         End      Blocks   Id  System


Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x000069e5


   Device Boot      Start         End      Blocks   Id  System


Disk /dev/sde: 2000.4 GB, 2000398934016 bytes, 3907029168 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/sdm: 2000.4 GB, 2000398934016 bytes, 3907029168 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/sdj: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x0002bd26


   Device Boot      Start         End      Blocks   Id  System


Disk /dev/sdb: 146.8 GB, 146815733760 bytes, 286749480 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: 0x000941cb


   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      411647      204800   83  Linux
/dev/sdb2          411648   105269247    52428800   83  Linux
/dev/sdb3       105269248   109463551     2097152   82  Linux swap / Solaris
/dev/sdb4       109463552   285474815    88005632   83  Linux


Disk /dev/sdh: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x00042864


   Device Boot      Start         End      Blocks   Id  System


Disk /dev/sdk: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x000c5379


   Device Boot      Start         End      Blocks   Id  System


Disk /dev/sdg: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x000c7542


   Device Boot      Start         End      Blocks   Id  System


Disk /dev/sdl: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x00041060


   Device Boot      Start         End      Blocks   Id  System


Disk /dev/sdi: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x000ebe0f


   Device Boot      Start         End      Blocks   Id  System


Disk /dev/sdf: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x0000008b


   Device Boot      Start         End      Blocks   Id  System


Disk /dev/sdn: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x00095be7

所以可以看到一共挂了12块硬盘,如下

/dev/sdc
/dev/sdd
/dev/sde
/dev/sdf
/dev/sdg
/dev/sdh
/dev/sdi
/dev/sdj
/dev/sdk
/dev/sdl
/dev/sdm
/dev/sdn

这会可以通过 cat /proc/partitions 或者 lsblk 或者 blkid 查看12块硬盘状态是否正常,比如使用lsblk


sdc      8:32   0   1.8T  0 disk
└─sdc1   8:33   0   1.8T  0 part
sdd      8:48   0   1.8T  0 disk
└─sdd1   8:49   0   1.8T  0 part
sde      8:64   0   1.8T  0 disk
└─sde1   8:65   0   1.8T  0 part
sdf      8:80   0   1.8T  0 disk
└─sdf1   8:81   0   1.8T  0 part
sdg      8:96   0   1.8T  0 disk
└─sdg1   8:97   0   1.8T  0 part
sdh      8:112  0   1.8T  0 disk
└─sdh1   8:113  0   1.8T  0 part
sdi      8:128  0   1.8T  0 disk
└─sdi1   8:129  0   1.8T  0 part
sdj      8:144  0   1.8T  0 disk
└─sdj1   8:145  0   1.8T  0 part
sdk      8:160  0   1.8T  0 disk
└─sdk1   8:161  0   1.8T  0 part
sdl      8:176  0   1.8T  0 disk
└─sdl1   8:177  0   1.8T  0 part
sdm      8:192  0   1.8T  0 disk
└─sdm1   8:193  0   1.8T  0 part
sdn      8:208  0   1.8T  0 disk
└─sdn1   8:209  0   1.8T  0 part

接下来进行 pvcreate 操作

在这里遇到了一个坑,pvcreate /dev/sdc1 的时候报错

Can‘t open /dev/sdc1 exclusively. Mounted filesystem?

通过mount看没有加载, dmsetup status 查看也没有被占用(如果发现占用,再去remove,具体方法搜索)

最后无奈reboot,成功!

pvcreate /dev/sdc1
pvcreate /dev/sdd1
.....
....
pvcreate /dev/sdn1

创建卷组

创建卷组的命令为vgcreate;用此命令将使用pvcreate建立的物理卷创建为一个完整的卷组;
将物理卷/dev/sdc1创建为一个名为vgmysql的卷组:

[root@MYSQL-SERVER ~]# vgcreate vgmysql /dev/sdb1
Volume group "vgmysql" successfully created

添加新的物理卷到卷组中

此步即为将2块磁盘空间合二为一的关键步骤;当系统中新增了磁盘或新建了物理卷,而要将其添加到已有卷组时,就可使用vgextend命令;
将物理卷/dev/sdc1添加到vgmysql卷组中:

[root@MYSQL-SERVER ~]# vgextend vgmysql /dev/sdc1
Volume group "vgmysql" successfully extended

查看卷组

查看卷组用vgs:

[root@MYSQL-SERVER ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vgmysql 2 0 0 wz--n- 32.74t 32.74t
vgroot 1 4 0 wz--n- 264.00g 4.00m

从vgs命令的回显结果来看,卷组vgmysql成功添加,并且其总空间为两块物理磁盘的总大小(因换算单位不同,所以不是精确的38T)。

创建逻辑卷

创建逻辑卷的命令为lvcreate;用此命令将在使用vgcreate建立的卷组上创建逻辑卷;
在卷组vgmysql上创建一个名为lvmysql的逻辑卷,起大小为32.7T;

  • -n:指定逻辑卷名
  • -L:指定逻辑卷大小
[root@MYSQL-SERVER ~]# lvcreate -L 32.7T -n lvmysql vgmysql
Rounding up size to full physical extent 32.70 TiB
Logical volume "lvmysql" created.

格式化逻辑卷

将创建的lvmysql逻辑卷格式化为xfs

[root@MYSQL-SERVER ~]# mkfs -t xfs /dev/vgmysql/lvmysql
meta-data=/dev/vgmysql/lvmysql isize=512 agcount=33, agsize=268435328 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=0, rmapbt=0, reflink=0
data = bsize=4096 blocks=8777839616, imaxpct=5
= sunit=64 swidth=64 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=521728, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0

创建挂载目录并挂载

  • 创建挂载目录/mysql_data
    [root@MYSQL-SERVER ~]# mkdir /mysql_data
  • 挂载
    [root@MYSQL-SERVER ~]# mount /dev/vgmysql/lvmysql /mysql_data/
  • 做开机自动挂载
vi /etc/fstab
/dev/mapper/vgmysql-lvmysql /mysql_data xfs defaults 0 0

查看是否挂载成功

[root@MYSQL-SERVER ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/mapper/vgroot-lv_root 40G 1.8G 36G 5% /devtmpfs 126G 0 126G 0% /devtmpfs 126G 0 126G 0% /dev/shmtmpfs 126G 1.1M 126G 1% /runtmpfs 126G 0 126G 0% /sys/fs/cgroup/dev/sda1 976M 197M 713M 22% /boot/dev/mapper/vgroot-lv_var 59G 197M 56G 1% /var/dev/mapper/vgroot-lv_home 99G 5.6G 88G 6% /hometmpfs 26G 0 26G 0% /run/user/0/dev/mapper/vgmysql-lvmysql 33T 34M 33T 1% /mysql_data
[root@MYSQL-SERVER ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 446.1G 0 disk
├─sda1 8:1 0 1G 0 part /boot├─sda2 8:2 0 264G 0 part
│ ├─vgroot-lv_root 253:0 0 40G 0 lvm /│ ├─vgroot-lv_swap 253:1 0 64G 0 lvm [SWAP]
│ ├─vgroot-lv_var 253:2 0 60G 0 lvm /var│ └─vgroot-lv_home 253:3 0 100G 0 lvm /home└─sda3 8:3 0 64M 0 part
sdb 8:16 0 16.4T 0 disk
└─sdb1 8:17 0 16.4T 0 part
└─vgmysql-lvmysql 253:4 0 32.7T 0 lvm /mysql_datasdc 8:32 0 16.4T 0 disk
└─sdc1 8:33 0 16.4T 0 part
└─vgmysql-lvmysql 253:4 0 32.7T 0 lvm /mysql_datanvme0n1 259:0 0 1.5T 0 disk
[root@MYSQL-SERVER ~]# blkid /dev/sda1: UUID="5a350fc9-d3d2-44c7-9574-30bf9a9dd0d3" TYPE="ext4"
/dev/sda2: UUID="Sum0Mm-6ShR-6ajh-cYQO-091c-r7QI-zfbDpm" TYPE="LVM2_member"
/dev/sda3: UUID="2019-05-24-11-39-22-00" LABEL="config-2" TYPE="iso9660"
/dev/mapper/vgroot-lv_root: UUID="df07731a-5e56-4cc3-95ab-b723b5979332" TYPE="ext4"
/dev/mapper/vgroot-lv_swap: UUID="7b5cd64d-d316-430d-8a83-aca89c4708d2" TYPE="swap"
/dev/mapper/vgroot-lv_var: UUID="025cb128-de8f-4bca-8206-5c1601e79715" TYPE="ext4"
/dev/mapper/vgroot-lv_home: UUID="7bd155b6-9200-442a-a61a-32076c0e4b7e" TYPE="ext4"
/dev/sdc1: UUID="rWbWuV-nt59-ba72-VJrL-RTM2-EJJt-VVkhZF" TYPE="LVM2_member" PARTLABEL="sdc1" PARTUUID="355eb343-f2c9-4f13-9477-52b0fb267d5f"
/dev/sdb1: UUID="yfQk1G-nlN8-OOYu-nptl-cg2d-rD0L-uBFnhW" TYPE="LVM2_member" PARTLABEL="sdb1" PARTUUID="19db36ba-ec9c-4f35-9b29-b7bd2155f0dd"
/dev/mapper/vgmysql-lvmysql: UUID="67cda45d-4282-4346-8be1-e4ec375c2892" TYPE="xfs"
[root@MYSQL-SERVER ~]# tail -1 /etc/fstab /dev/mapper/vgmysql-lvmysql /mysql_data xfs defaults 0 0

标签:12,Disk,sectors,bytes,dev,挂载,512,硬盘,size
From: https://www.cnblogs.com/netstat/p/18075696

相关文章

  • 禁用右键菜单、禁用鼠标选中、// 禁止键盘F12键
    禁用右键菜单、禁用鼠标选中、//禁止键盘F12键//禁用右键菜单document.oncontextmenu=newFunction("event.returnValue=false");//禁用鼠标选中document.onselectstart=newFunction("event.returnValue=false");//禁止键盘F12键......
  • cve-2016-7124 序列化漏洞 php _weakup()
    版本范围php5<5.6.25php7<7.0.10原因魔法函数_weakup调用顺序:_weakup=>unserilize()如果对象属性个数:O:4:"test":3==3大于真是属性个数:3>2,则会跳过_weakup()的执行O:4:"test":3:{s:2:"v1";s:6:"hxdyjx";s:2:"v2";s:3:"1......
  • Debian12系统下的DNS服务配置
    主DNS:aptinstall-ybind9dnsutils   \\安装DNS服务和验证工具cd/etc/bind   \\进入DNS的配置目录DNS所有的配置文件都在这个目录下第一个配置文件vimnamed.conf.options           vimnamed.conf.default-zonescp-pdb.emptydb.skills.......
  • 【LeetCode 2312】卖木头块
    题目描述原题链接:2312卖木头块解题思路每次切割只能完全横切或者竖切,即切成更矮或者更窄的木块;每次切割后剩余的两部分木块都是更小规模的同类问题,典型的可以用动态规划求解的问题;具体到单个问题,高x宽y的木块能卖的最多钱数有三种情况:prices数组中正好有对应宽高的价格......
  • 超低功耗LCD显示段码驱动芯片VKL128 LQFP44 适用于扫地机器人/燃气表-原厂技术支持
    VKL128概述:VKL128是一个点阵式存储映射的LCD驱动器,可支持最大128点(32SEGx4COM)的LCD屏。单片机可通过I2C接口配置显示参数和读写显示数据,可配置4种功耗模式,也可通过关显示和关振荡器进入省电模式。其高抗干扰,低功耗的特性适用于水电气表以及工控仪表类产品。功能特点:•   ......
  • 如何证明所有自然数的和等于-1/12?
    前言Author:Rainypaster(lhy)本人过菜,不足之处请指教。证明第一种证明过程令\(1+2+3+4+5+6+7....=N\)则\(\color{white}{....}\)\(4+\)\(\color{white}{.....}\)\(8+\)\(\color{white}{.....}\)\(16+....=4N\)\(N-4N=1-2+3-4+5-.....=-3N\)我们把它写两遍,第二遍错......
  • 在VS2022和VS2012共存的电脑上安装VS212扩展注意事项
    1、下载一个专用于VS2012的扩展文件,直接双击下载的扩展文件安装后,显示安装成功。但是你可能会发现在VS2022,VS2012中都找不到此扩展。这就要求必须用VS2022的命令将其卸载,然后再用VS2012进行安装。2、用VS2022的命令卸载打开VS2022开发工具先找出此扩展的vsixid:将原扩展文件......
  • 2024.3.12 软工日报
    学习时间:下午四节课代码量:200packagecom.example.myapplication;importandroid.os.AsyncTask;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.PreparedStatement;importjava.sql.SQLException;publicclassMysqlHelp{publicstaticvoidi......
  • PHP-CGI远程1代码执行漏洞(CVE-2012-1823)
    影响版本php<5.3.12orphp<5.4.2测试环境cdphp/cve-2012-1823docker-composeup-d访问http://your-ip:8080/index.php?-s即爆出源码,说明漏洞存在。发送如下数据包,可见Body中的代码已被执行:POST/index.php?-d+allow_url_include%3don+-d+auto_prepend_file%3dphp%3a......
  • (斐波那契数列),假如兔子都不死,问到第12个月时一共有多少只兔子 //(有一对兔子,从出生后第
    //斐波那契数列,计算兔子的数量:11235813......从第三个数开始,//后一个数都是前两个数的和,假如兔子都不死,问到第12个月时一共有多少只兔子//(有一对兔子,从出生后第三个月开始,每一个月生一对兔子,小兔子同理)publicclassRabitDemo1{//斐波那契数列,计算兔子的数量:1......