问题
我有一台带有 1 TB 磁盘的物理机,它是通过命令行复制的日,磁盘已导入 S3 并成功转换为 AMI。但现在我遇到了成本问题,需要将这台机器减少到 30 GB。我在网上寻找解决方案,但找到的所有教程都没有引用 lvm 分区的案例。
我尝试过
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
有用的信息
因此: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