-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathec2 space
46 lines (35 loc) · 1.62 KB
/
ec2 space
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
**************************************************************************************************************** clean up you can do before resize volume
cd /root
sudo du -h --max-depth=1
sudo du -h --max-depth=1 / | sort -rh
sudo rm -r ~/.cache/*
sudo rm -r ~/.cache/*
cd /var/.log/ # all historical log files are here
**************************************************************************************************************** resize volume
go to ec2 tab - go to specific volume tab - modify volume
**************************************************************************************************************** extend file system
after resize the volume, you need to extend the file system of EBS volumes
sudo lsblk
--->
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme1n1 259:0 0 30G 0 disk /data
nvme0n1 259:1 0 16G 0 disk
└─nvme0n1p1 259:2 0 8G 0 part /
└─nvme0n1p128 259:3 0 1M 0 part
# if you are Nitro Instance example
sudo growpart /dev/nvme0n1 1
sudo lsblk
--->
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme1n1 259:0 0 30G 0 disk /data
nvme0n1 259:1 0 16G 0 disk
└─nvme0n1p1 259:2 0 16G 0 part /
└─nvme0n1p128 259:3 0 1M 0 part
df -hT
--->
Filesystem Type Size Used Avail Use% Mounted on
/dev/nvme0n1p1 xfs 8.0G 1.6G 6.5G 20% /
/dev/nvme1n1 xfs 8.0G 33M 8.0G 1% /data
# [XFS file system] Use the xfs_growfs command and specify the mount point of the file system that you noted in the previous step.
sudo xfs_growfs -d /
# Use the df -hT command and confirm that the file system size is equal to the volume size.