aws EC2 挂载 其它卷 (aws EC2 系统配置出错,不能 ssh 连接时,需要启动一个新实例,去挂载 这个出错的卷,来修改卷里的错误配置)

aws EC2 系统配置出错,不能 ssh 连接时,需要启动一个新实例,去挂载 这个出错的卷,来修改卷里的错误配置。

1. 选择你的实例,右击停止

这里写图片描述

2. 选择实例对应的卷,右击断开卷

这里写图片描述

3. 启动新实例

这里写图片描述

4. 选择老卷,点击连接卷

这里写图片描述

5. 点击实例输入框,选择新实例

这里写图片描述

6. 设备输入: /dev/xvdf:并点击附加

这里写图片描述

7. 附加过之后,ssh 连接新的实例,并输入挂载命令

请不要忘记编辑文件后,卸除卷(使用umount /mnt)

$ sudo -i
# mount /dev/xvdf1 /mnt
# cd /mnt/

8. 卸载卷命令

请不要忘记编辑文件后,卸除卷(使用umount /mnt)

umount /mnt

9. 挂载回原来实例时,设备输入 /dev/sda1

/dev/sda1

看第 6 步,图。


提示,如果系统还要其他硬盘,重启需要重新挂载:
如:

[ec2-user@mg2 /]$ sudo fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own dion.

Disk /dev/xvda: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt

#         Start          End    Size  Type            Name
 1         4096    104857566     50G  Linux filesyste Linux
128         2048         4095      1M  BIOS boot parti BIOS Boot Partition

Disk /dev/xvdf: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[ec2-user@mg2 /]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        7.9G   64K  7.9G   1% /dev
tmpfs           7.9G     0  7.9G   0% /dev/shm
/dev/xvda1       50G   15G   35G  29% /
[ec2-user@mg2 /]$ sudo mount /dev/xvdf /data
[ec2-user@mg2 /]$ ll /data/
total 28
drwxr-xr-x 3 root     root      4096 Jun  5 15:38 app
drwx------ 2 root     root     16384 Jun  5 15:11 lost+found
drwxr-xr-x 3 ec2-user ec2-user  4096 Sep  5 15:54 mha
drwxr-xr-x 3 mysql    mysql     4096 Sep  5 16:12 mysql

尊重原创:https://blog.csdn.net/hanshileiai/article/details/50417418

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值