Back up your data by using a snapshot
This page shows you how to back up data stored on your Vertex AI Workbench user-managed notebooks instance by creating a snapshot.
The data on your instance is stored on a zonal persistent disk. You can create and use snapshots of this disk to back up your data, create a recurring backup schedule, and restore data to a new instance.
Create a snapshot
You can create snapshots from disks even while they are attached to running instances. Snapshots are global resources, so you can use them to restore data to a new disk or instance within the same project. You can also share snapshots across projects.
Console
-
In the Google Cloud console, go to the VM instances page.
Go to VM instances
The remaining steps will appear automatically in the Google Cloud console. - Select the project that contains your VM instances.
- In the Name column, click the name of the VM that has the disk to back up.
-
In
Storage :- To back up the boot disk, in the Boot disk section, click the Name of the boot disk.
- To back up an attached data disk, in Additional disks, click the Name of the disk.
-
Click
Create snapshot . -
In Name, enter a unique name to help identify the purpose of the snapshot, for example:
boot-disk-snapshot
attached-data-disk-snapshot
-
In Type, the default is a standard snapshot. Standard snapshots are
best for long-term back up and disaster recovery.
Choose Archive snapshot to create a more cost-efficient backup than standard snapshots, but with a longer data recovery time.
For more information, see Snapshot type comparison.
-
In the Location section, choose your snapshot storage location. The predefined or customized default location defined in your snapshot settings is automatically selected. Optionally, you can override the snapshot settings and store your snapshots in a custom storage location by doing the following:
-
Choose the type of storage location that you want for your snapshot.
-
Choose Multi-regional
for higher availability at a higher cost.
- Choose Regional snapshots for more control over the physical location of your data at a lower cost.
-
Choose Multi-regional
for higher availability at a higher cost.
-
In the Select location field, select the specific region or multi-region that you want to use. To use the region or multi-region that is closest to your source disk, choose a location from the section titled Based on disk's location.
-
- To create a snapshot, click Create.
gcloud
-
In the Google Cloud console, activate Cloud Shell.
At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.
Create your snapshot using the storage location policy defined by your snapshot settings or using an alternative storage location of your choice. For more information, see Choose your snapshot storage location. You must specify a snapshot name. The name must be 1-63 characters long, and comply with RFC 1035.
To create a snapshot of a Persistent Disk volume in the predefined or customized default location configured in your snapshot settings, use the
gcloud compute snapshots create
command.gcloud compute snapshots create SNAPSHOT_NAME \ --source-disk SOURCE_DISK \ --snapshot-type SNAPSHOT_TYPE \ --source-disk-zone SOURCE_DISK_ZONE
Alternatively, to override the snapshot settings and create a snapshot in a custom storage location, include the
--storage-location
flag to indicate where to store your snapshot:gcloud compute snapshots create SNAPSHOT_NAME \ --source-disk SOURCE_DISK \ --source-disk-zone SOURCE_DISK_ZONE \ --storage-location STORAGE_LOCATION \ --snapshot-type SNAPSHOT_TYPE
Replace the following:
- SNAPSHOT_NAME: A name for the snapshot.
- SOURCE_DISK: The name of the zonal Persistent Disk volume from which you want to create a snapshot.
- SNAPSHOT_TYPE: The snapshot type, either STANDARD or ARCHIVE. If a snapshot type is not specified, a STANDARD snapshot is created. Choose Archive for more cost-efficient data retention.
- SOURCE_DISK_ZONE: The zone of the zonal Persistent Disk volume from which you want to create a snapshot.
- STORAGE_LOCATION: For custom storage locations, this is the Cloud Storage multi-region or the Cloud Storage region where you want to store your snapshot. You can specify only one storage location.
Use the
--storage-location
flag only when you want to override the predefined or customized default storage location configured in your snapshot settings.
The gcloud CLI waits until the operation returns a status of
READY
orFAILED
, or reaches the maximum timeout and returns the last known details of the snapshot.
Terraform
To create a snapshot of the zonal persistent disk, use the
google_compute_snapshot
resource.
To learn how to apply or remove a Terraform configuration, see Basic Terraform commands.
API
Create your snapshot in the storage location policy defined by your snapshot settings or using an alternative storage location of your choice. For more information, see Choose your snapshot storage location.
To create your snapshot in the predefined or customized default location configured in your snapshot settings, make a
POST
request to thesnapshots.insert
method:POST https://compute.googleapis.com/compute/v1/projects/DESTINATION_PROJECT_ID/global/snapshots { "name": SNAPSHOT_NAME "sourceDisk": "projects/SOURCE_PROJECT_ID/zones/SOURCE_ZONE/disks/SOURCE_DISK_NAME "snapshotType": SNAPSHOT_TYPE }
Replace the following:
- DESTINATION_PROJECT_ID: The ID of project in which you want to create the snapshot.
- SNAPSHOT_NAME: A name for the snapshot.
- SOURCE_PROJECT_ID: The ID of the source disk project.
- SOURCE_ZONE: The zone of the source disk.
- SOURCE_DISK_NAME: The name of the persistent disk from which you want to create a snapshot.
- SNAPSHOT_TYPE: The snapshot type, either STANDARD or ARCHIVE. If a snapshot type is not specified, a STANDARD snapshot is created.
Alternatively, to override the snapshot settings and create a snapshot in a custom storage location, make a
POST
request to thesnapshots.insert
method and include thestorageLocations
property in your request:POST https://compute.googleapis.com/compute/v1/projects/DESTINATION_PROJECT_ID/global/snapshots { "name": SNAPSHOT_NAME "sourceDisk": "projects/SOURCE_PROJECT_ID/zones/SOURCE_ZONE/disks/SOURCE_DISK_NAME "snapshotType": SNAPSHOT_TYPE "storageLocations": STORAGE_LOCATION }
Replace the following:
- DESTINATION_PROJECT_ID: The ID of project in which you want to create the snapshot.
- SNAPSHOT_NAME: A name for the snapshot.
- SOURCE_PROJECT_ID: The ID of the source disk project.
- SOURCE_ZONE: The zone of the source disk.
- SOURCE_DISK_NAME: The name of the persistent disk from which you want to create a snapshot.
- SNAPSHOT_TYPE: The snapshot type, either STANDARD or ARCHIVE. If a snapshot type is not specified, a STANDARD snapshot is created.
STORAGE_LOCATION: The Cloud Storage multi-region or the Cloud Storage region where you want to store your snapshot. You can specify only one storage location.
Use the
storageLocations
parameter only when you want to override the predefined or customized default storage location configured in your snapshot settings.
Go
Go
Before trying this sample, follow the setup instructions in the Compute Engine quickstart using client libraries.To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
Java
Before trying this sample, follow the setup instructions in the Compute Engine quickstart using client libraries.To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
Node.js
Before trying this sample, follow the setup instructions in the Compute Engine quickstart using client libraries.To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
Python
Before trying this sample, follow the setup instructions in the Compute Engine quickstart using client libraries.To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Schedule a recurring backup
When you create a snapshot schedule, you create a resource policy that you can apply to one or more persistent disks. You can create snapshot schedules in the following ways:
- Create a snapshot schedule and then attach it to an existing persistent disk.
- Create a new persistent disk with a snapshot schedule.
A snapshot schedule includes the following properties:
- Schedule name
- Schedule description
- Snapshot frequency (hourly, daily, weekly)
- Snapshot start time
- Region where the snapshot schedule is available
- Source disk deletion policy for handling auto-generated snapshots if the source disk is deleted
- Retention policy to define how long to keep snapshots that are generated from the snapshot schedule
Restrictions
- A persistent disk can have at most 10 snapshot schedules attached to it at a time.
- You cannot create archive snapshots using a snapshot schedule.
- You can create a maximum of 1,000 in-use snapshot schedules per region.
- Snapshot schedules apply only in the project that they were created in. Snapshot schedules cannot be used in other projects or organizations.
- You might need to request an increase in resource quota through the console if you require additional resources in your region.
- You cannot delete a snapshot schedule if it is attached to a disk. You must detach the schedule from all disks, then delete the schedule.
- You can update an existing snapshot schedule to change the description, schedule, and labels. To update other values for a snapshot schedule, you must delete the snapshot schedule and create a new one.
- For persistent disks that use a customer-supplied encryption key (CSEK), you can't create snapshot schedules.
- For persistent disks that use a customer-managed encryption key (CMEK), all snapshots created with a snapshot schedule are automatically encrypted with the same key.
Create a schedule
Create a snapshot schedule for your persistent disks using the Google Cloud console,
Google Cloud CLI, or the Compute Engine API. You must create your snapshot
schedule in the same region where your persistent disk resides. For example, if
your persistent disk resides in zone us-west1-a
, your snapshot schedule must
reside in the us-west1
region. For more information, see
Choose a storage location.
Console
-
In the Google Cloud console, go to the VM instances page.
Go to VM instances
The remaining steps will appear automatically in the Google Cloud console. - Select the project that contains your VM instances.
- In the Name column, click the name of the VM that has the persistent disk to create a snapshot schedule for.
-
In
Storage , click the name of the Boot disk or the Additional disk to create a snapshot schedule for. - Click Edit. You might need to click the More actions menu and then Edit.
- In Snapshot schedule, choose Create a schedule.
-
In Name, enter one of the following names for the snapshot schedule:
boot-disk-snapshot-schedule
attached-persistent-disk-snapshot-schedule
-
In the Location section, choose your snapshot storage location. The predefined or customized default location defined in your snapshot settings is automatically selected. Optionally, you can override the snapshot settings and store your snapshots in a custom storage location by doing the following:
-
Choose the type of storage location that you want for your snapshot.
-
Choose Multi-regional
for higher availability at a higher cost.
- Choose Regional snapshots for more control over the physical location of your data at a lower cost.
-
Choose Multi-regional
for higher availability at a higher cost.
-
In the Select location field, select the specific region or multi-region that you want to use. To use the region or multi-region that is closest to your source disk, select Based on disk's location.
-
- To finish creating the snapshot schedule, click Create.
- To attach this snapshot schedule to the persistent disk, click Save.
gcloud
To create a snapshot schedule for persistent disks, use the
compute resource-policies create snapshot-schedule
gcloud
command. Set your schedule frequency to hourly, daily, or weekly.
gcloud compute resource-policies create snapshot-schedule [SCHEDULE_NAME] \
--description "[SCHEDULE_DESCRIPTION]" \
--max-retention-days [MAX_RETENTION_DAYS] \
--start-time [START_TIME] \
--hourly-schedule [SNAPSHOT_INTERVAL] \
--daily-schedule \
--weekly-schedule [SNAPSHOT_INTERVAL] \
--weekly-schedule-from-file [FILE_NAME] \
--on-source-disk-delete [DELETION_OPTION]
where:
[SCHEDULE_NAME]
is the name of the new snapshot schedule."[SCHEDULE_DESCRIPTION]"
is a description of the snapshot schedule. Use quotes around your description.[MAX_RETENTION_DAYS]
is the number of days to retain the snapshot. For example, setting3
would mean that snapshots are retained for 3 days before they are deleted. You must set a retention policy of at least 1 day.[START_TIME]
is the UTC start time. The time must start on the hour. For example:- 2:00 PM PST is
22:00
. - If you set a start time of
22:13
, you will receive an error.
- 2:00 PM PST is
[SNAPSHOT_INTERVAL]
defines the interval at which you want snapshotting to occur. Set the hourly schedule using an integer between 1 and 23. Choose an hourly number that is evenly divided into 24. For example, setting--hourly-schedule
to 12, means the snapshot is generated every 12 hours. For a weekly schedule define the days you want the snapshotting to occur. You must spell out the week days, they are not case-sensitive. The snapshot frequency flagshourly-schedule
,daily-schedule
, andweekly-schedule
are mutually-exclusive. You must pick one for your snapshot schedule.[FILE_NAME]
is the file name that contains the weekly snapshot schedule, if you choose to provide the schedule in this format. Note that you can specify weekly schedules on different days of the week and at different times using a file (but you cannot specify multiple weekly schedules directly on the command-line). For example, your file might specify a snapshot schedule on Monday and Wednesday:[{"day": "MONDAY", "startTime": "04:00"}, {"day": "WEDNESDAY", "startTime": "02:00"}]
If you include a start time in your file, you do not need to set the--start-time
flag. The schedule uses the UTC time standard.[DELETION_OPTION]
determines what happens to your snapshots if the source disk is deleted. Choose either the defaultkeep-auto-snapshots
by omitting this flag, or useapply-retention-policy
to apply a retention policy.
These are additional examples for setting up a snapshot schedule. In all the following examples:
- The disk deletion rule is included; the
--on-source-disk-delete
flag is set to the default ofkeep-auto-snapshots
to permanently keep all auto-generated snapshots. The alternative is to set this flag toapply-retention-policy
to use your snapshot retention policy. - The storage location is set the
US
so all generated snapshots will be stored in the US multi-region. - The labels
env=dev
andmedia=images
are applied to all generated snapshots. - The retention policy is set to 10 days.
Hourly schedule: In this example, the snapshot schedule starts at 22:00 UTC and occurs every 4 hours.
gcloud compute resource-policies create snapshot-schedule SCHEDULE_NAME \
--description "MY HOURLY SNAPSHOT SCHEDULE" \
--max-retention-days 10 \
--start-time 22:00 \
--hourly-schedule 4 \
--region us-west1 \
--on-source-disk-delete keep-auto-snapshots \
--snapshot-labels env=dev,media=images \
--storage-location US
Daily schedule: In this example, the snapshot schedule starts at 22:00
UTC and occurs every day at the same time. The --daily-schedule
flag must
be present, but not set to anything.
gcloud compute resource-policies create snapshot-schedule SCHEDULE_NAME \
--description "MY DAILY SNAPSHOT SCHEDULE" \
--max-retention-days 10 \
--start-time 22:00 \
--daily-schedule \
--region us-west1 \
--on-source-disk-delete keep-auto-snapshots \
--snapshot-labels env=dev,media=images \
--storage-location US
Weekly schedule: In this example, the snapshot schedule starts at 22:00 UTC and occurs every week on Tuesday and Thursday.
gcloud compute resource-policies create snapshot-schedule SCHEDULE_NAME \
--description "MY WEEKLY SNAPSHOT SCHEDULE" \
--max-retention-days 10 \
--start-time 22:00 \
--weekly-schedule tuesday,thursday \
--region us-west1 \
--on-source-disk-delete keep-auto-snapshots \
--snapshot-labels env=dev,media=images \
--storage-location US
API
In the API, construct a POST
request to
resourcePolicies.insert
to create a snapshot schedule. At the minimum, you must include the snapshot
schedule name, snapshot storage regional location, and snapshot frequency.
By default, the onSourceDiskDelete
parameter is set to keepAutoSnapshots
.
This means that if the source disk is deleted, the auto-generated snapshot
for that disk is retained indefinitely. Alternatively, you can set the flag
to applyRetentionPolicy
to apply your retention policy.
The following example sets a daily snapshot schedule that starts at 12:00 UTC and repeats every day. The example also sets a retention policy of 5 days; after 5 days, snapshots are automatically removed.
You can also include snapshot locality options and snapshot labels in your request to ensure your snapshots are stored in the location of your choice.
POST https://compute.googleapis.com/compute/v1/projects/[PROJECT_ID]/regions/[REGION]/resourcePolicies
{
"name": "[SCHEDULE_NAME]",
"description": "[SCHEDULE_DESCRIPTION]",
"snapshotSchedulePolicy": {
"schedule": {
"dailySchedule": {
"startTime": "12:00",
"daysInCycle": "1"
}
},
"retentionPolicy": {
"maxRetentionDays": "5"
},
"snapshotProperties": {
"guestFlush": "False",
"labels": {
"env": "dev",
"media": "images"
},
"storageLocations": ["US"]
}
}
}
where:
[PROJECT_ID]
is the project name.[REGION]
is the location of the snapshot schedule resource policy.[SCHEDULE_DESCRIPTION]
is the description of the snapshot schedule.[SCHEDULE_NAME]
is the name of the snapshot schedule.
Similarly, you can create a weekly or monthly schedule. Review the API reference for details specific to setting a weekly or monthly schedule.
For example, the following request creates a weekly schedule that runs on Tuesday and Thursday, at 9:00 and 2:00 respectively.
POST https://compute.googleapis.com/compute/v1/projects/[PROJECT_ID]/regions/[REGION]/resourcePolicies
{
"name": "[SCHEDULE_NAME]",
"description": "[SCHEDULE_DESCRIPTION]",
"snapshotSchedulePolicy": {
"schedule": {
"weeklySchedule": {
"dayOfWeeks": [
{
"day": "Monday",
"startTime": "9:00"
},
{
"day": "Thursday",
"startTime": "2:00"
}
]
}
},
"retentionPolicy": {
"maxRetentionDays": "5"
},
"snapshotProperties": {
"guestFlush": "False",
"labels": {
"production": "webserver"
},
"storageLocations": ["US"]
}
}
}
Attach a snapshot schedule to a disk
Once you have a schedule, attach it to an existing disk. Use the console, gcloud
command, or the Compute Engine API method.
Console
Attach a snapshot schedule to an existing disk.
- In the Google Cloud console, go to the Disks page.
- Select the name of the disk to which you want to attach a snapshot schedule. This opens the Manage disk page.
- On the Manage disk page, hover and click the More actions menu and select Edit.
- Use the Snapshot schedule drop-down menu to add the schedule to the disk. Or create a new schedule.
- If you created a new schedule, click Create.
- Click Save to complete the task.
gcloud
To attach a snapshot schedule to a disk, use the
disks add-resource-policies
gcloud
command.
gcloud compute disks add-resource-policies [DISK_NAME] \
--resource-policies [SCHEDULE_NAME] \
--zone [ZONE]
where:
[DISK_NAME]
is the name of the existing disk.[SCHEDULE_NAME]
is the name of the snapshot schedule.[ZONE]
is the location of your disk.
API
In the API, construct a POST
request to
disks.addResourcePolicies
to attach a snapshot schedule to an existing disk.
POST https://compute.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/disks/[DISK_NAME]/addResourcePolicies
{
"resourcePolicies": [
"regions/[REGION]/resourcePolicies/[SCHEDULE_NAME]"
]
}
where:
[PROJECT_ID]
is the project name.[ZONE]
is the location of the disk.[REGION]
is the location of the snapshot schedule.[DISK_NAME]
is the name of the disk.[SCHEDULE_NAME]
is the name of the snapshot schedule in that region you are applying to this disk.
Restore data from a snapshot
If you backed up a boot or non-boot disk with a snapshot, you can create a new disk based on the snapshot.
Restrictions
- The new disk must be at least the same size as the original source disk for the snapshot. If you create a disk that is larger than the original source disk for the snapshot, you must resize the file system on that persistent disk to include the additional disk space. Depending on your operating system and file system type, you might need to use a different file system resizing tool. For more information, see your operating system documentation.
Create a disk from a snapshot and attach it to a VM
Console
In the Google Cloud console, go to the Snapshots page.
Find the name of the snapshot that you want to restore.
Go to the Disks page.
Click Create new disk.
Specify the following configuration parameters:
- A name for the disk.
- A type for the disk.
- Optionally, you can override the default region and zone selection. You can select any region and zone, regardless of the storage location of the source snapshot.
Under Source type, click Snapshot.
Select the name of the snapshot to restore.
Select the size of the new disk, in gigabytes. This number must be equal to or larger than the original source disk for the snapshot.
Click Create to create the disk.
You can then attach the new disk to an existing instance.
- Go to the VM instances page.
- Click the name of the instance where you want to restore your non-boot disk.
- At the top of the instance details page, click Edit.
- Under Additional disks, click Attach existing disk.
- Select the name of the new disk made from your snapshot.
- Click Done to attach the disk.
- At the bottom of the instance details page, click Save to apply your changes to the instance.
gcloud
Use the
gcloud compute snapshots list
command command to find the name of the snapshot you want to restore:gcloud compute snapshots list
Use the
gcloud compute snapshots describe
command command to find the size of the snapshot you want to restore:gcloud compute snapshots describe SNAPSHOT_NAME
Replace SNAPSHOT_NAME with the name of the snapshot being restored.
Use the
gcloud compute disks create
command command to create a new regional or zonal disk from your snapshot. If you need an SSD persistent disk for additional throughput or IOPS, include the--type
flag and specifypd-ssd
.gcloud compute disks create DISK_NAME \ --size=DISK_SIZE \ --source-snapshot=SNAPSHOT_NAME \ --type=DISK_TYPE
Replace the following:
- DISK_NAME: the name of the new disk.
- DISK_SIZE: The size of the new disk, in gigabytes. This number must be equal to or larger than the original source disk for the snapshot.
- SNAPSHOT_NAME: the name of the snapshot being restored.
- DISK_TYPE: full or partial URL for the type
of the disk. For example,
https://www.googleapis.com/compute/v1/projects/PROJECT_ID /zones/ZONE/diskTypes/pd-ssd
.
Attach the new disk to an existing instance by using the
gcloud compute instances attach-disk
command:gcloud compute instances attach-disk INSTANCE_NAME \ --disk DISK_NAME
Replace the following:
- INSTANCE_NAME is the name of the instance.
- DISK_NAME is the name of the disk made from your snapshot.
API
Construct a
GET
request tosnapshots.list
to display the list of snapshots in your project.GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/snapshots
Replace PROJECT_ID with your project ID.
Construct a
POST
request to create a zonal disk using thedisks.insert
method. Include thename
,sizeGb
, andtype
properties. To restore a disk using a snapshot, you must include thesourceSnapshot
property.POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks { "name": "DISK_NAME", "sizeGb": "DISK_SIZE", "type": "zones/ZONE/diskTypes/DISK_TYPE" "sourceSnapshot": "SNAPSHOT_NAME" }
Replace the following:
- PROJECT_ID: your project ID.
- ZONE the zone where your instance and new disk are located.
- DISK_NAME: the name of the new disk.
- DISK_SIZE: the size of the new disk, in gigabytes. This number must be equal to or larger than the original source disk for the snapshot.
- DISK_TYPE: full or partial URL for the type
of the disk. For example
https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ ZONE/diskTypes/pd-ssd
. - SNAPSHOT_NAME: the source snapshot for the disk you are restoring.
You can then attach the new disk to an existing instance by constructing a
POST
request to theinstances.attachDisk
method, and including the URL to the zonal disk that you just created from your snapshot.POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/INSTANCE_NAME/attachDisk { "source": "/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/DISK_NAME" }
Replace the following:
- PROJECT_ID is your project ID.
- ZONE is the zone where your instance and new disk are located.
- INSTANCE_NAME is the name of the instance where you are adding the new disk.
- DISK_NAME is the name of the new disk.
Go
Go
Before trying this sample, follow the Go setup instructions in the Vertex AI quickstart using client libraries. For more information, see the Vertex AI Go API reference documentation.
To authenticate to Vertex AI, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
Java
Before trying this sample, follow the Java setup instructions in the Vertex AI quickstart using client libraries. For more information, see the Vertex AI Java API reference documentation.
To authenticate to Vertex AI, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
Node.js
Before trying this sample, follow the Node.js setup instructions in the Vertex AI quickstart using client libraries. For more information, see the Vertex AI Node.js API reference documentation.
To authenticate to Vertex AI, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
Python
To learn how to install or update the Vertex AI SDK for Python, see Install the Vertex AI SDK for Python. For more information, see the Python API reference documentation.
Mount the disk
In the terminal, use the
lsblk
command to list the disks that are attached to your instance and find the disk that you want to mount.$ sudo lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 10G 0 disk └─sda1 8:1 0 10G 0 part / sdb 8:16 0 250G 0 disk
In this example,
sdb
is the device name for the new blank persistent disk.Use the mount tool to mount the disk to the instance, and enable the
discard
option:$ sudo mount -o discard,defaults /dev/DEVICE_NAME /home/jupyter
Replace the following:
DEVICE_NAME
: the device name of the disk to mount.
Configure read and write permissions on the disk. For this example, grant write access to the disk for all users.
$ sudo chmod a+w /home/jupyter
What's next
- Learn how to save a notebook to GitHub
- Learn more about creating snapshots.
- Learn more about scheduling snapshots.