@TOC
一、EVS云硬盘介绍
云硬盘(Elastic Volume Service)是一种为ECS、BMS等计算服务提供持久性块存储的服务,通过数据冗余和缓存减速等多项技术,提供高可用性和持久性,以及稳固的低时延性能。您能够对云硬盘做格式化、创立文件系统等操作,并对数据做长久化存储。
二、购买ECS云服务器
1.创立windows零碎的ECS云主机
2.创立Linux零碎的ECS云主机
三、创立EVS云硬盘
创立两块云硬盘,一块挂载windows应用,一块挂载linux应用
四、云硬盘挂载windows零碎的ECS
1.挂载云硬盘windows
2.登录到windows的ECS云主机
3.查看磁盘列表
4.初始化磁盘
5.新建卷
6.查看新加卷
7.向磁盘写入数据
五、云硬盘挂载Linux零碎的ECS
1.挂载到Linux零碎的云主机
2.进入Linux云主机
3.查看磁盘列表
[root@ecs-b15f ~]# lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTvda 253:0 0 40G 0 disk ââvda1 253:1 0 40G 0 part /vdb 253:16 0 10G 0 disk
3.磁盘分区
[root@ecs-b15f ~]# fdisk /dev/vdbWelcome 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 tableBuilding a new DOS disklabel with disk identifier 0xb7e5d6cb.Command (m for help): nPartition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): pPartition number (1-4, default 1): First sector (2048-20971519, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): Using default value 20971519Partition 1 of type Linux and of size 10 GiB is setCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.
4.格式化磁盘
[root@ecs-b15f ~]# mkfs.ext4 /dev/vdb1mke2fs 1.42.9 (28-Dec-2013)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks655360 inodes, 2621184 blocks131059 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=215167795280 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done
5.挂载分区
[root@ecs-b15f ~]# mount /dev/vdb1 /data/[root@ecs-b15f ~]# df -hFilesystem Size Used Avail Use% Mounted ondevtmpfs 486M 0 486M 0% /devtmpfs 496M 0 496M 0% /dev/shmtmpfs 496M 6.8M 489M 2% /runtmpfs 496M 0 496M 0% /sys/fs/cgroup/dev/vda1 40G 2.1G 36G 6% /tmpfs 100M 0 100M 0% /run/user/0/dev/vdb1 9.8G 37M 9.2G 1% /data
6.向磁盘写入数据
[root@ecs-b15f ~]# cd /data/[root@ecs-b15f data]# touch file100[root@ecs-b15f data]# lltotal 16-rw-r--r-- 1 root root 0 Oct 21 21:39 file100drwx------ 2 root root 16384 Oct 21 21:37 lost+found
六、云硬盘EVS快照
1.创立磁盘快照
2.查看快照列表
3.删除文件
[root@ecs-b15f data]# lsfile100 lost+found[root@ecs-b15f data]# rm -rf file100[root@ecs-b15f data]# lltotal 16drwx------ 2 root root 16384 Oct 21 21:37 lost+found[root@ecs-b15f data]#
4.卸载分区
umount /data
5.卸载云硬盘
6.应用快照复原磁盘
7.从新挂载linux云主机
8.查看数据恢复状况
[root@ecs-b15f ~]# mount /dev/vdb1 /data[root@ecs-b15f ~]# cd /data/[root@ecs-b15f data]# lsfile100 lost+found[root@ecs-b15f data]#