0% found this document useful (0 votes)
10 views3 pages

AWS CLI: Creating and Managing EBS Volumes

Uploaded by

rosemoses765
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

AWS CLI: Creating and Managing EBS Volumes

Uploaded by

rosemoses765
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

, #_

~\_ ####_ Amazon Linux 2


~~ \_#####\
~~ \###| AL2 End of Life is 2025-06-30.
~~ \#/ ___
~~ V~' '->
~~~ / A newer version of Amazon Linux is available!
~~._. _/
_/ _/ Amazon Linux 2023, GA and supported until 2028-03-15.
_/m/' [Link]

[ec2-user@ip-10-1-11-225 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 465M 0 465M 0% /dev
tmpfs 473M 0 473M 0% /dev/shm
tmpfs 473M 408K 472M 1% /run
tmpfs 473M 0 473M 0% /sys/fs/cgroup
/dev/nvme0n1p1 8.0G 1.6G 6.4G 20% /
tmpfs 95M 0 95M 0% /run/user/1000
[ec2-user@ip-10-1-11-225 ~]$ sudo mkfs -t ext3 /dev/sdf
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
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376

Allocating group tables: done


Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

[ec2-user@ip-10-1-11-225 ~]$ sudo mkdir /mnt/data-store


[ec2-user@ip-10-1-11-225 ~]$ sudo mount /dev/sdf /mnt/data-store
[ec2-user@ip-10-1-11-225 ~]$ echo "/dev/sdf /mnt/data-store ext3 defaults,noatime
1 2" | sudo tee -a /etc/fstab
/dev/sdf /mnt/data-store ext3 defaults,noatime 1 2
[ec2-user@ip-10-1-11-225 ~]$ cat /etc/fstab
#
UUID=a1240874-6544-4673-bbbd-19b561fbcb84 / xfs defaults,noatime
1 1
/dev/sdf /mnt/data-store ext3 defaults,noatime 1 2
[ec2-user@ip-10-1-11-225 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 465M 0 465M 0% /dev
tmpfs 473M 0 473M 0% /dev/shm
tmpfs 473M 408K 472M 1% /run
tmpfs 473M 0 473M 0% /sys/fs/cgroup
/dev/nvme0n1p1 8.0G 1.6G 6.4G 20% /
tmpfs 95M 0 95M 0% /run/user/1000
/dev/nvme1n1 975M 60K 924M 1% /mnt/data-store
[ec2-user@ip-10-1-11-225 ~]$ sudo sh -c "echo some text has been written >
/mnt/data-store/[Link]"
[ec2-user@ip-10-1-11-225 ~]$ cat /mnt/data-store/[Link]
some text has been written
[ec2-user@ip-10-1-11-225 ~]$ sudo rm /mnt/data-store/[Link]
[ec2-user@ip-10-1-11-225 ~]$ ls /mnt/data-store/[Link]
ls: cannot access /mnt/data-store/[Link]: No such file or directory
[ec2-user@ip-10-1-11-225 ~]$ sudo mkdir /mnt/data-store2
[ec2-user@ip-10-1-11-225 ~]$ sudo mount /dev/sdg /mnt/data-store2
[ec2-user@ip-10-1-11-225 ~]$ ls /mnt/data-store2/[Link]
/mnt/data-store2/[Link]
[ec2-user@ip-10-1-11-225 ~]$ ls
[ec2-user@ip-10-1-11-225 ~]$ aws ec2 create-volume --size 80 --availability-zone
us-east-1a --volume-type gp2
You must specify a region. You can also configure your region by running "aws
configure".
[ec2-user@ip-10-1-11-225 ~]$ aws configure
AWS Access Key ID [None]: aws ec2 describe-volumes --volume-ids vol-
1234567890abcdef0
AWS Secret Access Key [None]: ^C
[ec2-user@ip-10-1-11-225 ~]$ aws ec2 describe-volumes --volume-ids vol-
1234567890abcdef0
You must specify a region. You can also configure your region by running "aws
configure".
[ec2-user@ip-10-1-11-225 ~]$ aws ec2 attach-volume --volume-id vol-
1234567890abcdef0 --instance-id i-01474ef662b89480 --device /dev/sdf
You must specify a region. You can also configure your region by running "aws
configure".
[ec2-user@ip-10-1-11-225 ~]$ aws ec2 create-snapshot --volume-id vol-
1234567890abcdef0 --description "This is my root volume snapshot"
You must specify a region. You can also configure your region by running "aws
configure".
[ec2-user@ip-10-1-11-225 ~]$ aws ec2 copy-snapshot --source-region us-west-2 --
source-snapshot-id snap-1234567890abcdef0 --region us-east-1 --description "This is
my copied snapshot"
Unable to locate credentials. You can configure credentials by running "aws
configure".
[ec2-user@ip-10-1-11-225 ~]$ aws ec2 create-volume --size 80 --availability-zone
us-east-1a --volume-type gp2 --snapshot-id <snapshot_id>
-bash: syntax error near unexpected token `newline'
[ec2-user@ip-10-1-11-225 ~]$ aws ec2 describe-volumes --volume-ids vol-
0c108c43c627cb26d
You must specify a region. You can also configure your region by running "aws
configure".
[ec2-user@ip-10-1-11-225 ~]$ aws dlm create-default-role
Unable to locate credentials. You can configure credentials by running "aws
configure".
[ec2-user@ip-10-1-11-225 ~]$ aws dlm create-lifecycle-policy \
> --description "My backup policy" \
> --state ENABLED \
> --execution-role-arn
arn:aws:iam::197757065544:role/AWSDataLifecycleManagerDefaultRole \
> --policy-details [Link]

Error parsing parameter '--policy-details': Unable to load paramfile


[Link] [Errno 2] No such file or directory:
'[Link]'
[ec2-user@ip-10-1-11-225 ~]$ aws dlm get-lifecycle-policy --policy-id policy-
0b0ac162276313459
You must specify a region. You can also configure your region by running "aws
configure".
[ec2-user@ip-10-1-11-225 ~]$

You might also like