Centos7.x请参考:https://www.cnblogs.com/himismad/p/7851548.html

在内网主机Centos 6.5新增一个50G硬盘 (搭建在CAS服务器,直接新增存储)

新增一块磁盘主要需要做的有三步:格式化磁盘----分区----格式化分区----挂载

查看新增磁盘

[root@LX ~]# fdisk -l

Disk /dev/vda: 85.9 GB, 85899345920 bytes
16 heads, 63 sectors/track, 166440 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005239a Device Boot Start End Blocks Id System
/dev/vda1 * 3 2083 1048576 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/vda2 2083 18727 8388608 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/vda3 18727 166441 74447872 83 Linux
Partition 3 does not end on cylinder boundary. Disk /dev/vdb: 53.7 GB, 53687091200 bytes
16 heads, 63 sectors/track, 104025 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000 [root@LX ~]#

格式化磁盘/dev/vdb

[root@LX ~]# mkfs.ext4 /dev/vdb
mke2fs 1.41.12 (17-May-2010)
/dev/sda is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=1 blocks, Stripe width=0 blocks
122101760 inodes, 488378646 blocks
24418932 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
14905 block groups
32768 blocks per group, 32768 fragments per group
8192 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 Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@LX ~]

对磁盘/dev/vdb进行分区

[root@LX ~]# fdisk /dev/vdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x60e70d89.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u'). Command (m for help): p #(查看分区) Disk /dev/vdb: 53.7 GB, 53687091200 bytes
16 heads, 63 sectors/track, 104025 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x60e70d89 Device Boot Start End Blocks Id System Command (m for help): n #(新建分区)
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-104025, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-104025, default 104025):
Using default value 104025 Command (m for help): p #(查看分区) Disk /dev/vdb: 53.7 GB, 53687091200 bytes
16 heads, 63 sectors/track, 104025 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x60e70d89 Device Boot Start End Blocks Id System
/dev/vdb1 1 104025 52428568+ 83 Linux Command (m for help): w
The partition table has been altered! Calling ioctl() to re-read partition table.
Syncing disks.
[root@LX ~]#

格式化分区/dev/vdb1

[root@LX ~]# mkfs.ext4 /dev/vdb1
mke2fs 1.41.12 (17-May-2010)
文件系统标签=
操作系统:Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3276800 inodes, 13107142 blocks
655357 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=4294967296
400 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424 正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成 This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@LX ~]#

临时挂载/dev/vdb1分区

[root@LX ~]# mount /dev/vdb1 /usr/local/

开机自动挂载/dev/vdb1分区

查看分区UUID:

[root@LX ~]# blkid
/dev/vda3: UUID="951e9559-2e00-4cdf-8ce0-e081dfb8c80a" TYPE="ext4"
/dev/vda1: UUID="244eaeab-3205-479b-bce1-d5ded856ac08" TYPE="ext4"
/dev/vda2: UUID="d58ccabf-1e64-40ea-a50c-62e42d4300bf" TYPE="swap"
/dev/vdb1: UUID="c9fd3a57-3a5b-458d-9f2d-15dd020847b7" TYPE="ext4"
[root@LX ~]#

修改挂载启动配置文件

[root@LX ~]# vi /etc/fstab 

#
# /etc/fstab
# Created by anaconda on Fri Jan 25 22:24:28 2019
#
# 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=951e9559-2e00-4cdf-8ce0-e081dfb8c80a / ext4 defaults 1 1
UUID=244eaeab-3205-479b-bce1-d5ded856ac08 /boot ext4 defaults 1 2
UUID=d58ccabf-1e64-40ea-a50c-62e42d4300bf swap swap defaults 0 0
UUID=c9fd3a57-3a5b-458d-9f2d-15dd020847b7 /usr/local ext4 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
:wq

配置完成,reboot重启

df-h 查看是否挂载成功。

CentOS 6.5新增加硬盘挂载并实现开机自动挂载的更多相关文章

  1. centos6.5新增加硬盘挂载并实现开机自动挂载

    在内网主机新增一个2T硬盘,先关机断电再连接硬盘数据线和电源线! 查看当前磁盘设备信息: [root@tb ~]# fdisk -l WARNING: GPT (GUID Partition Tabl ...

  2. 【转】linux挂载新硬盘,开机自动挂载

    [转]linux挂载新硬盘,开机自动挂载 ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※ Linux的硬盘识别: 2.6 kernel以后,linux会将 ...

  3. CentOS Linux 加硬盘,分区和设置自动挂载

    sda 表示第1块SCSI硬盘hda 表示第1块IDE硬盘(即连接在第1个IDE接口的Master口上)scd0 表示第1个USB光驱当添加了新硬盘后,在/dev目录下会有相应的设备文件产生.ccis ...

  4. Linux添加新硬盘,设置分区和开机自动挂载之图文教程!

    虚拟机添加硬盘的步骤就不多废话了,主要列出添加硬盘后要进行设置的几个详细步骤: 1.查看磁盘信息:fdisk -ls 添加前如下图所示: 添加后如下图: 也可以用:ls /dev/sd*查看,如下图: ...

  5. Ubuntu - 硬盘分区、格式化、自动挂载配置

    Ubuntu系统的硬盘空间不够用了,需要增加新的硬盘扩容.将硬盘分区.格式化.自动挂载配置的整个过程记下来,备忘. 运行环境 | Enviroment Ubuntu 10.10 一.硬盘分区 | Ha ...

  6. [转载] CentOS系统开机自动挂载光驱 和 fstab文件详解

    参考 http://blog.itpub.net/12272958/viewspace-676977/ 一.开机自动挂载光驱 1.按习惯,root用户,在/media目录下建立目录cdrom——mkd ...

  7. linux --开机自动挂载硬盘【转】

    转:http://c.biancheng.net/view/900.html 了解了 mount 命令之后,读者可能会问,系统如何在开机时自动挂载硬盘,它又是怎么知道哪些分区是需要挂载的呢? 很简单, ...

  8. linux挂载新磁盘、分区和开机自动挂载

    今天在阿里云虚拟主机里新加了一块磁盘,需要单独挂载到centos7. 挂载过程中遇到了不少问题,记录如下: 查看分区 fdisk -l 其中第一个框和第二个框,是已经分好区的磁盘,第三个硬盘没有分区. ...

  9. Ubuntu 16.04开机自动挂载硬盘分区(转)

    说明:如果挂载以前旧硬盘分区时不需要第2.3步! 1.查看Linux硬盘信息: sudo fdisk -l 2.格式化新硬盘(很危险,注意操作时确定硬盘分区的位置): sudo mkfs.ext4 / ...

随机推荐

  1. 【2w字干货】ArrayList与LinkedList的区别以及JDK11中的底层实现

    1 概述 本文主要讲述了ArrayList与LinkedList的相同以及不同之处,以及两者的底层实现(环境OpenJDK 11.0.10). 2 两者区别 在详细介绍两者的底层实现之前,先来简单看一 ...

  2. (十七)VMware Harbor 垃圾清理

    1. 在线垃圾清理 注意:从Harbor中删除镜像时不释放空间,垃圾收集是通过从清单中不再引用文件系统中删除blob来释放空间的任务. 注意:在执行垃圾收集时,Harbor将进入只读模式,并且禁止对d ...

  3. 【Azure 应用服务】App Service/Azure Function的出站连接过多而引起了SNAT端口耗尽,导致一些新的请求出现超时错误(Timeout)

    问题描述 当需要在应用中有大量的出站连接时候,就会涉及到SNAT(源地址网络转换)耗尽的问题.而通过Azure App Service/Function的默认监控指标图表中,却没有可以直接查看到SNA ...

  4. 制作一个轻量级的状态管理插件:Vue-data-state

    Vuex 是不是有点繁琐? Vuex 是针对 Vue2 来设计的,因为 option API 本身有很多缺点,所以 Vuex 只好做各种补丁弥补这些缺点,于是变得比较"复杂". 现 ...

  5. python3 mysql API

    1. 安装引入 2. 对象简介 3. 代码封装 1. 安装引入 1)安装: pip install PyMySQL 2)Pycharm 中引入 pymysql:

  6. Mysql下可能存在注入的点。

    总结下mysql下可能存在注入的点,适用于mssql和oracle,先写语句,以后再写语句可能出现在哪些场景下: 针对查询: select * from x where id=* select * f ...

  7. ECMAScript 2019(ES10)新特性简介

    简介 ES10是ECMA协会在2019年6月发行的一个版本,因为是ECMAScript的第十个版本,所以也称为ES10. 今天我们讲解一下ES10的新特性. ES10引入了2大特性和4个小的特性,我们 ...

  8. dot 语法总结

    在使用pprof分析go的项目时,经常会查看各项指标的有向图 原理是使用Graphviz(Graph Visualization Software)解析生成的dot脚本得到最终展示给我们的图信息. d ...

  9. hdu1815 2sat + 二分 + 建图

    题意:       给你两个总部,s1 ,s2,和n个点,任意两点之间都是通过这个总部相连的,其中有一些点不能连在同一个总部上,有一些点可以连接在同一个总部上,总部和总部之间可以直接连接,就是假如a, ...

  10. CVE-2013-2551:Internet Explore VML COALineDashStyleArray 整数溢出漏洞简单调试分析

    0x01 2013 Pwn2Own 黑客大赛 在 Pwn2Own 的黑客大赛上,来自法国的 VUPEN 安全团队再一次利用 0day 漏洞攻破 Windows8 环境下的 IE10 浏览器,这一次问题 ...