Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attach a disk to a running instance (in console)

I needed more space in my instance, so I tried attaching a disk to it. in the console i created a disk and attached it. But I don't see it on my instance when running:

df -h

I tried rebooting, and read the docs here: https://developers.google.com/compute/docs/disks#attachdiskrunninginstance

I'm don't know what else to try...

like image 865
Moshe Shaham Avatar asked Feb 02 '26 14:02

Moshe Shaham


1 Answers

try the following:

list disks: ls -l /dev/disk/by-path/

see disk device usually /dev/sdb for second disk

sudo mkdir /mnt/newdisk

Note: The following command wil format and delete all data on new disk! Do not use if are mounting an already formatted disk containing data.

sudo /usr/share/google/safe_format_and_mount /dev/sdb /mnt/newdisk

Regards Paolo

like image 130
Paolo P. Avatar answered Feb 05 '26 07:02

Paolo P.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!