通过搜索知道了chroot失败的原因: “chroot以后,系统的根目录切到/mnt下,新的环境将继承旧系统的环境变量,root用户依然以/bin/bash为默认的shell,因/mnt下并不存在bin/bash这个文件,所以报上述错误,为了解决该问题,在该目录下建立bin目录,并拷贝bash文件以及其所依赖的库文件到该目录下……”
参考链接:http://www.rlead.cn/bencandy.php?fid=4&id=285 <http://www.rlead.cn/bencandy.php?fid=4&id=285> 虽然由于某分区损坏而且fsck不成功没能修复grub,但是了解了chroot的用法。 在 2010年9月11日 下午2:33,Xiangfu Liu <[email protected]>写道: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > 很有可能是 链接 的问题,上网搜了一下,有人说chroot 的时候如果/bin/sh 是链接可能会有问题。 你可以直接把busybox 复制成 > /bin/sh 再试试 :) > > On 09/10/2010 06:53 PM, simon22543 wrote: > > 谢谢xiangfu,我按照你提示的做,仍然是: > > chroot:cannot execute /bin/sh:No such file or directory > > > > 我先是选择分区/dev/sda1(/分区)作为root,提示说是挂到了/target,可以通过chroot > > /target暂时设为主分区,我这样做chroot也报错: > > chroot:cannot execute /bin/sh:No such file or directory > > 我看了下/bin/sh是指向busybox的链接。 > > > > 会否是busybox的chroot不好用?我找张liveCD试试。 > > > > 在 10-9-10,Xiangfu Liu<[email protected]> 写道: > > On 09/09/2010 08:32 PM, simon22543 wrote: > >>>> '¶} (¿;:xp > > „virtualbox̉ņdebianG§grub-legacy0grub2 Í/ ú° > >>>> &&stage 1.5 ° > †Ù*”åØ/grub‹Y > >>>> error 15 > >>>> > > ‰Å@(„debian-505-i386-netinst.isoÛerescue > >>>> mode, „/ :ù”/dev/sda1,/usr :ù”„//dev/sda5 > >>>> é/\:; :vÐL‰Å¯ƒê&shell, > >>>> Š/dev/sda5 }0/mnt/usró chroot /mntÎÐL/usr/sbin-„grub-installeî > > >>>> —0Ð: ï > > > > Hi > > `Š /dev/sda5 mount0 /mnt/usr, > > F/`¡ Š /dev/sda1 mount0 /mnt > > > > `/ > /Ù7ÐL„ > > mount /dev/sda1 /mnt > > mount /dev/sda5 /mnt/usr > > chroot /mnt > > > > > >>>> chroot:cannot execute /bin/sh:No such file or directory > >>>> F/UìÐLchroot å Ð: > >>>> BusyBox v1.10.2(Debian 1:1.10.2-2) multi-call binary > >>>> > >>>> Usage: chroot NEWROOT [COMMAND...] > >>>> > >>>> ÷ M ¹÷%"" > > > > > >> > > - -- > Best Regards > Xiangfu Liu > http://www.openmobilefree.net > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAkyLIs8ACgkQRRAEFRxkgLQhWACglrkPu+5d9HwXz6OeDhlnXj54 > 4V0AoJCwt/bB9m2T7jkJEu12fNkeh4k/ > =VdJF > -----END PGP SIGNATURE----- >

