shell script에서 chroot를 이용한 shell script실행하기.

Coumputer's/Linux 2011. 10. 11. 16:05


최근 Emulator작업을 하면서 shell을 이용하여 특정 파티션을 mount하고,
mount한 파티션의 환경에서 shell이나 특정 프로그램을 실행시키기 위해서 조사한 내용임.

mount /dev/hdd1 /mnt/mount
chroot /mnt/mount /bin/bash -c "cd /mnt/bin; ./run.sh"

설명 : /mnt/mount를 root 파티션으로 변경하고 bash를 이용하여 " " 구문을 실행하라.