http://help.aliyun.com/origin?helpId=271

  查看已挂在磁盘使用情况 df -h

[root@AY121110111722e1c8917 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1             20G  1.2G   18G   6% /
tmpfs                 245M     0  245M   0% /dev/shm

查看磁盘,包括未挂在的,个人理解的是磁盘的个数。
[root@AY121110111722e1c8917 ~]# fdisk -lDisk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00073f45Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1        2611    20970496   83  LinuxDisk /dev/xvdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

创建分区
[root@AY121110111722e1c8917 ~]# fdisk /dev/xvdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x8121207b.
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-2610, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): 2610Command (m for help): wq
The partition table has been altered!Calling ioctl() to re-read partition table.
Syncing disks.
[root@AY121110111722e1c8917 ~]# 

查看新分区
[root@AY121110111722e1c8917 ~]# fdisk -lDisk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00073f45Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1        2611    20970496   83  LinuxDisk /dev/xvdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8121207bDevice Boot      Start         End      Blocks   Id  System
/dev/xvdb1               1        2610    20964793+  83  Linux
[root@AY121110111722e1c8917 ~]# 

格式化分区
[root@AY121110111722e1c8917 ~]# mkfs.ext3 /dev/xvdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5241198 blocks
262059 blocks (5.00%) reserved for the super user
First data block=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, 4096000Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@AY121110111722e1c8917 ~]# 

添加新分区

  使用下列命令挂在新分区后,挂在信息会追加到/etc/fstab文件中,以后在系统重启之后不需要重新挂在,如果用mount命令挂在,系统在下次启动时不会自动挂在新分区。

[root@AY121110111722e1c8917 ~]# echo '/dev/xvdb1 /mnt/xvdb1 ext3 defaults 0 0' >> /etc/fstab
[root@AY121110111722e1c8917 ~]# cat /etc/fstab #
# /etc/fstab
# Created by anaconda on Mon Dec 17 09:06:53 2012
#
# 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=887b0b9e-449b-414e-a11d-cd94093e3fe1 /                       ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
xenfs                   /proc/xen               xenfs   defaults        0 0
/dev/xvdb1              /mnt/xvdb1              ext3    defaults        0 0
[root@AY121110111722e1c8917 ~]# 

使/etc/fstab文件立刻生效,执行命令:

[root@AY121110111722e1c8917 ~]# mount -a

如果文件夹/mnt/xvdb1不存在,需要手动创建

[root@AY121110111722e1c8917 ~]# mkdir /mnt/xvdb1

使用df -h查看

[root@AY121110111722e1c8917 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1             20G  1.2G   18G   6% /
tmpfs                 245M     0  245M   0% /dev/shm
/dev/xvdb1             20G  173M   19G   1% /mnt/xvdb1
[root@AY121110111722e1c8917 ~]# 

转载于:https://www.cnblogs.com/grj1046/p/3235082.html

阿里云数据盘分区并挂载相关推荐

  1. 阿里云数据盘扩容操作遇险记录

    阿里云数据盘扩容操作记录 阿里云数据盘40G的容量已经用了37G了,不扩容的话,肯定是不行了.于是开始准备扩容. 但是之前没有做过这样的操作.心中有点怕怕的,如果数据丢了可咋整. 不管,先创建一个快照 ...

  2. 阿里云数据盘挂载和卸载

    我们在阿里云买了一个数据盘,如果要使用这个数据盘,首先我们得先进行数据盘的挂载. 数据盘的挂载 Setp1. 检查阿里云服务器数据盘情况 运行fdisk -l命令,检查当前VPS的数据硬盘情况 [ro ...

  3. 阿里云数据盘挂载完整过程

    1. 列出磁盘 fdisk -lu 2. 创建分区 输入fdisk /dev/vdb,然后依次根据提示,输入n,p,1,回车,回车,wq,保存退出. /dev/vdb是由执行fdisk -lu命令查询 ...

  4. 阿里云 数据盘挂载及卸载

    如果您在创建实例时选择了数据盘,在登录实例后,系统需要先格式化数据盘,然后挂载数据盘. 另外,您还可以根据业务需要,对数据盘进行多分区配置.建议使用系统自带的工具进行分区操作. 注意:云服务器 ECS ...

  5. linux 数据盘分区并挂载

    远程登陆后,使用fdisk -l查看磁盘状况 现在,要做的就是把数据盘vdb分区并挂载 [root@VM_189_110_centos ~]# fdisk /dev/vdb 进入fdisk命令,输入m ...

  6. 腾讯云服务器数据盘买多了,腾讯云Windows云服务器数据盘分区和格式化

    Windows2008_64位系统手动格式化小于2TB数据盘操作指引 新购买的Windows云服务器,数据盘未做分区和格式化,无法使用. 请根据以下步骤手动对数据盘进行分区以及格式化.暂不支持对Win ...

  7. 有限服务器延时计算_新建三座超级数据中心,增超百万台服务器 阿里云数据中心选址有何逻辑?...

    每经记者:刘春山 每经编辑:梁枭 今日(7月31日),阿里云正式宣布,其位于南通.杭州和乌兰察布的三座超级数据中心正式落成,陆续开服,新增超100万台服务器的计算力.加上之前的张北.河源,阿里云已经建 ...

  8. 阿里云数据中台 Quick Audience 智能用户增长正式发布

    简介:Quick Audience智能用户增长作为一站式消费者资产管理和运营平台,通过快速消费者数据接入,丰富的消费者洞察模型和策略配置,完成消费者多渠道触达,助力企业实现用户增长. -更多关于数智化 ...

  9. 阿里云数据中台全新产品DataTrust聚焦企业数据安全保障

    简介:DataTrust(隐私增强计算产品)是基于阿里云底层多项基础安全能力,经过阿里云数据中台丰富的客户业务实践,构建的一款为企业数据安全流通的产品. 随着包括零售.制造.金融等多行业数字化转型加速 ...

  10. 三只松鼠:阿里云数据中台基座上的多渠道、多业态生长

    简介:刚刚过去的2020年,对三只松鼠来说更像是一座认知分水岭,三只松鼠CEO章燎原坦言"要忘记流量时代,并习惯放缓增长",而随后的重要一步,就是以披荆斩棘的姿态进入数据中台建设新 ...

最新文章

  1. 童心未泯的 YOLO 之父,小马哥 Joseph Redmon 笑傲 CV 江湖记
  2. 打印机尚未链接到此计算机,win10系统无法连接打印机显示未指定设备的解决方法...
  3. Android底层开发之Audio HAL Android Audio Overview
  4. 进入正在运行的Docker容器的4种方式
  5. 部署nodejs项目到服务器的一些总结
  6. Windows 7里的计算器,中文版,给Vista和2008用吧
  7. Linux系统/网络管理
  8. 无废话ADO.NET 第三章 进行查询
  9. 72. 编辑距离(JavaScript)
  10. 一个随机数发生器(一)
  11. python怎么通过占位符_如何输入占位符?
  12. 分析数据包(Microsoft Visual Studio 2010)
  13. 使用vcpkg安装cgal前安装yasm报错
  14. pr导入无法打开磁盘上的文件_为什么用pr导入视频显示文件导入失败?
  15. java smtp.126.com_java实现邮件发送
  16. 国际信息研究学会专家杜彪:汉字识别是如何走上机器学习领域巅峰的?
  17. 英语美句-每日积累-03
  18. Python批量复制一个文件夹中的全部excel数据并粘贴至一个excel文件中-openpyxl模块
  19. POJ - 1789 Truck History (最小生成树)
  20. 如何复制360doc个人图书馆的文章?

热门文章

  1. feature tools:Python 中的自动化特征工程
  2. 极客大学架构师训练营 网络通信协议 非阻塞网络I/O NIO 数据库架构原理 第16课 听课总结
  3. Rosenbrock函数的梯度与海瑟矩阵
  4. 温度转换问题——从C到Python
  5. 不能使用sizeof计算的表达式
  6. Docker报错:Temporary failure in name resolutionProxy Authentication Required
  7. python Tk()、Frame()、TopLevel()用法
  8. java 文件流 追加_JAVA向文件中追加内容(转)
  9. 无线通信基础(二):高斯噪声中的检测
  10. Python搜索路径