2

@TOC

一、EVS云硬盘介绍

云硬盘(Elastic Volume Service)是一种为ECS、BMS等计算服务提供持久性块存储的服务,通过数据冗余和缓存加速等多项技术,提供高可用性和持久性,以及稳定的低时延性能。您可以对云硬盘做格式化、创建文件系统等操作,并对数据做持久化存储。
image.png

二、购买ECS云服务器

1.创建windows系统的ECS云主机

image.png

2.创建Linux系统的ECS云主机

image.png

三、创建EVS云硬盘

创建两块云硬盘,一块挂载windows使用,一块挂载linux使用

image.png

四、云硬盘挂载windows系统的ECS

1.挂载云硬盘windows

image.png

2.登录到windows的ECS云主机

image.png

3.查看磁盘列表

image.png

4.初始化磁盘

image.png

5.新建卷

image.png
image.png

6.查看新加卷

image.png

7.向磁盘写入数据

image.png

五、云硬盘挂载Linux系统的ECS

1.挂载到Linux系统的云主机

image.png

2.进入Linux云主机

image.png

3.查看磁盘列表

[root@ecs-b15f ~]# lsblk
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda    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/vdb
Welcome 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 table
Building a new DOS disklabel with disk identifier 0xb7e5d6cb.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-20971519, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): 
Using default value 20971519
Partition 1 of type Linux and of size 10 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

4.格式化磁盘


[root@ecs-b15f ~]# mkfs.ext4 /dev/vdb1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
655360 inodes, 2621184 blocks
131059 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2151677952
80 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

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 

5.挂载分区


[root@ecs-b15f ~]# mount /dev/vdb1 /data/
[root@ecs-b15f ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        486M     0  486M   0% /dev
tmpfs           496M     0  496M   0% /dev/shm
tmpfs           496M  6.8M  489M   2% /run
tmpfs           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]# ll
total 16
-rw-r--r-- 1 root root     0 Oct 21 21:39 file100
drwx------ 2 root root 16384 Oct 21 21:37 lost+found

六、云硬盘EVS快照

1.创建磁盘快照

image.png

2.查看快照列表

image.png

3.删除文件

[root@ecs-b15f data]# ls
file100  lost+found
[root@ecs-b15f data]# rm -rf file100
[root@ecs-b15f data]# ll
total 16
drwx------ 2 root root 16384 Oct 21 21:37 lost+found
[root@ecs-b15f data]# 

4.卸载分区

umount /data

5.卸载云硬盘

image.png

6.使用快照恢复磁盘

image.png

7.重新挂载linux云主机

image.png

8.查看数据恢复情况

[root@ecs-b15f ~]# mount /dev/vdb1 /data
[root@ecs-b15f ~]# cd /data/
[root@ecs-b15f data]# ls
file100  lost+found
[root@ecs-b15f data]# 

江湖有缘
106 声望5 粉丝