[CentOS] chroot question - can you help?

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


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






More information about the CentOS mailing list