aws-samples / aws-iot-twinmaker-samples

Apache License 2.0
97 stars 77 forks source link

cloud9 resizing script out of date #157

Open mmarinm opened 4 months ago

mmarinm commented 4 months ago

Cloud 9 resizing script in cookiefactory v3 is not working

curl https://aws-data-analytics-workshops.s3.amazonaws.com/athena-workshop/scripts/cloud9\_resize.sh > cloud9\_resize.sh
sh cloud9\_resize.sh 20
df -h

There are several issues with script.

  1. the instance metadata service version 2 (IMDSv2) requires a session token to access the metadata.
  2. There is there's a problem with the filesystem on the specified partition, /dev/nvme0n1p1. Specifically, the error suggests that resize2fs is unable to find a valid superblock, here is the error:
    NOCHANGE: partition 1 is size 20946911. it cannot be grown
    resize2fs 1.46.5 (30-Dec-2021)
    resize2fs: Bad magic number in super-block while trying to open /dev/nvme0n1p1
    Couldn't find valid filesystem superblock.

    error indicates resize2fs is attempting to operate on a filesystem that it doesn't recognize, possibly because the partition is not using an ext2/3/4 filesystem. Cloud9 filesystem is XFS that resize2fs does not support.

I modified the script to include both fixes in src/workspaces/cookiefactoryv3/cdk folder and open PR