# LAB - Moving a volume from one EC2 instance to the next

can Anyone explain me how to run this code step by step.

I cannot find pem file
lab

LAB - Moving a volume from one EC2 instance to the next

https://learn.kodekloud.com/user/courses/aws-solutions-architect-associate-certification/module/23e00d1f-6422-4fef-a9bf-e8f007be5514/lesson/ba93c990-3c45-4c75-9c29-e304c26adac9

Access the instance1 through SSH and run below command to create a filesystem of type xfs using the ebs volume attached.
Use lsblk for name of volume attached.

sudo mkfs -t xfs /dev/xvdf

Note: keypair file for instance1 is located at /home/rdskeypair.pem

somir@LAPTOP-QLJH61G9 MINGW64 ~
$ ssh -i /home/rdskeypair.pem [email protected]
Warning: Identity file /home/rdskeypair.pem not accessible: No such file or directory.
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

it’s where they say it is, but it’s only readable by root:

~ on ☁️  (us-east-1) ➜  pwd
/root

~ on ☁️  (us-east-1) ➜  cd /home/
bob/            rdskeypair.pem  ubuntu/         

~ on ☁️  (us-east-1) ➜  ls -l /home/
total 12
drwxr-x--- 1 bob    bob    4096 Aug 14 10:48 bob
-r-------- 1 root   root   1675 Aug 23 01:58 rdskeypair.pem
drwxr-x--- 2 ubuntu ubuntu 4096 May 30 02:05 ubuntu

so you’ll need to use sudo to get access to it.

Im getting this error while doing in the lab

https://learn.kodekloud.com/user/courses/aws-solutions-architect-associate-certification/module/23e00d1f-6422-4fef-a9bf-e8f007be5514/lesson/ba93c990-3c45-4c75-9c29-e304c26adac9

$ ssh -i /home/rdskeypair.pair [email protected]**
Warning: Identity file /home/rdskeypair.pair not accessible: No such file or directory.

Again: YOU DID NOT DO THAT AS ROOT!!! So the file is not accessible, as I believe is directory /home. not accessible. DO IT WITH SUDO!