I am trying to mount my external persistent disk using the command:
sudo mount -o discard, defaults /dev/sdb /mnt/working
what I want to do is to make it part of the startup script as I start my VM. I followed the instructions as per the link: https://cloud.google.com/compute/docs/startupscript#startupscriptrunninginstances
I added the script as follows:
custom metadata
key value
startup-script #! /bin/bash
sudo mount -o discard,defaults /dev/sdb /mnt/working
However when I restart my VM , it does not execute it. What am I doing wrong here ?
EDITED to provide more information
Image: debian-10-buster-v20200910 I have not enabled error logging as I am not using the free version anymore but I am hoping that the default log viewer will show error logs. I don't see any. I also ran the script by logging into the vm instance:
sudo google_metadata_script_runner startup
This also didn't help.
/mnt/working
exist? 3) Is/dev/sdb
formatted with a file system? 4) Normally you use/etc/fstab
to mount file systems on startup. Edit your question with details on your investigation of this problem. Remember, commands can be distribution specific, include what OS you are using. - John Hanley/var/log/syslog
or similar. You will also see the errors in the console output. help.ubuntu.com/community/LinuxLogFiles - John Hanleysudo journalctl -u google-startup-scripts.service
- lukaszberwid