简体   繁体   中英

Reduce partition size in AWS EC2 instances

I created an EC2 instance on Amazon AWS but I need to create a new partition (/var/log), I never had the opportunity to perform this task so I'm a little afraid to do it.

Filesystem      Size  Used Avail Use% Mounted on
udev            3.7G     0  3.7G   0% /dev
tmpfs           761M  784K  761M   1% /run
/dev/nvme0n1p1   31G  2.9G   29G  10% /
tmpfs           3.8G  8.0K  3.8G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/loop0       34M   34M     0 100% /snap/amazon-ssm-agent/3552
/dev/loop1       25M   25M     0 100% /snap/amazon-ssm-agent/4046
/dev/loop2      100M  100M     0 100% /snap/core/10908
/dev/loop3      111M  111M     0 100% /snap/core/12603
/dev/loop4       56M   56M     0 100% /snap/core18/1997
/dev/loop5       56M   56M     0 100% /snap/core18/2284

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0         7:0    0  33.3M  1 loop /snap/amazon-ssm-agent/3552
loop1         7:1    0    25M  1 loop /snap/amazon-ssm-agent/4046
loop2         7:2    0  99.2M  1 loop /snap/core/10908
loop3         7:3    0 110.5M  1 loop /snap/core/12603
loop4         7:4    0  55.5M  1 loop /snap/core18/1997
loop5         7:5    0  55.5M  1 loop /snap/core18/2284
nvme0n1     259:1    0    32G  0 disk 
└─nvme0n1p1 259:2    0    32G  0 part /

I need to remove 20 GB from the partition (/) and assign it to a new one (/dev/sdb)

Any helps? Regards,

Well, since it's AWS, and you know how to do it in other server, why not creating new EC2 instance and experiment on it. If not, try this:

  1. Go to EC2 console, and go to Elastic Block Store > Volumes
  2. Check your EBS Volumes
  3. Go to Action modify volumes, and change the volume as you desire then save and wait until it's done.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM