After an unexpected shutdown of the virtual machine with centos on Hyper-V can not boot the system with the error “switchroot: mount failed: No such file or directory”. In this case, the driver is not loaded correctly VHDs CetnOS in Hyper-V:
Scanning logical volumes
Reading all physical volumes. This may take a while…
No volume groups found
Activating logical volumes
Volume group “VolGroup00” not found
Trying to resume from /dev/VolGroup00/LogVol01
Unable to access resume device (/dev/VolGroup00/LogVol01)
Creating root device.
Mounting root filessystem.
mount: could not find filesystem ‘/dev/root’
Setting up other filessystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory Kernel panic – not syncing: Attempted to kill init!
The first thing to do – download and insert cd / dvd-rom image of CentOS, which establishes the system.
Boot the system and after a welcome window write in the command line:
Further, since all manipulations write:
chroot / mnt / sysimage
Enjoying the exact version of the kernel:
Replace “VERSION” on your boot kernel version, which we found in the previous step:
mkinitrd /boot/initrd-VERSION.el5.img VERSION.el5 –preload hv_storvsc –preload hv_vmbus –preload hv_utils -f
mkinitrd /boot/initrd-2.6.18-348.1.1.el5.img 2.6.18-348.1.1.el5 –preload hv_storvsc –preload hv_vmbus –preload hv_utils -f
Exit and reboot:
Leave a Reply