当 DigitalOcean Droplet 升级内核后无法启动时,首要救援方案是通过控制面板进入恢复模式(Recovery Mode)或使用恢复 ISO 启动。在恢复环境中,利用 chroot 挂载原有系统分区,重新安装内核或修复 grub 引导配置。若使用的是外部内核管理,可在控制面板切换回旧版本内核。此外,确保在 chroot 环境中正确绑定挂载/dev、/proc 和/sys 目录,以避免安装过程中出现路径错误。对于网络配置导致的问题,还需检查网卡命名是否变更。如无法自行解决,可利用 Recovery Console 进行带外访问排查故障。
DigitalOcean droplet: 使用恢复 ISO 修复损坏的 Ubuntu
本文详细记录了修复 DigitalOcean 上 Ubuntu 16.04 升级至 18.04 过程中遇到的内核恐慌问题。通过从恢复 ISO 启动,重新安装内核,并在 chroot 环境中正确设置'/dev'、'/proc'和'/sys'的绑定挂载,最终成功解决了服务器无法正常启动的问题。Recently, I needed to repair aUbuntudropletserverthat was stuck in a kernel panic. The server maintainer decided to upgrade the OS from Ubuntu 16.04 to 18.04. Everything went well until the final restart after the upgrade when the dorplet was stuck during boot. The maintainer could not SSH into the system and the website was down as well. In the DO control centre, CPU usage of the droplet was showing 100% and the console was showing the kernel panic state and the system calls that caused it. I searched around and foundthispost that had a similar problem and solved it. Basically, these are the steps: Boot into the recovery ISO Mount and chroot into the existing filesystem Reinstall the kernel From theconsolecommands, it was obvious that the solution was for REHL based distributions and I will need to use 'apt' instead of 'yum' for Ubuntu. I found the appropriate command after a bit of digging: apt-get install --reinstalllinux-image-generic linux-image However, when I entered thecommandduring Step 3, I got an error from /usr/sbin/grub-probe that it "failed to get canonical path of overlay". I used the 'df' command to list mounted filesystems and realised that, the live CD ISO mounts overlay at the root i.e. '/', but it was not mounted when I chroot into the brokensystem. After a few more searches, found some usefule info inhereandherethat says I need to bind mount '/dev', '/proc' and '/sys' before chroot, so that they can be found by applications. I did that and it all worked out!Thistime, the reinstall was completed successfully without any error (though there were a few warnings and fallbacks). In summary, the following steps were performed: Power off the droplet and boot from therecovery ISO Choose6for interactive shell (don't mount or chroot)(搜索结果收录于 2020 年 3 月 25 日)
Digitalocean 出现 VFS: unable to mount root fs on unknown-block (0,0) 问题,无法进入系统
Digitalocean 出现 VFS: unable to mount root fs on unknown-block (0,0) 问题,无法进入系统 当遇到 DigitalOcean Droplet 显示'Kernal Panic - Not syncing : VFS: unable to mount root fs on unknown-block (0,0)'错误时,可以按照以下步骤操作:1. 登录 Droplets 管理,关闭并进入 Recovery 模式;2. 开机并打开控制台;3. 使用 chroot 进入系统;4. 按照官方文档安装内核或切换内核;5. 如仍无法进入系统,可尝试 ISO 修复。" 112499185,10294193,Python argparse 命令行参数解析实战,"['Python', '命令行工具', '参数解析'] 本教程以 Centos7 为例 错误提示:Kernal Panic - Not syncing : VFS: unable to mountrootfs on unknown-block (0,0) 1、登录 digitalocean 管理 Droplets,关闭 Droplets,点击 Recovery,切换启动方式 (如图所示) 2、切换完成后,开机,并打开控制台 (如图所示) 3、进入控制台后,会出现如下 1. Mount your Disk Image [NotMounted] 2. Check Filesystem 3.ResetDroplet Root Password 4. Configure Keyboard 5. Attemptto'chroot'intoinstalled system 6. Interactive Shell [/bin/bash] 提示,选择 1,出来路径后,选择 5,进入 chroot(资料日期为 2020 年 3 月 25 日)
How to Manage a Droplet's Kernel
DigitalOcean Droplets are Linux-based virtual machines (VMs) that run on top of virtualized hardware. Each Droplet you create is a new server you can use, either standalone or as part of a larger, cloud-based infrastructure. All Droplets created after March 2017 use internal kernels by default, and older Droplets can be configured to support internal kernels with the DigitalOcean GrubLoader kernel. If you're not sure whether your Droplet manages its kernels internally, visit its detail page in the control panel and click Kernel in the menu. If the kernel management page has the following message, your Droplet is set to use internal kernels natively: The kernel for this Droplet is not managed within the control panel. Instead, you can upgrade the kernel from within the Droplet. If you see a Select a Kernel menu with a Change button and the following description instead, your Droplet is using legacy external kernel management: This will update your configuration. Then power off the server from the command line and boot it from the control panel and the new kernel will be active. To revert, select'Original Kernel'and follow the same process. If your Droplet is using legacy kernel management, you can switch to the DigitalOcean GrubLoader kernel to support internal kernels. Switch to an Internal Kernel Use the DigitalOcean GrubLoader kernel to allow a legacy Droplet with external kernel management to use internally-managed kernels. How to Upgrade to the Latest Kernel Upgrade a Droplet's internal kernel to the latest supported version. How to Boot into a Specific Kernel Version Modify your Droplet to boot into a specific, non-default kernel version. Changing a Droplet Kernel with the CLI When changing the kernel using the command line, you must provide a value for the --kernel-id flag. You can get this value by calling doctl compute droplet kernels to get a list of the available kernels for your Droplet. How to Change the Kernel Using the DigitalOcean CLI(撰于 2019 年 8 月 28 日)
How Recover Access to Droplets using the Recovery Console
DigitalOcean Droplets are Linux-based virtual machines (VMs) that run on top of virtualized hardware. Each Droplet you create is a new server you can use, either standalone or as part of a larger, cloud-based infrastructure. Most users manage their DigitalOcean Droplets using SSH , PuTTY , or a control panel they've installed themselves. However, changes to your network or service configuration files could leave you unable to log in remotely using these methods. The Recovery Console provides out-of-band access and is available regardless of your network settings. It emulates the access you would have if you were sitting down with a keyboard and monitor attached to the actual server. You can use this feature to log in and revert bad settings to regain normal access. Note Use the Recovery Console to recover from network issues or to boot from the recovery ISO. To connect to your Droplet normally, use the Droplet Console or connect with SSH instead. Learn more about the difference between the Droplet Console and the Recovery Console. The Droplet Console is meant as a lightweight, browser-based way to manage a Droplet. It connects to Droplets using the network, like other SSH-based clients, and has features similar to local terminals. The Recovery Console (previously referred to as the Droplet Console) is an older, browser-based connection option based on VNC . Using it is like plugging a keyboard and monitor directly into the Droplet. The Recovery Console is available even if a Droplet has lost network access or the sshd process has failed, but its functionality is limited compared to the Droplet Console. For example, it requires password authentication on the Droplet and doesn't fully support features like copying and pasting. Use the Recovery Console only to recover from network issues when you can't connect to your Droplet and to boot into the recovery ISO . The Droplet Console is otherwise a better option for general command-line management of your Droplets.(2018 年 6 月 19 日的资料)
FAQ
如何进入 DigitalOcean 的 Recovery 模式?
登录 Droplets 管理,关闭 Droplet,点击 Recovery,切换启动方式,然后开机并打开控制台。
升级内核前是否需要备份?
建议创建快照(Snapshots),这是按需创建的磁盘映像,可无限期保留并用于创建新 Droplet,以防升级失败。
什么是 Internal Kernel?
2017 年 3 月后创建的 Droplet 默认使用内部内核,可在系统内升级,而旧版 Droplet 可能使用外部内核管理,需在控制面板切换。