Thursday, August 25, 2011

The Power of Chroot



First step, we check about partition harddisk,

# fdisk -l

And then,

# mkdir /mnt/mount-path
# mount /dev/sdax /mnt/mount-path
# mount -t proc /proc /mnt/mount-path/proc
# mount -t sysfs /sys /mnt/mount-path/sys
# mount -o bind /dev /mnt/mount-path/dev
# chroot /mnt/mount-path /bin/bash


Now, chroot finished on /mnt/mount-path. For example, to install grub,

# grub-install /dev/sda
# grub-install /dev/sdax


or

# grub-install --root-directory=/mnt/mount-path /dev/sda

For install lilo,
# liloconfig

or just type

# lilo