2015-10-14 75 views
7

嘗試SSH到我的實例時出現錯誤。它告訴我檢查控制檯串行輸出。根據我的理解,我的磁盤沒有空間。我該怎麼辦?我需要SSH來清除空間,但不能SSH,因爲沒有空間!磁盤已滿,我無法通過SSH登錄到實例

這是我所看到的:

Starting OpenBSD Secure Shell server: sshdopen: No space left on device 
Oct 14 13:18:13 instance-1 sshd[2771]: Server listening on 0.0.0.0 port 22. 
[?25l[?1c7[1GOct 14 13:18:13 instance-1 sshd[2771]: Server listening on :: port 22. 
[[32m ok [39;49m8[?25h[?0c. 
udhcpd: Disabled. Edit /etc/default/udhcpd to enable it. 
mktemp: failed to create file via template `/tmp/tmp.XXXXXXXXXX': No space left on device 
mktemp: failed to create file via template `/tmp/tmp.XXXXXXXXXX': No space left on device 
mktemp: failed to create file via template `/tmp/tmp.XXXXXXXXXX': No space left on device 
mktemp: failed to create file via template `/tmp/tmp.XXXXXXXXXX': No space left on device 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 
100 2384 100 2384 0  0 1126k  0 --:--:-- --:--:-- --:--:-- 2328k 
Oct 14 13:18:13 instance-1 google: {"attributes":{"sshKeys":"ishener:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAFbCZDZDvuIxUbH5AHYeUU/WUWaOBYI1S7Yl9k3oVFwrenn6XsMdDHKiSH2VtpenQ7mHu3YcLDFe0pO1AwJjnSO39JR/3tTVLeVbuHDTEhOhDHt0NE84S1rqHX6r591IDwLhoGnFdNibGs0Sc0uyR/kRxl5hjAWdskOm4wzald+uRctBd+hbdBmt6az7iF2UzHEV362LxUtIzaYWoo1hnhld07+eimi6t+bUHsgqDkVGaEUUDaRFWTaNlFI9UW/AMYOcu9C24molfpPKwe2R5C5HLI+8nNI7qvoGtrUZww7K5bxNQPe+bMvVitArjYItYNDU6OXvQVA/u6gnqnbt1MM= google-ssh {\"userName\":\"[email protected]\",\"expireOn\":\"2015-10-14T13:13:05+0000\"}\nishener:ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCKT2j4VbRM6DXSjLb5UlOdzfaB4K2TvZHWGV3JD7T++EbWX87JLOKg6AdbDPWTlgKRan02TIT/Xshy28r7fCCc= google-ssh {\"userName\":\"[email protected]\",\"expireOn\":\"2015-10-14T13:12:58+0000\"}\nrsa-key-20150806:ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAxtMUn200CaOuRa8bHFuqrjDiyUDrLECUf9V/ZpxT24lrqEbS1bDT7oWQwcuxQZEcrTnfeCEDeIwQpbNoOGp8NufrZUUG8jpVnVQqCHQZ3T+0Gs6et6JYxldhb0xT3KJVwQM+qnZOfwsk7co/+XOhE63u62NvUlqpGDQQUvuFY1wV3B7Rfjhg2JYEHCMswLRnSfnvyxp6+uQJ 
Oct 14 13:18:13 instance-1 google: 4THd/FlcGQJyJHUvpVQAqBIii8yc59+Rb32Xlyii6YU4+G60dfP6ON1iX2qkxJT5/mIkPfd3yPizbGsYhJbaqNQHPUE9hdqTlfk3gyA8S6SySNwViQtUqOH+sbo+suiJHHwr67V/qw== rsa-key-20150806\n"},"cpuPlatform":"Intel Ivy Bridge","description":"","disks":[{"deviceName":"instance-1","index":0,"mode":"READ_WRITE","type":"PERSISTENT"}],"hostname":"instance-1.c.united-wavelet-102819.internal","id":1871676137734806120,"image":"","machineType":"projects/273410245967/machineTypes/g1-small","maintenanceEvent":"NONE","networkInterfaces":[{"accessConfigs":[{"externalIp":"104.197.52.39","type":"ONE_TO_ONE_NAT"}],"forwardedIps":[],"ip":"10.240.238.207","network":"projects/273410245967/networks/default"}],"scheduling":{"automaticRestart":"TRUE","onHostMaintenance":"MIGRATE"},"serviceAccounts":{"[email protected]":{"aliases":["default"],"email":"[email protected]","scopes":["https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write"]},"default":{"al 
Oct 14 13:18:13 instance-1 google: iases":["default"],"email":"27[email protected]","scopes":["https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write"]}},"tags":["http-server","https-server"],"virtualClock":{"driftToken":"12943060760861539723"},"zone":"projects/273410245967/zones/us-central1-f"} 
Oct 14 13:18:13 instance-1 google: No startup script found in metadata. 
[....] startpar: service(s) returned failure: tomcat7 ...[?25l[?1c7[1G[[31mFAIL[39;49m8[?25h[?0c [31mfailed![39;49m 
Oct 14 13:18:40 instance-1 accounts-from-metadata: WARNING Could not update /home/rsa-key-20150806/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:18:40 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:18:40 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener_zaph/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:18:45 instance-1 sshd[2884]: Connection closed by 173.194.92.49 [preauth] 
Oct 14 13:18:46 instance-1 sshd[2886]: Connection closed by 173.194.92.49 [preauth] 
Oct 14 13:18:47 instance-1 accounts-from-metadata: WARNING Could not update /home/rsa-key-20150806/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:18:47 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:18:47 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener_zaph/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:18:49 instance-1 sshd[2903]: Connection closed by 173.194.92.52 [preauth] 
Oct 14 13:18:51 instance-1 sshd[2905]: Connection closed by 173.194.92.52 [preauth] 
Oct 14 13:18:55 instance-1 sshd[2907]: Connection closed by 173.194.92.52 [preauth] 
Oct 14 13:19:02 instance-1 sshd[2909]: Connection closed by 173.194.92.48 [preauth] 
Oct 14 13:19:17 instance-1 sshd[2912]: Connection closed by 173.194.92.48 [preauth] 
Oct 14 13:19:58 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener_zaph/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:19:58 instance-1 accounts-from-metadata: WARNING Could not update /home/rsa-key-20150806/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:19:58 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:20:01 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener_zaph/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:20:01 instance-1 accounts-from-metadata: WARNING Could not update /home/rsa-key-20150806/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:20:01 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:20:02 instance-1 sshd[2929]: Connection closed by 173.194.92.51 [preauth] 
Oct 14 13:20:03 instance-1 sshd[2946]: Connection closed by 173.194.92.50 [preauth] 
Oct 14 13:20:06 instance-1 sshd[2948]: Connection closed by 173.194.92.49 [preauth] 
Oct 14 13:20:09 instance-1 sshd[2950]: Connection closed by 173.194.92.51 [preauth] 
Oct 14 13:20:13 instance-1 sshd[2952]: Connection closed by 173.194.92.50 [preauth] 
Oct 14 13:20:25 instance-1 sshd[2955]: Connection closed by 173.194.92.49 [preauth] 
Oct 14 13:20:36 instance-1 sshd[2957]: Connection closed by 173.194.92.52 [preauth] 
Oct 14 13:20:55 instance-1 sshd[2959]: Connection closed by 173.194.92.52 [preauth] 
Oct 14 13:21:01 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener_zaph/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:21:01 instance-1 accounts-from-metadata: WARNING Could not update /home/rsa-key-20150806/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:21:01 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:21:34 instance-1 sshd[2977]: Connection closed by 173.194.92.51 [preauth] 
Oct 14 13:23:01 instance-1 accounts-from-metadata: WARNING Could not update /home/rsa-key-20150806/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:23:01 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener_zaph/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
Oct 14 13:23:01 instance-1 accounts-from-metadata: WARNING Could not update /home/ishener/.ssh/authorized_keys due to [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'] 
+0

連接顯示器的時間.. – ergonaut

+0

@ergonaut對不起,但這是什麼意思? –

+0

你可以做大致如下:停止實例,在另一臺服務器上掛載磁盤,清理它,在這裏卸載並重新安裝,啓動服務器?萬一它是一個網絡驅動器,你可以在計算引擎 – zapl

回答

12

你有不同的方案來解決這個問題:

  1. Check if your operating system supports automatic resizing:如果是這樣,使用雲控制檯,您可以編輯虛擬機的根磁盤,並提高其尺寸。您的虛擬機實例可以在重新啓動實例後自動調整分區大小以識別額外的空間。

  2. 使用Interactive Serial Console feature登錄到您的虛擬機並清理您的虛擬機的磁盤或將它們複製到另一個存儲,如果您以後需要它們。

  3. 如果您知道要刪除的數據,可以配置startup script以刪除文件並重新啓動虛擬機以運行腳本(例如rm/tmp/*)。

  4. 您可以分離永久磁盤並將該磁盤作爲附加磁盤附加到另一臺計算機上。在臨時機器上,如果您稍後需要它們,您可以安裝它並清理數據或將它們複製到另一個存儲器。最後用相同的引導磁盤重新創建原始實例。您可以按照此video中描述的相同步驟將磁盤添加到其他Linux VM,但添加現有的啓動磁盤而不是創建新磁盤。

  5. Check if your operating system supports automatic resizing:如果是,則創建永久磁盤的快照,從快照創建一個大尺寸的新永久磁盤。最後用這個更大的啓動磁盤重新創建原始實例。

+1

自動調整大小不起作用,我試過了。 4點解決了我的問題。 –

+1

嘗試1,3並跳過2.都沒有爲我的愚蠢overfilled Ubuntu 16.04虛擬機工作。數字4通向成功。我創建了原始映像的克隆,將其作爲輔助驅動器附加到第二個虛擬機,用它來擴展已填充的文件系統。一旦完成,分離它並將其用作第三個虛擬機的引導驅動器。 – Finlay