CentOS 6.5新增加硬盘挂载并实现开机自动挂载
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新增加硬盘挂载并实现开机自动挂载的更多相关文章
- centos6.5新增加硬盘挂载并实现开机自动挂载
在内网主机新增一个2T硬盘,先关机断电再连接硬盘数据线和电源线! 查看当前磁盘设备信息: [root@tb ~]# fdisk -l WARNING: GPT (GUID Partition Tabl ...
- 【转】linux挂载新硬盘,开机自动挂载
[转]linux挂载新硬盘,开机自动挂载 ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※ Linux的硬盘识别: 2.6 kernel以后,linux会将 ...
- CentOS Linux 加硬盘,分区和设置自动挂载
sda 表示第1块SCSI硬盘hda 表示第1块IDE硬盘(即连接在第1个IDE接口的Master口上)scd0 表示第1个USB光驱当添加了新硬盘后,在/dev目录下会有相应的设备文件产生.ccis ...
- Linux添加新硬盘,设置分区和开机自动挂载之图文教程!
虚拟机添加硬盘的步骤就不多废话了,主要列出添加硬盘后要进行设置的几个详细步骤: 1.查看磁盘信息:fdisk -ls 添加前如下图所示: 添加后如下图: 也可以用:ls /dev/sd*查看,如下图: ...
- Ubuntu - 硬盘分区、格式化、自动挂载配置
Ubuntu系统的硬盘空间不够用了,需要增加新的硬盘扩容.将硬盘分区.格式化.自动挂载配置的整个过程记下来,备忘. 运行环境 | Enviroment Ubuntu 10.10 一.硬盘分区 | Ha ...
- [转载] CentOS系统开机自动挂载光驱 和 fstab文件详解
参考 http://blog.itpub.net/12272958/viewspace-676977/ 一.开机自动挂载光驱 1.按习惯,root用户,在/media目录下建立目录cdrom——mkd ...
- linux --开机自动挂载硬盘【转】
转:http://c.biancheng.net/view/900.html 了解了 mount 命令之后,读者可能会问,系统如何在开机时自动挂载硬盘,它又是怎么知道哪些分区是需要挂载的呢? 很简单, ...
- linux挂载新磁盘、分区和开机自动挂载
今天在阿里云虚拟主机里新加了一块磁盘,需要单独挂载到centos7. 挂载过程中遇到了不少问题,记录如下: 查看分区 fdisk -l 其中第一个框和第二个框,是已经分好区的磁盘,第三个硬盘没有分区. ...
- Ubuntu 16.04开机自动挂载硬盘分区(转)
说明:如果挂载以前旧硬盘分区时不需要第2.3步! 1.查看Linux硬盘信息: sudo fdisk -l 2.格式化新硬盘(很危险,注意操作时确定硬盘分区的位置): sudo mkfs.ext4 / ...
随机推荐
- Java后端进阶-网络编程(Netty零拷贝机制)
package com.study.hc.net.netty.demo; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled ...
- GO-03-基础
可见性 Go语言中,使用大小写来决定标识符(常量.变量.类型.接口.结构或函数)是否可以被外部包所调用. 大写字母开头,那么其对象就可以被外部包的代码所使用,如同public. 小写字母开头,则对包外 ...
- Spring Cloud Alibaba(4)---Nacos(注册中心)
Nacos(注册中心) 有关Spring Cloud Alibaba之前写过三篇文章. Spring Cloud Alibaba(1)---入门篇 Spring Cloud Alibaba(2)--- ...
- JavaWeb请求与响应 Cookie&Session
1.请求与响应 &Cookie&Session 1.1.请求与响应 HTTP协议 概念:英文全称:HyperText Transfer Protocol 中文全称:超文本传输协议 ...
- vagrant构建centos虚拟环境
vagrant搭建centos 什么是vagrant 如何使用 1.构建本地的目录 2.官方下载对应的镜像文件,官方下载地址 3.导入刚刚下载的镜像(box文件) 4.初始化 5.修改Vagrantf ...
- Windows下反(反)调试技术汇总
反调试技术,恶意代码用它识别是否被调试,或者让调试器失效.恶意代码编写者意识到分析人员经常使用调试器来观察恶意代码的操作,因此他们使用反调试技术尽可能地延长恶意代码的分析时间.为了阻止调试器的分析,当 ...
- codeforces 229C
题意: http://codeforces.com/problemset/problem/229/C 给你一个全图,分成两部分,问你这两个途中一共有多少个三角形. 思 ...
- Windows核心编程 第九章 线程与内核对象的同步(下)
9.4 等待定时器内核对象 等待定时器是在某个时间或按规定的间隔时间发出自己的信号通知的内核对象.它们通常用来在某个时间执行某个操作. 若要创建等待定时器,只需要调用C r e a t e Wa i ...
- 快速运行cmd
方法一 运行 windows+r 输入cmd 指定要手动输入cd ...... 方法二 文件地址栏 在指定路径在文件地址栏前面输入cmd 方法三 shift+鼠标右键 打开到指定文件夹,shift+鼠 ...
- 如何实现一个 System Services?
<Android 系统开发做什么?>写到 Android System Services 是专注于特定功能的模块化组件,应用框架 API 所提供的功能可与系统服务通信,以访问底层硬件.An ...