简体   繁体   中英

Access another disk from Jupyter notebook in Google Cloud Platform (GCP)

I am using GCP AI Platform Notebook instance and Jupyterlab. The virtual machine (VM) has a boot disk and another SSD disk. I want to read data from the SSD disk. However, the SSD disk is not visible to jupyter notebook. In fact, the notebook can only see the files under /home/jupyter. I mounted the disk to a directory under /home/jupyter. Still the jupyter notebook is unable to see the contents of the SSD (I verified this by running shell commands from the notebook). However, everything is perfectly visible from the terminal.

How can I access the SSD from a notebook?

I wasn't able to verify your issue, I have a notebook instance running and added an SSD PD, then formatted and mounted it following the basic instructions here . I was able to change directories and see contents from the running Jupyter Notebook.

Make sure you configure the partition for read/write from all users

sudo chmod a+w /mnt/disks/MNT_DIR

I can test with a local SSD if you are using that instead, but there should be little difference. Confirm that you mounted and formatted it correctly.

To change working directories from the notebook you can use % commands or follow the answers in "Change Working Directory in Jupyter Notebook" .

The AI platform instance probably operates in its own userspace that potentially doesn't have access to the SSD. It sounds like you have shell access somewhere? Try running the linux command who in your notebook and in whatever shell you used to mount the SSD to look for differences.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM