If the VPS won't boot
Like any other computer, sometimes the vps won't be able to start again after a reboot. Here are some common reasons and solutions.
- File not found by the bootloader. This can be /boot/grub/menu.lst, or the kernel or initrd. If this happens you can use the grub command line to manually load a menu or kernel, and tab completion helps find the file names. Here is how to load a kernel and initrd for example, and tab completion is used for the initrd filename:
GNU GRUB version 0.97 (131072K lower / 0K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename. ESC at any time exits. ] grubdom> root (hd0,0) Filesystem type is ext2fs, partition type 0x83 grubdom> kernel /boot/vmlinuz-2.6.26-2-686-bigmem root=/dev/xvda1 ro grubdom> initrd /boot/initrd.img-2.6.26-2-686-bigmem Possible files are: initrd.img-2.6.26-2-686-bigmem initrd.img-2.6.26-2-686-big mem.bak grubdom> initrd /boot/initrd.img-2.6.26-2-686-bigmem grubdom> boot close blk: backend at /local/domain/0/backend/vbd/114/51712 close blk: backend at /local/domain/0/backend/vbd/114/51776 close blk: backend at /local/domain/0/backend/vbd/114/51792 [ 0.000000] Reserving virtual address space above 0xf57fe000 [ 0.000000] Initializing cgroup subsys cpuset [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Linux version 2.6.26-2-686-bigmem (Debian 2.6.26-24) (email@example.com) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Mon Jun 21 06:45:17 UTC 2010
- Sometimes there will just be a problem with the initrd (maybe with the (initramfs) prompt), and there may be a backup initrd for the same kernel to try instead. Use "e" in pvgrub to edit the initrd line and change the filename, tab completion will help find other available files. pvgrub also allows putting the partition in front of a file path with tab completion, like this:
grubdom edit> initrd ( Possible disks are: hd0 hd1 hd2 cd grubdom edit> initrd (hd Possible disks are: hd0 hd1 hd2 grubdom edit> initrd (hd0,0)/boot/initrd.img-2.6.26-2-686-bigmem Possible files are: initrd.img-2.6.26-2-686-bigmem initrd.img-2.6.26-2-686-big mem.bak grubdom edit> initrd (hd0,0)/boot/initrd.img-2.6.26-2-686-bigmem
- Sometimes the kernel commandline will say root=LABEL=PRGMRDISK1 when the filesystem doesn't have a label, or a different partition than the root filesystem really is. Try root=/dev/xvda1 or another partition instead. Tab completion with the root command in grub will show what the partitions and filesystems are. The kernel parameters can be changed by selecting the kernel line and pressing "e".
If the initrd/initramfs is broken or can't find the root filesystem, the prompt will look like this:
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done. Begin: Waiting for root file system ... done. Gave up waiting for root device. Common problems: - Boot args (cat /proc/cmdline) - Check rootdelay= (did the system wait long enough?) - Check root= (did the system wait for the right device?) - Missing modules (cat /proc/modules; ls /dev) ALERT! /dev/disk/by-label/PRGMRDISK11 does not exist. Dropping to a shell! BusyBox v1.10.2 (Debian 1:1.10.2-2) built-in shell (ash) Enter 'help' for a list of built-in commands. /bin/sh: can't access tty; job control turned off (initramfs)
- Sometimes the bootloader will be set to a different architecture than the kernel is. In this case, go back to the console menu (press ctrl-]) and hard shutdown the vps if its not already shutdown. Switch the bootloader to the right architecture, and start it again:
Booting 'Debian GNU/Linux, kernel 2.6.26-2-686-bigmem' root (hd0,0) Filesystem type is ext2fs, partition type 0x83 kernel /boot/vmlinuz-2.6.26-2-686-bigmem root=LABEL=PRGMRDISK1 console=hvc0 initrd /boot/initrd.img-2.6.26-2-686-bigmem can only boot x86 64 kernels, not xen-3.0-x86_32p Error 13: Invalid or unsupported executable format Press any key to continue...Name ID Mem VCPUs State Time(s) rwhois 121 128 1 r----- 4.9 Options for rwhois 1. out of band console (press ctrl-] to escape, not resizeable) 2. create/start 3. shutdown 4. destroy/hard shutdown 5. reboot 6. swap i386/amd64 bootloaders (pvgrub) currently amd64 7. view/add/remove ssh authorized_keys 8. exit press the number> 4 Error: Domain 'rwhois' does not exist. Options for rwhois 1. out of band console (press ctrl-] to escape, not resizeable) 2. create/start 3. shutdown 4. destroy/hard shutdown 5. reboot 6. swap i386/amd64 bootloaders (pvgrub) currently amd64 7. view/add/remove ssh authorized_keys 8. exit press the number> 6 Error: Domain 'rwhois' does not exist. Options for rwhois 1. out of band console (press ctrl-] to escape, not resizeable) 2. create/start 3. shutdown 4. destroy/hard shutdown 5. reboot 6. swap i386/amd64 bootloaders (pvgrub) currently i386 7. view/add/remove ssh authorized_keys 8. exit press the number> 2 Using config file "/etc/xen/rwhois". Started domain rwhois (id=122)
- Sometimes selinux won't allow the vps to finish booting, or won't allow login after booting (insert example here). Try booting with the kernel parameter selinux=0 to turn off selinux.
- If the vps still can't be booted from grub, try booting the rescue image instead. You can run fsck on the filesystems, and mount them to fix the /etc/fstab, /boot/grub/menu.lst or other files.