1. 查看磁盘

[root@yzb-centos72-3 ~]# fdisk -l

Disk /dev/vda: 32.2 GB, 32212254720 bytes, 62914560 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: 0x0009680e

Device Boot      Start         End      Blocks   Id  System
/dev/vda1            2048     4194303     2096128   82  Linux swap / Solaris
/dev/vda2   *     4194304    56623103    26214400   83  Linux

Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 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

发现/dev/vdb这块未分区、格式化

2. 分区

[root@yzb-centos72-3 ~]# fdisk /dev/vdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x20ea1593.

Command (m for help): 
输入m 查看

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   g   create a new empty GPT partition table
   G   create an IRIX (SGI) partition table
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): 
输入n

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended

输入p

Select (default p): p

一路回车默认

Partition number (1-4, default 1): 
First sector (2048-209715199, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199): 
Using default value 209715199
Partition 1 of type Linux and of size 100 GiB is set

输入w
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

查看  fdisk -l

已经分好区,但是未格式化

[root@yzb-centos72-3 ~]# fdisk -l

Disk /dev/vda: 32.2 GB, 32212254720 bytes, 62914560 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: 0x0009680e

Device Boot      Start         End      Blocks   Id  System
/dev/vda1            2048     4194303     2096128   82  Linux swap / Solaris
/dev/vda2   *     4194304    56623103    26214400   83  Linux

Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 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: 0x35bf8022

Device Boot      Start         End      Blocks   Id  System
/dev/vdb1            2048   209715199   104856576   83  Linux

3. 格式化  mkfs -t ext3   或者  mkfs.ext3

[root@yzb-centos72-3 ~]# mkfs -t ext3 /dev/vdb1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6553600 inodes, 26214144 blocks
1310707 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 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

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[root@yzb-centos72-3 ~]#

4. 挂载

先在根目录建data

[root@yzb-centos72-3 /]# mkdir data

然后挂载

 mount /dev/vdb1 /data

查看挂载后的目录

[root@yzb-centos72-3 /]# df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/vda2      ext4       25G  3.1G   21G  14% /
devtmpfs       devtmpfs  3.9G     0  3.9G   0% /dev
tmpfs          tmpfs     3.9G     0  3.9G   0% /dev/shm
tmpfs          tmpfs     3.9G   57M  3.8G   2% /run
tmpfs          tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs          tmpfs     783M     0  783M   0% /run/user/0
/dev/vdb1      ext3       99G   60M   94G   1% /data

将挂载持久化到文件,开机自动挂载

/etc/fstab

vi /etc/fstab

#
# /etc/fstab
# Created by anaconda on Mon Jan  2 22:58:53 2017
#
# 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=381f5199-12a4-4d44-91af-be015a752145 /                       ext4    defaults        1 1
UUID=4b0d629d-79d8-43e3-82bd-8a7b98fcfb75 swap                    swap    defaults        0 0
/dev/vdb1   /data                                              ext3    defaults        1 1

TIP:

inux使用ntfs-3g 挂载NTFS分区

一、安装ntfs-3g:

sudo apt-get install ntfs-3g或者yum install ntfs-3g

二、fdisk -l查看磁盘设备点,挂载设备

mount -t ntfs-3g /dev/sdd4 /ntfs

如果需要开机自启动挂载,可以在vi /etc/fstab文件结尾添加需要挂载的NTFS盘,

添加命令如下:

/dev/sdd4 /ntfs ntfs-3g defaults 0 0

centos7.4 分区 格式化的更多相关文章

  1. 阿里云服务器CentOS7怎么分区格式化/挂载硬盘

    一.在阿里云上购买了服务器的硬盘后就可以操作了,先看看硬盘情况: 硬盘vda是系统盘:vdb是在阿里云后台购买的另一块硬盘. 第一次使用要分区:fdisk /dev/vdb1 在提示符下依次输入:n+ ...

  2. (转)centos7.4 fdisk磁盘分区 格式化 挂载

    centos7.4 fdisk磁盘分区 格式化 挂载 原文:http://blog.csdn.net/capecape/article/details/78499351 1.查看系统中有多少可以识别的 ...

  3. Centos7添加磁盘并分区格式化

    1.安装前准备 [root@localhost ~]# yum install xfsprogs [root@localhost ~]# modprobe xfs [root@localhost ~] ...

  4. Linux分区格式化

    格式化(format)是指对磁盘或磁盘中的分区(partition)进行初始化的一种操作,这种操作通常会导致现有的磁盘或分区中所有的文件被清除.格式化通常分为低级格式化和高级格式化.如果没有特别指明, ...

  5. linux硬盘分区格式化及挂载

    1.硬盘的接口类型 硬盘的接口一般分为两种,一种是IDE并行接口,一种是SATA串行接口, 在linux上面IDE接口的硬盘被识别为/dev/hd[a-z]这样的设备,其中hdc表示光驱设备,这是因为 ...

  6. Linux磁盘分区/格式化/挂载(树莓派3挂载硬盘)

    [前言] 本文将要讲解的功能为Linux环境下对磁盘进行操作.包括分区.格式化.挂载外接移动存储设备等. 该文的写作背景为本人的树莓派需要外接一个固态硬盘作为存储设备,因此,便开始了一系列的折腾. [ ...

  7. centos7 根分区扩容

    系统安装时候使用的默认分区,根分区只分了50G,使用的是LVM 想把home分区分出来660G给根分区 先查了点资料开搞 由于xfs分区只支持增大,不支持缩小,所以home目前是xfs格式无法进行缩小 ...

  8. linux增加硬盘 磁盘分区格式化及挂载

    nux磁盘分区格式化及挂载 意义: 给linux 系统服务器扩容, 加一块硬盘 实验环境: virtualBox虚拟软件  + centos6.5 第一步: 添加硬件 硬盘 (我这里用virtualB ...

  9. linux 分区格式化

    要对一个u盘进行分区 windows上直接格式化就行了,但是我的u盘 由于之前做成的系统把u盘分成三个分区,windows只能格式化第一个分区其他两个分区只能看着,理论上windows上也有dd之类的 ...

随机推荐

  1. activiti5/6 系列之--Activiti 读取并转换BPMN2文件

    统一的BPMN标准,对工作流的流程定义采用BPMN统一格式.BPMN流程文件可以使用eclipse bpmn2插件开发比如eclipse bpmn2 modeler或者idea activiti插件. ...

  2. ant_<target>标签含义与使用

    <target>标记目标 目标是一个或多个任务的集合,任务是一段可执行的代码:构建文件中包含一个项目,在项目内部声明了所有目标: <target name = "run&q ...

  3. Swagger2使用参考

    GitHub例子: 参考博客: https://blog.csdn.net/sanyaoxu_2/article/details/80555328 http://www.cnblogs.com/Joi ...

  4. ABAP 中的搜索帮助

    ABAP 中的搜索帮助 https://blog.csdn.net/u011576750/article/details/50999078 一.简介:在abap中,用到的搜索帮助个人遇到的情况如下,进 ...

  5. 软工实践练习一 关于GIT的使用

    在Github上的操作部分: 1.在Github网站上进行注册.https://github.com/ 2.创建小组Organization. 3.将代码库https://github.com/sef ...

  6. 20175317 《Java程序设计》第四周学习总结

    20175317 <Java程序设计>第四周学习总结 教材学习内容总结 第四周我学习了教材第五章的内容,了解了子类与继承的知识,学到了以下内容: 明白了什么是子类与父类.类的树形结构. 子 ...

  7. Nearest neighbor graph | 近邻图

    最近在开发一套自己的单细胞分析方法,所以copy paste事业有所停顿. 实例: R eNetIt v0.1-1 data(ralu.site) # Saturated spatial graph ...

  8. HBase Region 各个状态的转换

    Region 各个状态的转换 HBase 维护了每个 region 的一个状态信息,并保存在 hbase:meta 中.hbase:meta 本身region的状态信息被持久化到 ZooKeeper. ...

  9. 浅谈中大型企业CMDB的建设

    作者:嘉维蓝鲸产品总监,贺勇 针对CMDB这个主题,之前一直想写一篇文章来表达我的看法,但是之前一直不敢写,为什么?因为CMDB这个主题属于一提大家都懂,但是深入讨论大家都晕菜的一个话题:在2018年 ...

  10. Linux(CentOS 7)命令行模式安装VMware Tools 详解

    本篇文章主要介绍了如何在Linux(CentOS 7)命令行模式安装VMware Tools,具有一定的参考价值,感兴趣的小伙伴们可以参考一下. 本例中为在Linux(以CentOS 7为例)安装VM ...