[CentOS] chroot question - can you help?

Mon Nov 9 18:45:08 UTC 2009
John R Pierce <pierce at hogranch.com>

John Doe wrote:
> From: adrian kok <adriankok2000 at yahoo.com.hk>
>   
>> I install new linux in sda and try to recover the boot partition in sdb
>> I mount it /dev/sdb1 /bootpartion
>> but I can't chroot into it and grub-install
>> Can you help
>> [root at host ~]# chroot /bootpartion
>> chroot: cannot run command `/bin/bash': No such file or directory
>>     
>
> When you chroot /bootpartion, it does not see /bin anymore...
> You need bash inside, and proc and dev too I guess.
>   

you need to mount the ROOT directory, then mount the /boot partition 
under that.   assuming / is /dev/sdb2 and /boot is /dev/sdb1

# mount /dev/sdb2 /rootdir
# mount /dev/sdb1 /rootdir/boot
# chroot /rootdir