欢迎访问鸿雪径,这里介绍软件相关技术、动态以及鸿雪径杂谈,如有技术合作请与站长联系!邮费网 易食烤吧 特产大全网
首页 > Linux/Unix > 阿里云linux下的云磁盘(数据盘)挂载步骤

阿里云linux下的云磁盘(数据盘)挂载步骤

发布时间:2014-09-23 作者: 点击:265

   阿里云默认购买后是没有挂载数据盘的,这个时候我们就需要在第一次启动系统后进行磁盘挂载操作,有两种方法,我们购买的阿里云服务器默认都提供了一个auto_fdisk.sh,直接执行这个就自动挂载数据盘了。还有一个方法就是自己手动一步一步挂载,这里进行一下介绍。

   首先我们通过 fdisk -l 查看磁盘情况

然后我们开始给/dev/xvdb分区

可以在管理台查看挂载点,如下图所示:

执行fdisk /dev/xvdb

Command (m for help): m  (输入m进行帮助提示)

Command action

   a   toggle a bootable flag

   b   edit bsd disklabel

   c   toggle the dos compatibility flag

   d   delete a partition

   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): p   (我们先查看一下)


Disk /dev/xvdb: 85.8 GB, 85899345920 bytes

224 heads, 56 sectors/track, 13374 cylinders

Units = cylinders of 12544 * 512 = 6422528 bytes


    Device Boot      Start         End      Blocks   Id  System


Command (m for help): n  (创建一个分区)

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1  (第几个就输入几)

First cylinder (1-13374, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-13374, default 13374):

Using default value 13374


Command (m for help): p (查看一下分区情况,看是否配置正确)


Disk /dev/xvdb: 85.8 GB, 85899345920 bytes

224 heads, 56 sectors/track, 13374 cylinders

Units = cylinders of 12544 * 512 = 6422528 bytes


    Device Boot      Start         End      Blocks   Id  System

/dev/xvdb1               1       13374    83881700   83  Linux


Command (m for help): w   (写入分区)

The partition table has been altered!


Calling ioctl() to re-read partition table.

Syncing disks.

-------------------

分区完毕进行格式化,使用mke2fs命令

[root@iZ28z295fu9Z ~]# mke2fs -j /dev/xvdb1

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

10485760 inodes, 20970425 blocks

1048521 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

640 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

        4096000, 7962624, 11239424, 20480000


Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done


This filesystem will be automatically checked every 30 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

----------------------

之后就是进行挂载了,vi /etc/fstab

/dev/xvdb1               /webservers             ext3    defaults        0 0

到结尾,编辑后的/etc/fstab如下:

建立挂载点目录  mkdir /webservers

执行 mount -a 使配置生效


可能碰到的问题:

mount: wrong fs type, bad option, bad superblock on /dev/sdd

这个时候需要重新检查是否正常分区并格式化了,或者格式化的格式与挂载生命的格式不一致。


更多关于 aliyun,mount,云磁盘,数据盘,fdisk 的信息
本站部分文章转载于网上,版权归原作者所有。如果侵犯您的权益,请Email和本站联系!
鸿雪径 www.HongXueJing.com  冀ICP备07017673号-4