博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux运维笔记-云服务器数据盘挂载
阅读量:6234 次
发布时间:2019-06-22

本文共 4002 字,大约阅读时间需要 13 分钟。

1.查看要挂载的空间

1 [root@iZuf6610s5jsqm9fr53nslZ ~]# fdisk -l 2  3 Disk /dev/vda: 42.9 GB, 42949672960 bytes 4 255 heads, 63 sectors/track, 5221 cylinders 5 Units = cylinders of 16065 * 512 = 8225280 bytes 6 Sector size (logical/physical): 512 bytes / 512 bytes 7 I/O size (minimum/optimal): 512 bytes / 512 bytes 8 Disk identifier: 0x00053156 9 10    Device Boot      Start         End      Blocks   Id  System11 /dev/vda1   *           1        5222    41942016   83  Linux12 13 Disk /dev/vdb: 107.4 GB, 107374182400 bytes14 16 heads, 63 sectors/track, 208050 cylinders15 Units = cylinders of 1008 * 512 = 516096 bytes16 Sector size (logical/physical): 512 bytes / 512 bytes17 I/O size (minimum/optimal): 512 bytes / 512 bytes18 Disk identifier: 0x00000000

 

2.添加分区

1 [root@iZuf6610s5jsqm9fr53nslZ ~]# fdisk /dev/vdb  2 Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel 3 Building a new DOS disklabel with disk identifier 0x65cce73f. 4 Changes will remain in memory only, until you decide to write them. 5 After that, of course, the previous content won't be recoverable. 6  7 Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) 8  9 WARNING: DOS-compatible mode is deprecated. It's strongly recommended to10          switch off the mode (command 'c') and change display units to11          sectors (command 'u').12 13 Command (m for help): n14 Command action15    e   extended16    p   primary partition (1-4)17 118 Invalid partition number for type `1'19 Command action20    e   extended21    p   primary partition (1-4)22 p23 Partition number (1-4): 124 First cylinder (1-208050, default 1): 25 Using default value 126 Last cylinder, +cylinders or +size{K,M,G} (1-208050, default 208050): 27 Using default value 20805028 29 Command (m for help): wq30 The partition table has been altered!31 32 Calling ioctl() to re-read partition table.33 Syncing disks.

fdisk 对应分区 相继输入 n, p, 1,  wq

3.查看当前分区情况

1 [root@iZuf6610s5jsqm9fr53nslZ ~]# fdisk -l 2  3 Disk /dev/vda: 42.9 GB, 42949672960 bytes 4 255 heads, 63 sectors/track, 5221 cylinders 5 Units = cylinders of 16065 * 512 = 8225280 bytes 6 Sector size (logical/physical): 512 bytes / 512 bytes 7 I/O size (minimum/optimal): 512 bytes / 512 bytes 8 Disk identifier: 0x00053156 9 10    Device Boot      Start         End      Blocks   Id  System11 /dev/vda1   *           1        5222    41942016   83  Linux12 13 Disk /dev/vdb: 107.4 GB, 107374182400 bytes14 16 heads, 63 sectors/track, 208050 cylinders15 Units = cylinders of 1008 * 512 = 516096 bytes16 Sector size (logical/physical): 512 bytes / 512 bytes17 I/O size (minimum/optimal): 512 bytes / 512 bytes18 Disk identifier: 0x65cce73f19 20    Device Boot      Start         End      Blocks   Id  System21 /dev/vdb1               1      208050   104857168+  83  Linux

 

4.格式化分区

1 [root@iZuf6610s5jsqm9fr53nslZ ~]# mkfs.ext3 /dev/vdb1  2 mke2fs 1.41.12 (17-May-2010) 3 Filesystem label= 4 OS type: Linux 5 Block size=4096 (log=2) 6 Fragment size=4096 (log=2) 7 Stride=0 blocks, Stripe width=0 blocks 8 6553600 inodes, 26214292 blocks 9 1310714 blocks (5.00%) reserved for the super user10 First data block=011 Maximum filesystem blocks=429496729612 800 block groups13 32768 blocks per group, 32768 fragments per group14 8192 inodes per group15 Superblock backups stored on blocks: 16     32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 17     4096000, 7962624, 11239424, 20480000, 2388787218 19 Writing inode tables: done                            20 Creating journal (32768 blocks): done21 Writing superblocks and filesystem accounting information: done22 23 This filesystem will be automatically checked every 31 mounts or24 180 days, whichever comes first.  Use tune2fs -c or -i to override.

 

5.挂载硬盘

1 #创建要挂载的目录 2 mkdir /data 3  4 #挂载分区 5 mount /dev/vdb1 /data/ 6  7 #写入分区信息 8 echo "/dev/vdb1  /data ext3    defaults    0  0" >> /etc/fstab 9 10 #查看分许信息11 cat /etc/fstab

 

转载于:https://www.cnblogs.com/coder-ct/p/6483622.html

你可能感兴趣的文章
Debug 路漫漫-02
查看>>
Android studio 编译出现的问题记录
查看>>
springMVC自定义注解实现用户行为验证
查看>>
[译]Android view 测量布局和绘制的流程
查看>>
对一次架构设计的总结和反思
查看>>
WPF无边框捕获消息改变窗口大小
查看>>
.net Elasticsearch 学习入门笔记
查看>>
在intellij idea 中怎么不用git 解除关联
查看>>
VMware Workstation 14 Pro永久激活密钥
查看>>
事件驱动模型的简单Java实现
查看>>
QAction QActionGroup QMenu 使用方法
查看>>
SQL Server 合并复制如何把备份的发布端或订阅端BAK文件还原为数据库
查看>>
Ocelot简易教程(四)之请求聚合以及服务发现
查看>>
微信小程序使用npm安装包
查看>>
MySQL索引调优【转】
查看>>
电子书下载:Microsoft PowerPivot for Excel 2010: Give Your Data Meaning
查看>>
EXPDP/IMPDP 命令使用详解
查看>>
C# 调用 Outlook发送邮件实例
查看>>
HDU 1058 Humble Numbers
查看>>
HDU 1224 Free DIY Tour
查看>>