Skip to content

help detach the EBS volume from deprecated SageMaker Notebook instance

0

We have several deprecated SageMaker notebook instances whose EBS volumes are not directly visible to us. We want to recover these instances and use them with new notebook instances. We can't restart the notebooks. Please advise.

asked a year ago210 views

2 Answers
0

Unfortunately, recovering EBS volumes from deprecated SageMaker notebook instances that cannot be started presents a significant challenge. SageMaker notebook instances use EBS volumes to store data (mounted to the /home/ec2-user/SageMaker directory), but these volumes cannot be accessed directly from outside the SageMaker notebook instance environment.

When a SageMaker notebook instance cannot be started, especially deprecated ones like notebook-al2-v2, your options for data recovery are limited. The EBS volumes used by SageMaker are managed by the service and don't appear in your regular EBS volume list, which is why you can't see them.

Here are your potential options:

  1. Contact AWS Support: You could raise a case with AWS Support requesting a grace period for the deprecated instances. If granted, you might be able to temporarily start the instances to migrate your data.

  2. If you're able to get the instances running, you can take backup snapshots of the EBS volumes to S3 and then use those to restore your data to new instances.

For future reference, to avoid this situation:

  • Use code repositories to maintain your code and notebooks
  • Store data in separate storage services like Amazon S3
  • Implement regular backups using either the notebook terminal or lifecycle configuration scripts
  • Consider implementing disaster recovery solutions for critical SageMaker workloads

When SageMaker notebook instances are running normally, the service preserves the ML storage volume even when you stop an instance. However, with deprecated instances that cannot be started, accessing this preserved storage becomes problematic.
Sources
Files recovery in Sagemaker Deprecated instance | AWS re:Post
how to restore EBS of AWS Sagemaker notebook instance | AWS re:Post
StopNotebookInstance - Amazon SageMaker

answered a year ago

0
  1. Find the disks
  • Go to the EC2 → Volumes section in the AWS console (same region as your notebooks).
  • Look for volumes with tags like: aws:sagemaker:NotebookInstanceName = <your-notebook-name>
  • That’s the data from your old notebook.
  1. Detach them from the old instance
  • If the old notebook still shows an “in use” attachment, just stop it and detach the volume.
  • Once detached, the state will change to available.
  1. Reuse them in a new notebook You’ve got two options here:
  • Option A (replace the root disk): Create a fresh SageMaker notebook. Stop it, detach its default root volume, and attach your old disk in its place (as /dev/xvda). Restart it should boot with all your old stuff.

  • Option B (mount as extra disk): Create a new notebook as usual. Attach the old disk as a secondary device (like /dev/sdf). SSH into the notebook, run: sudo mkdir /mnt/old sudo mount /dev/xvdf1 /mnt/old

Now you can copy files back.

  1. (Optional but smart) Take a snapshot of the old volume before messing with it. That way, even if something goes wrong, you still have a backup.

Things to Watch Out For If the volume is encrypted with your own KMS key, make sure the new notebook role has access to that key. Always double-check you’re working in the same region.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.