Score:0

GCE instance disk full, unable to login even after resize

cn flag

Our webserver filled up its disk making it impossible to log into the instance. We resized the disk from 10gb to 100gb and we're still unable to login. I've tried creating new a server from a snapshot, creating a new instance from an image and even tried attaching a copy of the disk to an existing server, which caused the existing server to also fail(I'm unable to login). I'm assuming that the partition needs to be resized but seeing as I can't log into the machine, that's impossible.

The startup log(pulled from serial port) indicates that theres no space left on device but there should be plenty of space after resize. However, I can't login to the instance, even through serial port. All of our blogs are stored on this server, so I need a way to get access to the data on the disk.

[  OK  ] Started Monitoring of LVM2 mirrors,…sing dmeventd or progress polling.
[    7.939339] systemd-journald[426]: Failed to open system journal: No space left on device
[    7.940946] systemd-journald[426]: Failed to open system journal: No space left on device
[    7.942235] systemd-journald[426]: Failed to open system journal: No space left on device
[    7.947117] systemd-journald[426]: Failed to open system journal: No space left on device
[    7.948522] systemd-journald[426]: Failed to open system journal: No space left on device
[  OK  ] Started udev [    7.951801] systemd-journald[426]: Failed to open system journal: No space left on device

Jul 14 08:57:59 webserver google-accounts: ERROR Exception calling the response handler. [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'].#012Traceback (most recent call last):#012  File "/usr/lib/python3/dist-packages/google_compute_engine/metadata_watcher.py", line 200, in WatchMetadata#012    handler(response)#012  File "/usr/lib/python3/dist-packages/google_compute_engine/accounts/accounts_daemon.py", line 285, in HandleAccounts#012    self.utils.SetConfiguredUsers(desired_users.keys())#012  File "/usr/lib/python3/dist-packages/google_compute_engine/accounts/accounts_utils.py", line 318, in SetConfiguredUsers#012    mode='w', prefix=prefix, delete=True) as updated_users:#012  File "/usr/lib/python3.6/tempfile.py", line 681, in NamedTemporaryFile#012    prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)#012  File "/usr/lib/python3.6/tempfile.py", line 269, in _sanitize_params#012    dir = gettempdir()#012  File "/usr/lib/python3.6/tempfile.py", line 437, in gettempdir#012    tempdir = _get_default_tempdir()#012  File "/usr/lib/python3.6/tempfile.py", line 372, in _get_default_tempdir#012    dirlist)#012FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']
Jul 14 08:58:22 webserver systemd[1]: snapd.service: Start operation timed out. Terminating.
Jul 14 09:00:06 webserver google-accounts: ERROR Exception calling the response handler. [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'].#012Traceback (most recent call last):#012  File "/usr/lib/python3/dist-packages/google_compute_engine/metadata_watcher.py", line 200, in WatchMetadata#012    handler(response)#012  File "/usr/lib/python3/dist-packages/google_compute_engine/accounts/accounts_daemon.py", line 285, in HandleAccounts#012    self.utils.SetConfiguredUsers(desired_users.keys())#012  File "/usr/lib/python3/dist-packages/google_compute_engine/accounts/accounts_utils.py", line 318, in SetConfiguredUsers#012    mode='w', prefix=prefix, delete=True) as updated_users:#012  File "/usr/lib/python3.6/tempfile.py", line 681, in NamedTemporaryFile#012    prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)#012  File "/usr/lib/python3.6/tempfile.py", line 269, in _sanitize_params#012    dir = gettempdir()#012  File "/usr/lib/python3.6/tempfile.py", line 437, in gettempdir#012    tempdir = _get_default_tempdir()#012  File "/usr/lib/python3.6/tempfile.py", line 372, in _get_default_tempdir#012    dirlist)#012FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']
John Hanley avatar
cn flag
You will need to attach this disk to another system with the same OS version and same version of LVM. Search the Internet for a guide on how to resize an LVM partitioned disk.
Score:0
cn flag

The root partition was not resized after I resized the disk, which is the root of the problem. It seems that the partitions on standard persistent disks are not resized automatically but balanced and SSD disks are resized automatically.

In the end, I cloned the disk and attached it, as a second disk(not mounted) to a new VM, then followed the instructions here to resize the partition. Then attached the new disk to a new VM.

https://medium.com/100-days-of-linux/how-to-resize-a-linux-root-file-system-af3e5096b4e4

John Hanley avatar
cn flag
The disk type does not matter. The partition format must be one of the supported types. LVM is not a supported type for automatic resizing.
Score:0
ng flag

After you resize a VM boot disk, most VMs resize the root file system and restart the VM. However, for some VM image types, you might have to resize the file system manually. If your VM does not support automatic root file system resizing, or if you've resized a data (non-boot) persistent disk, you must manually resize the file system and partitions.

Here are some steps for troubleshooting Inaccessible VM due to full boot disk

John Hanley avatar
cn flag
This answer is correct. However, the OP is using LVM partitions. Google does not provide automatic resizing of LVM partitioned disks.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.