![]() ![]() Later steps are to be done from CLI of your Linux-lab. Create an account on Amazon Web Services and download rootkey.csv file from Security Credentials section of your account.At the end output of desired commands are pasted. These are generalized steps for creating any instance on AWS EC2. Steps: Follow the steps written below in similar order. This blog helps in learning how we can attach a new volume to a linux machine, create a filesystem on it and how we can use the mounted filesystem as regular directory in OS. Umount /dev/xvdf /mnt/example (Amazon-linux)ĩ.Exit from the instance and detach the volume using below command Īws ec2 detach-volume -volume-id vol-1234abcdġ0.Now attach the volume to other instance of same OS, if you have detached volume from NetBSD then attach it to other NetBSD instance using command shown below ġ1.Now login to your instance where you attached the volume through ssh and mount the volume as shown in step 6 as per your OS.ġ2.You can verify if the volume is same by listing files under mounted directory through "ls" command. Mount /dev/xvdf /mnt/example (Amazon-linux)ħ.Now create a text file in the mounted directory so that when we detach the volume and attach it to other instance, we get to verify whether the volume attached is the same or not Ĩ.Now unmount the filesystem using commands shown below The commands to mount filesystem is as follows Create a directory (optional) in "/mnt" and mount the newly created filesystem on the created directory. In every linux system "/mnt" is the generic mount point under which we can mount our filesystem or devices. (Creates ext4 filesystem on the given disk block on Amazon linux)Ħ.Mounting is the process by which we make filesystem available to system. It is optional to lable disk using disklabel(8)) (Creates a default bsd filesystem on the given volume. ![]() These command will show the recently attached volumes with device locationĥ.Now create a filesystem on newly attached partition, commands to create filesystem on NetBSD and Amazon-Linux are shown below, Where /dev is directory containing special device files and /dev/sdf indicates SCSI drive exposed to instanceĤ.Now Login to your desired OS instance using SSH and run command " dmesg" to obtain information about the hardwares on system in NetBSD, and " cat /proc/partitions" to obtain information about newly added partition in Amazon-linux. The availability zone can be found from "aws ec2 describe-instances" command.Ģ.Now, we can check the available volumes by using below command, the newly created volume will be shown as "available"ģ.Now, attach the newly created volume to desired OS instance by using below commandĪws ec2 attach-volume -volume-id vol-1234abcd -instance-id i-abcd1234 -device /dev/sdf ![]()
0 Comments
Leave a Reply. |