The steps to mount Google cloud disk in colab are as follows:
-
Create a new notebook in colab.
-
Enter the following code in the code cell and when run you will be prompted to authorize with a link:
from google.colab import drive
drive.mount('/content/drive')
-
Click the link to jump to the authorization page, log in to the Google account, obtain the authorization code, and then copy the authorization code.
-
Paste the authorization code into the colab notebook, and press Enter to authorize.
-
After the authorization is successful, you can mount the Google cloud disk through the following code:
!mkdir -p /content/drive
!google-drive-ocamlfuse /content/drive
- After the mount is successful, you can browse and edit the files in the Google cloud disk through folders.