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 / ...
随机推荐
- 【Azure 环境】在Windows系统中 使用Terraform创建中国区Azure资源步骤(入门级)
Terraform(全称:Hashicorp Terraform )是一种开源工具,用于预配和管理云基础结构. 它将基础结构编入描述云资源拓扑的配置文件中. 这些资源包括虚拟机.存储帐户和网络接口等. ...
- 解决Linux无法读写U盘中的NTFS问题
1 问题描述 由于笔者因为某些需要把Windows装在了U盘上面(在这里建议一下如果有需要请使用固态U盘),在Linux下挂载时,能读取但并不能写. 2 尝试的解决方案 2.1 remount 一开始 ...
- springdata jpa之ddl-auto配置的属性
在jpa中ddl-auto一共有四种: 分别为: ddl-auto:create ----每次运行该程序,没有表格会新建表格,表内有数据会清空:ddl-auto:create-drop ----每次程 ...
- (十)Docker-V 详解
1. 作用 挂载宿主机的一个目录. 2. 案例 譬如我要启动一个centos容器,宿主机的/test目录挂载到容器的/soft目录,可通过以下方式指定: # docker run -it -v /te ...
- LAMP架构上线动态网站WordPress
第一步,一键安装LAMP架构所需要的程序 yum install -y httpd mariadb-server php php-mysql 第二步,配置httpd,修改主配置文件/etc/httpd ...
- Azure data studio 跨平台数据库管理工具试用
最近折腾 azure sql database 的时候发现了微软的一款新的数据库管理工具: azure data studio.从名字上看 azure data studio 好像是专门为 azure ...
- 用html自己开发自己的串口TCP通讯调试软件
今天给大家介绍一个通讯工具,可以自己写html页面,自己写Js脚本实现数据收发. 本程序在不断完善中,请大家不要喷,多多理解,有意见只管提. 系列文章 概述 串口基础功能 TCP客户端收发 参数篇 串 ...
- Fiddler高级用法
Fiddler高级用法 1. 简单用法 Fiddler作为一个基于http协议的抓包工具,一直在业界有广泛使用.很多测试或者前端在使用Fiddler时,仅仅用于查看前端和服务端之间的请求信息.包括我作 ...
- 1149 Dangerous Goods Packaging
When shipping goods with containers, we have to be careful not to pack some incompatible goods into ...
- phpstorm 方法名类名 作者日期 注释
phpstorm 设置方法名 函数名注释 新建页面作者日期信息注释 官方提供的文档地址: http://www.jetbrains.com/phpstorm/help/creating-php-do ...