0
votes

I'm trying to snapshot a boot disk on Google Compute Engine. Per the instructions in this post (https://cloud.google.com/compute/docs/disks/persistent-disks#create-snapshot-linux)

I've run the following commands, is this the correct method for a boot disk? After I execute fsfreeze and run the snapshot my server application crashes. However snapshoting completes if you run a sync command and then the snapshot command without usign fsfreeze.

I don't imagine that's much of a surprise, since how could you snapshot a disk if you've suspended access to the filesystem that holds the snapshot tools?

What is the best practice for creating a snapshot from a boot disk when you don't have the option of shutting the instance down?

$ sudo sync
$ sudo fsfreeze -f /
$ gcloud compute disks snapshot sm-elvis-boot-hot-001
$ sudo fsfreeze -u /
1

1 Answers

0
votes

Does your application crash even if you don't run the snapshot command? I have a feeling that your app does not like freezing the root filesystem. In that case, you can't freeze the filesystem and will have to skip the fsfreeze step like you mentioned, but of course there is a chance this causes corruption.

I was also not able to run gcloud commands after freezing.

Solution: Run the gcloud command on a different computer, or use the Google Developer Console to create the snapshot.

Best practice wise, your data should be on another disk so you don't run into this problem.