For some reasons, the boot disk of my VM instance was no longer enough to use. And I wanted to move the whole /home directory to the new disk.
I followed the GCP guide to create and mount the disk to /data/diks-1/. Then I moved /home to /data/disk-1/home, and create a soft link to /home. Everything worked well just like what I expected.
However, I forgot to modify the fstab file for automatic mounting. And I restarted the VM instance...
Now, I cannot connect the instance via ssh, and have no idea about how to solve this. The whole /data/disk-1 directory must be unmounted, which include settings of all users. Are there any ways to remount the disk ?
#!/bin/bash mount -o discard,defaults /dev/sdb /data/disk-1 ln -s /data/disk-1/home/ home