I have been trying to reduce the size of my Amazon Linux 1 AMI root volume using the procedure in this documentation (with some modifications made after failing to do so) and continuously run into errors with the step:
$ sudo grub-install --root-directory=/mnt/new-volume/ --force /dev/xvdf
This is legacy GRUB (Version 0.97-94.32.amzn1
)
I was getting the following error at first:
Unrecognized option `--force'
and as a result removed the --force
flag and jus tused:
$ sudo grub-install --root-directory=/mnt/new-volume/ /dev/xvdf
which has since resulted in:
/dev/xvdf does not have any corresponding BIOS drive
I have tried to create the BIOS boot partition using parted or fdisk following instructions mentioned in this thread but every method has led to the same failure. Please note that the specific instance type I am using (r5.large) renames the drives to corresponding "nvme*" names as noted in the lsblk output:
nvme0n1 259:3 0 200G 0 disk
├─nvme0n1p1 259:4 0 200G 0 part /
└─nvme0n1p128 259:5 0 1M 0 part
nvme1n1 259:0 0 40G 0 disk
├─nvme1n1p2 259:2 0 40G 0 part /mnt/new-volume
└─nvme1n1p1 259:1 0 1M 0 part
One article relevant to the error message was found in this Linux Questions post but this did not prove to resolve my issue. I've tried through chroot-ing into the partition and ran into the same issue and have tried using an intermediary Amazon Linux 1 or Amazon Linux 2 host but continue running into the issue.
I do note that this same issue occurs when using the root volume alone in Amazon Linux 1:
grub-install /dev/sda OR grub-install /dev/sda1
But regardless the new disk cannot be booted from unless it is listed as the secondary drive. Using the grub
command alone from the Legacy GRUB manual to install has failed as well. Am I looking into the wrong procedure to create a new smaller root volume or is there something I am missing from the steps above? Can provide further details as necessary.