Jeremy Davis's picture

If you are getting a grub/grub rescue shell, then hopefully you should be able to manually boot. For example, something like what is explained in this blog post I found via google (note that I haven't tested it, but on face value it looks relevant - if you're getting a grub prompt). Although from the look of what you've posted, you may not even be getting that far...

I'm not 100% sure of what your issue may be, but considering you're using LVM, then it may be partitioning that is causing the issue? IIRC LVM on 7/Wheezy required a separate non-LVM boot partition (it couldn't boot straight into LVM). Whereas in Jessie it will happily boot straight into LVM and doesn't require a separate partition. What can sometimes happen is that after an upgrade, the separate /boot partition is loaded later in the boot process, so in your running system it uses that. But when you reboot, it tries to boot straight from the LVM and assumes that the /boot mountpoint in that is your /boot directory - but it's likely empty (everything is in the separate /boot partition). FWIW a somewhat related issue is noted on our tracker.

Another possibility (an "and/or" scenario) is that because you didn't have the TurnKey main repo enabled, it hasn't upgraded our custom "busybox-initramfs" package. That could also explain why there are missing files.

None the less, you should still be able to rescue the system, so long as you can boot from an ISO. Judging from your previous posts it seems you're on a 32 bit system. The OS itself shouldn't matter, but I'm pretty sure you'll need to match the bits (i.e. use a 32 bit live ISO). Personally, I'd be inclined to use a 32 bit Jessie based live ISO to be on the safe side. FWIW, here's a link to the 32 bit v14.1 TurnKey Core ISO that you could boot from in live mode. Whatever you do, DON'T install it! Just boot live into the system. Otherwise you'll totally wipe out your existing OS!! (I'm sure that is obvious to you, but I'd rather state it when not required, than risk a misunderstanding or oversight). If for some reason you want to try something else, that should also work, but I'm not clear on exactly which factors may affect it... In theory, pretty much any Linux live ISO should allow you to do what you need to do.

Once you've booted with a live disk, then you'll need to mount your broken OS. The fact that you're using LVM makes it a little trickier, but assuming that you are using TurnKey ISO that I linked above and the Live ISO defaults to a VG of "turnkey" (you already stated that your installed system uses "turnkeyvm") it should still be possible. FWIW if the VGs are the same, then there will be issues.

So check for volume groups:

vgdisplay

If there are multiple volume groups with the same name, it will let you know and you'll need to address that first. This should assist you to resolve that?!

Assuming that the VG of the installed system is 'turnkeyvm' (adjust the below if it's not) then load the VG and mount your root:

vgchange -ay turnkeyvm
mount /dev/turnkeyvm/root /mnt
mount --bind /dev /mnt/dev

Many tutorials recommend also mount binding /dev/pts /proc & /sys but I don't think it's necessary although if you get errors, then try that (i.e. the mount bind line above and swap the /dev and /mnt/dev for each of the other locations, e.g. mount --bind /dev/pts /mnt/dev/pts).

There are 2 ways to resolve this AFAIK, but the one I'm familiar with is to ditch the separate boot partition. If you want to play with the other approach, be my guest. So first up, set up the boot dir and (re)install grub. This assumes that the drive which your system should boot from is /dev/sdX, swap it out for what it really is, if you're not sure, run "vgdisplay" again which should hopefully make it clear.

chroot /mnt
mkdir -p /boot/grub
grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sdX
grub-install --recheck /dev/sdX

Hopefully that all looks good. Then to make sure that you have the current busybox-initramfs package, install it (obviously you'll need networking for this, hopefully you do...) This is still in your chroot.

apt-get update
apt-get install busybox-initramfs
update-grub

Now also make sure that the old /boot partition won't get mounted at boot, make sure it's not in the /etc/fstab file, if it is comment it out (i.e. put a '#' at the start).

Then once all that's done, exit the chroot, unmount and reboot. Fingers crossed you should be all good now... (if you mounted other stuff e.g. /dev/pts, unmount them too).

exit
umount /mnt/dev
umount /mnt
reboot

Hopefully you should now be all good...