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. 原创 Spring Boot 2.3 新特性分层JAR

    背景 在我们实际生产容器化部署过程中,往往会遇到 Docker 镜像很大,部署发布很慢的情况 影响 docker 镜像大小的因素,主要有以下三个方面: 基础镜像的大小 .尽量选择 aphine 作为基 ...

  2. 直接跑day07中现成的代码可能出现的问题

    由于前面课程中敲代码可能存在写bug且实战作业没有完成,因此今天直接把资料里的代码拿来用.遇到两个问题 问题1:Cannot find JRE '1.8'. You can specify JRE t ...

  3. Python多环境管理——pyenv

    1 背景&概述 因某些需求,需要安装TensorFlow,很自然地在终端敲下了以下命令: pip install tensorflow 然后... 好家伙??? 居然没有?? 因为是Pytho ...

  4. Horovod-Usage

    Usage 代码中要包含以下6步: 初始化 Run hvd.init() to initialize Horovod. 将每个GPU固定到单个进程以避免资源争用. 一个线程一个GPU,设置到 loca ...

  5. ACCESS常见错误场景

    ACCESS常见错误场景 今天用access时发现好多报错的地方,emmm,比MySQL麻烦好多,有些甚至还要自己去配置环境 不吐槽了,进入正题: 报错场景一:您尝试执行不包含指定聚合函数的查询 第一 ...

  6. Periodic Strings UVA - 455

    ​ A character string is said to have period k if it can be formed by concatenating one or more repet ...

  7. kube-router代替kube-proxy+calico

    使用kubeadm安装kubernetes,并使用kube-router代替kube-proxy+calico网络. 即:kube-router providing service proxy, fi ...

  8. 太全了!Redis主从复制原理以及常见问题总结

    相信很多小伙伴都已经配置过主从复制,但是对于redis主从复制的工作流程和常见问题很多都没有深入的了解.这次给大家整理一份redis主从复制的全部知识点. 下方可视频观看,效果更佳 Redis实战精讲 ...

  9. 从苏宁电器到卡巴斯基第13篇:我在苏宁电器当营业员 V

    强大的竞争对手 与现在遍地开花的苹果店相比,在2010年左右的时候,在长春,真正得到苹果授权的苹果店还是屈指可数的.当时在重庆路上如果想买苹果的产品,要么可以去苏宁国美,要么只能去卓展楼上的苹果专区了 ...

  10. Intel汇编语言程序设计学习-第一章 基本概念

    第一章基本概念 1.1  简单介绍 本书着重讲述MS-Windows平台上IA-32(Intel Architecture 32bit,英特尔32位体系架构)兼容微处理器的汇编语言程序设计,可以使用I ...