From a LiveCD or if you're doing something like converting your non-RAID install to mdadm here's how you would chroot properly (you have to mount your proc, sys and dev on the running system/LiveCD to your chroot environment if you want things to work right, especially if you need to run update-initramfs due to a driver change etc..)
*replace "path" with your mount/chroot path
mount -o bind /proc /mnt/path/proc
mount -o bind /dev/ mnt/path/dev
mount -o bind /sys /mnt/path/sys
chroot /mnt/path
Here's a handy script to do it (basically just give it the path to your chroot and it does the rest):
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage $0 chroot/dir"
exit 1
fi
destination=$1
for mountit in proc sys dev dev/pts; do
mount -o bind /$mountit $destination/$mountit
done
Here's a handy script to unmount the chroot'd system paths:
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage $0 chroot/dir"
exit 1
fi
#note since /dev/pts is mounted inside /dev you have to unmount /dev/pts first rather than when we mounted /dev above we would mount /dev/pts after the fact
destination=$1
for mountit in dev/pts proc sys dev; do
umount $destination/$mountit
done
chroot, os, distrofrom, livecd, converting, raid, install, mdadm, mount, proc, sys, dev, update, initramfs, etc, quot, bind, mnt, bin, bash, z, echo, usage, dir, fi, destination, mountit, pts, unmount, paths, mounted, umount,