/ debian

Repair in chroot

I screwed up a Linode host while I am switch kernel from 32bit to 64bit, which article from Linode library is wrong. Follow the article, you would just switch kernel, not all packages.

Then I find a article could works -- How to amd64 an i386 Debian installation with multiarch, but when I done with everything and reboot. Bingo! I can't login my host any more. Connect with Lish, I saw that init respawned too fast.

Be cool, I resize disk and deploy another Debian 7.4 64bit and mount the old disk and now repair the whole system.

Reinstall all package seems is a good way. Before chroot I have to mount proc, sys, and dev filesystem.

$ sudo mount --bind /dev /mnt/dev
$ sudo mount --bind /proc /mnt/proc
$ sudo mount --bind /sys /mnt/sys

And following this thread to reinstall all packages.

Thanks, hope everything will be ok. p.s. backup all data and start a new host might be fastest way to recover, but repair process might be more fun with.;-)

update: after chroot repair process, I found some packages are essential but removed while switch to 64bit. here is

apt-get install mingetty
apt-get install net-tools
apt-get install iptables
apt-get install isc-dhcp-client

And hostname is also incorrect, just edit /etc/hostname and run /etc/init.d/hostname start or restart.

Ok, at least my host is back, and important data still exist.