CentOS云服务器数据盘分区和格式化
1. 查看数据盘信息
登录CentOS云服务器后,可以使用“fdisk -l”命令查看数据盘相关信息。 使用“df –h”命令,无法看到未分区和格式化的数据盘,只能看到已挂载的。
[root@VM_75_6_centos tlbb]# fdisk -l Disk /dev/vda: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0xcd6e8236 Device Boot Start End Blocks Id System
/dev/vda1 * + Linux Disk /dev/vdb: 21.5 GB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00000000 Disk /dev/vdb doesn't contain a valid partition table Disk /dev/vdc: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00000000 Disk /dev/vdc doesn't contain a valid partition table
可以看到 vdb vdc 这两个盘并未进行分区。
2.数据盘分区
执行以下命令,对数据盘进行分区。 然后输入 n p 1 两次enter wq。分区已然形成
fdisk /dev/vdb
[root@VM_75_6_centos tlbb]# 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 0xf9140b26.
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 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): n
Command action
e extended
p primary partition (-)
p
Partition number (-):
First cylinder (-, default ):
Using default value
Last cylinder, +cylinders or +size{K,M,G} (-, default ):
Using default value Command (m for help): wq
The partition table has been altered! Calling ioctl() to re-read partition table.
Syncing disks.
再fdisk -l一下。
Disk /dev/vdb: 21.5 GB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0xf9140b26 Device Boot Start End Blocks Id System
/dev/vdb1 + Linux
然后进行格式化文件系统。
[root@VM_75_6_centos tlbb]# mkfs.ext3 /dev/vdb1
mke2fs 1.41. (-May-)
文件系统标签=
操作系统:Linux
块大小= (log=)
分块大小= (log=)
Stride= blocks, Stripe width= blocks
inodes, blocks
blocks (5.00%) reserved for the super user
第一个数据块=
Maximum filesystem blocks=
block groups
blocks per group, fragments per group
inodes per group
Superblock backups stored on blocks:
, , , , , , , , , 正在写入inode表: 完成
Creating journal ( blocks): 完成
Writing superblocks and filesystem accounting information: 完成 This filesystem will be automatically checked every mounts or
days, whichever comes first. Use tune2fs -c or -i to override.
最后,将此分区挂在到/home目录下
mount /dev/vdb1 /home
用df -h看一下分区信息。
[root@VM_75_6_centos tlbb]# df -h
文件系统 容量 已用 可用 已用%% 挂载点
/dev/vda1 .9G .9G .7G % /
/dev/vdb1 20G 173M 19G % /home
大功告成。
CentOS云服务器数据盘分区和格式化的更多相关文章
- linux数据盘分区以及格式化
首先切换到root账户下 sudo -i 手动格式化 请根据以下步骤对数据盘进行分区以及格式化,并挂载分区使数据盘可用. 注:执行以下命令时,请注意修改数据盘符,可以使用”fdisk -l”查看盘符 ...
- 阿里云扩容数据盘_Linux
扩容数据盘_Linux 更新时间:2018-10-11 15:18:46 · 编辑者 编辑 · ★ 我的收藏 新手学堂 学习路径 本页目录 前提条件 注意事项 步骤 1. 在控制台上扩容数据盘的磁盘空 ...
- Linux系统下常见的数据盘分区丢失的问题以及对应的处理方法
在修复数据前,您必须先对分区丢失的数据盘创建快照,在快照创建完成后再尝试修复.如果在修复过程中出现问题,您可以通过快照回滚将数据盘还原到修复之前的状态. 前提条件 在修复数据前,您必须先对分区丢失的数 ...
- CentOS下挂载数据盘
CentOS下挂载数据盘 1.显示磁盘使用情况:#df 2.显示磁盘:#fdisk -l 3.格式化分区:#mkfs.ext4 /dev/vdb1 //注:将/dev/vdb1格式 ...
- 【Linux】扩展阿里云数据盘分区和文件系统
扩容云盘只是扩大存储容量,不会扩容文件系统 一.准备工作 在扩展数据盘扩展分区和文件系统前,请提前完成以下工作. 创建快照以备份数据,防止操作失误导致数据丢失. 通过ECS控制台或者API扩容云盘容量 ...
- 阿里云服务器创建swap分区
阿里云服务器使用了4核8G内存配置,但最近由于jenkins构建时执行gradle打包安卓应用,导致即时的内存严重不足,线上应用长时间无法访问. 执行free命令才发现,swap分区一直是没有创建的. ...
- windows云服务器数据迁移
刚入职,第一个任务是完成windows腾讯云到windows华为云上的MySQL数据库迁移.之前都是在CentOS上搞,感觉没啥难度,一口答应,没想到各种坑接踵而来.次数不再叙述坑都有哪些了,说说怎么 ...
- 阿里云服务器CentOS7怎么分区格式化/挂载硬盘
一.在阿里云上购买了服务器的硬盘后就可以操作了,先看看硬盘情况: 硬盘vda是系统盘:vdb是在阿里云后台购买的另一块硬盘. 第一次使用要分区:fdisk /dev/vdb1 在提示符下依次输入:n+ ...
- Linux学习24-腾讯云服务器开启swap分区
前言 最近有小伙伴买的腾讯云的1核1G入门级服务器,发现部署的服务多了后,会自动停掉一些docker的的容器. 新买的腾讯云主机没有提供Swap分区,理由是由于主机经常因为内存使用率过高,频繁使用Sw ...
随机推荐
- Uploadify使用
Uploadify是JQuery的一个上传插件,实现的效果非常不错,带进度显示.不过官方提供的实例时php版本的,本文将详细介绍Uploadify在Aspnet中的使用,您也可以点击下面的链接进行演示 ...
- regsvr32 注册.dll的用法
Regsvr 32命令是Windows中控件文件(如扩展名为DLL.OCX.CPL的文件)的注册和反注册工具. 命令格式 Regsvr32 [/s] [/n] [/i[:cmdline]] dllna ...
- poj题目必做
OJ上的一些水题(可用来练手和增加自信) (poj3299T,poj2159T,poj2739T,poj1083T,poj2262T,poj1503T,poj3006T,poj2255T,poj309 ...
- php 获取当前url,可以规避框架url重写后还有index.php的情况
function get_url(){ $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") { $pageURL ...
- jquery判断多选框是否选中
if($("#xieyi").is(":checked")){ alert('选中'); }else{ alert('没有选中') }
- closeChrome
function closeChrome(){ var browserName=navigator.appName; if (browserName=="Netscape") { ...
- lucene4.7学习总结
花了一段时间学习lucene今天有时间把所学的写下来,网上有很多文章但大部分都是2.X和3.X版本的(当前最新版本4.9),希望这篇文章对自己和初学者有所帮助. 学习目录 (1)什么是lucene ( ...
- 从协议VersionedProtocol开始1
Phase 0: Make a plan You must first decide what steps you're going to have in your process. It sound ...
- 解决使用OCI连接oracle LNK2019: 无法解析的外部符号的问题
据我所知,在使用OCI连接Oracle时出现LNK2019: 无法解析的外部符号问题的情况有两种: 一.没有引入附加依赖项,右键项目->属性->配置属性->链接器->输入中添加 ...
- iOS 端的 UI 聊天组件ChatKit及代码实现
ChatKit 是一个免费且开源的 UI 聊天组件,自带云服务器,自带推送,支持消息漫游,消息永久存储.底层聊天服务基于LeanCloud(原名 AVOS ) 的 IM 实时通信服务「LeanMess ...