How to decrease size of a root volume EC2 Amazon Linux2?

0

I want to decrease the size of a root volume in an EC2 running Amazon Linux2. I have followed some posts from internet and a post from here but it does not work for Amazon Linux2.

hai
질문됨 2년 전469회 조회
1개 답변
2

Reducing the size of a volume is difficult (something that is inferred from the complexity of the instructions in the other post). That's because the operating system has already allocated the blocks on the disk to whatever file/block index mechanism is being used - so this isn't restricted just to Amazon Linux 2.

In short, to reduce the size of a volume you must create a new volume; copy all of the files across to it; and then (in the case of the boot volume) ensure that whatever boot mechanism is required by the operating system is present.

I think it would be a whole lot easier (and less risky) to create a new instance with a smaller boot volume then copy the files across.

profile pictureAWS
전문가
답변함 2년 전
  • thank you, I agree. 1) the copy part with rsync is OK for me. 2) the boot mechanism with grub-install, device UUID, fstab is not easy.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠