0

Problem

I have a physical machine with 1 TB disk and it was copied via command line dd, the disk was imported into S3 and successfully converted to AMI. But now I have a cost problem and I need to reduce this machine to 30 GB. I am looking for a solution on the internet but all tutorials found do not cite cases with lvm partitions.

What i tried

https://n2ws.com/blog/how-to-guides/how-to-reduce-the-size-of-an-ebs-volume

https://medium.com/@andtrott/how-to-downsize-a-root-ebs-volume-on-aws-ec2-amazon-linux-727c00148f61

https://medium.com/@rahulian/how-to-reduce-volume-of-an-aws-ec2-instance-d493ec891698

How to reduce AWS EBS root volume size?

Useful information

SO: CENTOS 5.9

[root @] # fdisk -l

Disk / dev / hda: 1000.7 GB, 1000727379968 bytes
255 heads, 63 sectors / track, 121664 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Boot Start End Blocks Id System Device
/ dev / hda1 * 1 13 104391 83 Linux
/ dev / hda2 14 121601 976655610 8e Linux LVM

[root @] # df -h
System File Us Usa Disp Usage% Mounted on
/ dev / mapper / VolGroup00-LogVol00
                      897G 4.4G 847G 1% /
/ dev / hda1 99M 17M 78M 18% / boot
tmpfs 501M 0 501M 0% / dev / shm
Lucas
  • 1
  • 1
    Rather than link to each thing you've tried, can you please list them and tell us why they didn't work for you. That will help us understand the problem better. – Tim Sep 10 '19 at 03:27
  • 2
    If you don't know enough to shrink an LVM partition, you are probably better off building a new machine and copying the appropriate data across. Disk operations of this nature carry risk if you do know what you are doing, and if you don't can lead to a world of hurt. If you decide to progress regardless, LVM works the same way regardless of the underlying provider - research how to shrink an LVM. – davidgo Sep 10 '19 at 04:55
  • Guys first thank you very much for the answers, let's go by parts: The error is simply EC2 does not start, no logging - I believe the error is because I did not create an lvm for copying, instead I created a primary partition and copied its contents to the other side without regard to /boot and swap, the next step was to copy the contents from one disk to another and change the label. And about creating a new machine is out of the question because I do not have the original data in documentation to install applications, this machine is very old. – Lucas Sep 11 '19 at 11:16

0 Answers0