为什么80%的码农都做不了架构师?>>>   

涉及到的命令:fdisk/mkfs/mount

  1. 列出当前磁盘

    [root@vity ~]# fdisk -lDisk /dev/vda: 21.5 GB, 21474836480 bytes
    16 heads, 63 sectors/track, 41610 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: 0x0001cd0bDevice Boot      Start         End      Blocks   Id  System
    /dev/vda1   *           3         409      204800   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/vda2             409        8731     4194304   82  Linux swap / Solaris
    Partition 2 does not end on cylinder boundary.
    /dev/vda3            8731       41611    16571392   83  Linux
    Partition 3 does not end on cylinder boundary.Disk /dev/vdb: 21.5 GB, 21474836480 bytes
    16 heads, 63 sectors/track, 41610 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
  2. 分区&格式化磁盘

    [root@vity ~]# 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 0xd3b0c3e7.
    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 toswitch off the mode (command 'c') and change display units tosectors (command 'u').Command (m for help): n
    Command actione   extendedp   primary partition (1-4)
    p
    Partition number (1-4): 1
    First cylinder (1-41610, default 1): 1
    Last cylinder, +cylinders or +size{K,M,G} (1-41610, default 41610):
    Using default value 41610Command (m for help): w
    The partition table has been altered!Calling ioctl() to re-read partition table.
    Syncing disks.[root@vity ~]# mkfs -t ext4 -c /dev/vdb1
    mke2fs 1.41.12 (17-May-2010)
    文件系统标签=
    操作系统:Linux
    块大小=4096 (log=2)
    分块大小=4096 (log=2)
    Stride=0 blocks, Stripe width=0 blocks
    1310720 inodes, 5242852 blocks
    262142 blocks (5.00%) reserved for the super user
    第一个数据块=0
    Maximum filesystem blocks=4294967296
    160 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, 4096000Checking for bad blocks (read-only test): 完成
    正在写入inode表: 完成
    Creating journal (32768 blocks): 完成
    Writing superblocks and filesystem accounting information: 完成This filesystem will be automatically checked every 20 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.
  3. 挂载磁盘

    [root@vity ~]# mkdir /data
    [root@vity ~]# mount -t ext4 /dev/vdb1 /data
    [root@vity ~]# df -l
    Filesystem       1K-blocks    Used Available Use% Mounted on
    LABEL=cec-rootfs  16311208 3611268  11871372  24% /
    tmpfs              8165992     224   8165768   1% /dev/shm
    /dev/vda1           198337   52425    135672  28% /boot
    /dev/vdb1         20642316  176064  19417684   1% /data
    [root@vity ~]# echo "/dev/vdb1 /data ext4 defaults 0 0" >> /etc/fstab

此文只做记录,非教程。

转载于:https://my.oschina.net/vity/blog/202972

Wo Cloud CentOS 挂载磁盘小计相关推荐

  1. Centos挂载磁盘到旧目录

    前言 话接上篇,上篇介绍了如何挂载一个磁盘到新的目录,有长的好看的吴彦祖就要问了,那,我怎么挂载磁盘到一个已有的目录呢.嗯,这篇就是讲这个 前提 使用fdisk -l和lsblk命令能看到一块没有挂载 ...

  2. centos 挂载磁盘并做磁盘加密

    a) parted /dev/sdb                                  // 选择要分区的磁盘     b) print                         ...

  3. Centos挂载硬盘完整图文教程(查看、分区、格式化、挂载)磁盘

    Centos挂载硬盘完整图文教程(查看.分区.格式化.挂载)磁盘 此教程是博主亲自帮朋友管理服务器所操作的完整步骤,当然此步骤适合所有的linux-centos系统,不管centos怎么变,linux ...

  4. centos挂载盘到根下_Centos挂载硬盘完整图文教程

    此教程是我在管理服务器所操作的完整步骤,当然此步骤适合所有的linux-centos系统,不管centos怎么变,linux怎么变,它的这些命令可以说是基本不变的:先说一下此教程所用的服务器的环境: ...

  5. linux(CentOS)磁盘挂载数据盘

    linux(CentOS)磁盘挂载数据盘: 第一步:查看是否存在需要挂载的磁盘: sudo fdisk -l 第二步:为需要挂载的磁盘创建分区: sudo fdisk /dev/vdb 执行中:依次选 ...

  6. linux centos7如何格式化磁盘,Linux CentOS 7 磁盘格式化mke2fs、mkfs.ext4、磁盘挂载及手动增加swap空间...

    一. 磁盘格式化 查看系统支持的分区类型: cat /etc/filesystems[root@fxq-1 ~]# cat /etc/filesystems xfs ext4 ext3 ext2 no ...

  7. CentOS 6.3开机自动挂载磁盘和文件夹

    http://blog.csdn.net/daydreamingboy/article/details/8278841 CentOS 6.3开机自动挂载磁盘和文件夹 CentOS服务器可能有多个磁盘, ...

  8. linux 挂载32T文件系统,linux Centos下磁盘分区及文件系统创建与挂载(示例代码)

    linux Centos下磁盘分区及文件系统创建与挂载 MBR(Master Boot Record)是传统的分区机制,应用于绝大多数使用BIOS的PC设备. 1.MBR支持32bit和64bit系统 ...

  9. centos开机自动挂载磁盘_CentOS 6.5开机自动挂载硬盘

    企业级应用系统的建设,通常将系统和数据分别存储,并建立raid.新装的CentOS 6.5,需要挂载数据盘,并且能够系统启动自动挂载该数据盘. 1.手动挂载磁盘 查看磁盘分区信息,执行fdisk命令 ...

最新文章

  1. 地图不显示_地图不显示脚步,枪声没有方向标记,职业比赛有何不同?
  2. 64位操作系统的原理
  3. SpringBoot+Swagger2常用注解
  4. html5游戏 糖果派对,糖果派对, 第三层的游戏攻略, 怎玩才能合理的获得比较高的得分?...
  5. C++关于getline()和getchar()的小点
  6. Android usb 权限广播,[Android]USB开发
  7. Spring、Spring MVC、MyBatis整合文件配置详解
  8. loadrunner11完整卸载
  9. Android* 操作系统上的应用程序远程调试
  10. java1.7数据库access_Java 8读取Access数据库报错的问题——用32位Java 7
  11. android中注册代码怎么写,Android P HIDL demo代码编写 (原创)
  12. python 小例子 取文件夹文件 去除后缀
  13. 拓端tecdat:R语言梯度提升机 GBM、支持向量机SVM、正则判别分析RDA模型训练、参数调优化和性能比较可视化分析声纳数据
  14. Object C语法
  15. 工具篇:金蝶K3工具下载
  16. WEB UI设计规范
  17. LoadRunner教程(12)-LoadRunner IP欺骗
  18. pytest之.pytest_cache文件夹作用【Pytest中的cache缓存功能】
  19. 【系统分析师之路】第二十一章 复盘系分专业英语
  20. mysql实现不同电脑间局域网连接

热门文章

  1. java long.max_value,Long + Long不大于Long.MAX_VALUE
  2. archives_do.php,织梦后台文章管理中增加批量添加tag标签功能
  3. twisted mysql_在Twisted下用MySQLadbapi获取自增id
  4. python里it n_Python3 round(x [,n]) 函数
  5. java免检异常_java-异常
  6. java websocket ie8_websocket兼容IE8
  7. 《软件项目管理(第二版)》第 5 章——项目进度和成本管理 重点部分总结
  8. C/C++课程设计 ——货物管理系统
  9. linux在bin下加入ssh,移植 ssh 到开发板
  10. centos7ubuntu搭建Vulhub靶场(推荐Ubuntu)