CentOS7 磁盘管理
一、磁盘查看
查看所有磁盘
ll /dev/sd*
不带数字的为磁盘,带数字的为磁盘的分区

查看所有磁盘的分区情况
fdisk -l
结果
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion. Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt # Start End Size Type Name
1 2048 1953525134 931.5G unknown ceph data
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion. Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt # Start End Size Type Name
1 2048 1953525134 931.5G unknown ceph data Disk /dev/sda: 300.0 GB, 300000000000 bytes, 585937500 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000de82e Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 585936895 292455424 8e Linux LVM
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion. Disk /dev/sde: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt # Start End Size Type Name
1 2048 1953525134 931.5G unknown ceph data
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion. Disk /dev/sdb: 300.0 GB, 300000000000 bytes, 585937500 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt # Start End Size Type Name
1 2048 62916607 30G unknown ceph journal
2 62916608 125831167 30G unknown ceph journal
3 125831168 188745727 30G unknown ceph journal Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/centos-swap: 30.0 GB, 30001856512 bytes, 58597376 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/centos-home: 215.7 GB, 215721443328 bytes, 421330944 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
二、磁盘分区
连接磁盘硬件 -> 对磁盘分区 -> 对分区进行格式化 -> 挂载分区到目录 -> 使用
https://blog.51cto.com/yueyue207/2072255
# 对指定磁盘操作
fdisk /dev/sdc # 显示帮助
m # 显示已有分区
p # 删除分区,只有1个分区时,会自动删除已有分区,不用选择
d # 创建新的分区
n # 保存分区
w # 退出不保存
q
三、磁盘格式化
mkfs -t xfs -f /dev/sdb1
四、磁盘挂载
查看挂载情况
# 或 lsblk
lsblk -f

挂载已格式化的磁盘分区
# 创建目录
mkdir /home/data2 # 挂载磁盘到该目录
mount /dev/sdd1 /home/data2/ # 卸载
umount /dev/sdd1

开机自动挂载
# 最后一行为新增挂载
vim /etc/fstab #
# /etc/fstab
# Created by anaconda on Fri May ::
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(), findfs(), mount() and/or blkid() for more info
#
/dev/mapper/centos-root / xfs defaults
UUID=80774ba5-c734-40b3-90ec-5817bd434ce8 /boot xfs defaults
/dev/mapper/centos-home /home xfs defaults
/dev/mapper/centos-swap swap swap defaults
/dev/sdc1 /home/data xfs defaults

五、已挂载磁盘查看
查看已挂载磁盘使用情况
df -h

查看目录占用容量

https://blog.csdn.net/qq_30604989/article/details/81163270
CentOS7 磁盘管理的更多相关文章
- centos7 磁盘管理—— lvm的使用
Linux用户安装Linux操作系统时遇到的一个常见的难以决定的问题就是如何正确地评估各分区大小,以分配合适的硬盘空间.普通的磁盘分区管理方式在逻辑分区划分好之后就无法改变其大小,当一个逻辑分区存放不 ...
- Linux的VMWare中Centos7磁盘分区管理 fdisk分区和制作文件系统格式化和开机自动挂载
一.硬盘的组成零件扇区 磁道 磁盘容量 磁盘分区 简介 硬盘由容量.柱面数.磁头数.扇区数 C/H/S, Cylinder, Head, Sector(柱面/磁头数/扇区数) 1.磁头数表示硬盘总共有 ...
- centOS7服务管理与启动流程
centOS7服务管理与启动流程 centOS7启动流程 systemd简介 unit对象 unit类型 特性 service unit文件格式 service unit file文件通常由三部分组成 ...
- 磁盘管理 之 parted命令添加swap,文件系统
第1章 磁盘管理 1.1 必须要了解的. 1.1.1 ps aux 命令中 RSS 与VSZ的含义 rss 进程占用的物理内存的大小 单位:kb : vsz 进程占用的虚拟的内存大小(物理内存+swa ...
- linux磁盘管理系列-软RAID的实现
1 什么是RAID RAID全称是独立磁盘冗余阵列(Redundant Array of Independent Disks),基本思想是把多个磁盘组合起来,组合一个磁盘阵列组,使得性能大幅提高. R ...
- linux磁盘管理系列-LVM的使用
LVM是什么 LVM是Linux操作系统的逻辑卷管理器. 现在有两个Linux版本的LVM,分别是 LVM1,LVM2.LVM1是一种已经被认为稳定了几年的成熟产品,LVM2 是最新最好的LVM版本. ...
- linux 磁盘管理三部曲——(2)管理分区,文件系统类型格式化
上篇小编给大家讲解了磁盘结构和分区的介绍,这篇小编就给大家演示如何管理分区和文件系统类型格式化. 小编上篇已经提到如何使用磁盘,今天这两步,就是其中很重要的两步.(前几天写的有点急,有点乱,今天又整理 ...
- linux磁盘管理系列三:LVM的使用
磁盘管理系列 linux磁盘管理系列一:磁盘配额管理 http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_linux_040_quota.html l ...
- linux磁盘管理系列二:软RAID的实现
磁盘管理系列 linux磁盘管理系列一:磁盘配额管理 http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_linux_040_quota.html l ...
随机推荐
- Nginx作为静态资源web服务之防盗链
Nginx作为静态资源web服务之防盗链 首先,为什么需要防盗链,因为有些资源存在竞争对手的关系,比如淘宝的商品图片,不会轻易的让工具来爬虫爬走收集.但是如果使用防盗链,需要知道上一个访问的资源,然后 ...
- ——Java中的collection和collections的区别
1.java.util.Collection 是一个集合接口(集合类的一个顶级接口).它提供了对集合对象进行基本操作的通用接口方法.Collection接口在Java 类库中有很多具体的实现.Coll ...
- electron api sendInputEvent 源码
electron-master\electron-master\shell\browser\api\atom_api_web_contents.cc // Copyright (c) 2014 Git ...
- 工控安全入门之 Ethernet/IP
工控安全入门之 Ethernet/IP Ethernet/IP 与 Modbus 相比,EtherNet/IP 是一个更现代化的标准协议.由工作组 ControlNet International 与 ...
- STM32WB AHB总线、APB总线与外设
方框图: 如图所示: 1)APB1外设 2)APB2外设 3)AHB1外设 4)AHB2外设 5)AHB3外设 6)AHB4外设(ABH共享总线外设) 内存映射关系图:
- IPC之mqueue.c源码解读
队列的意思应该大家都清楚,不过还有有一些细节的地方不知道,下面是一个队列的源码,因该说这是队列的一部分,不是全部.而且是linux中队列,其他各种OS中队列大同小异. /* * POSIX messa ...
- 四、Attribute(2)授权角色过滤器
一.授权过滤器 1.新建一个mvc 项目 2.首先创建一个过滤器 MyAuthorizeAttribute 继承AuthorizeAttribute,并重写 AuthorizeCore public ...
- Problem C Shopping 闭环贪心
#include <bits/stdc++.h> using namespace std; ; int fa[maxn]; int main(){ int n, m; scanf(&quo ...
- USRP B210 更改A通道或B通道
USRP B210 更改A通道或B通道: 默认是A通道进行发射/接收,或设置 Mb0:Subdev Spec: A:A 设置B通道进行发射/接收,设置 Mb0:Subdev Spec: A:B
- 在配置tensorflow时踩的无数个坑
在下午尝试配置tensorflow环境时,遇到了许多天坑,讲真的心态炸了好几次,特此写下这篇记录,希望能给看到朋友一点帮助. 先说一下这抓狂的一天的起因,比赛项目想用SVM进行一下数据分析,除了常规的 ...