Originally Posted by ocspecv
trying to do this now without any success. how do i mount to a folder off the linux live cd? (im presently using the livecd)
Since I am not the best person at explaining things I would reccomend reading this post through entirely before you attempt anything so that any of my out of order thoughts don't get lost.
Well you don't mount a folder, you mount a partition to a folder/location on your current linux filesystem tree.
When you install linux, even if you don't realise it, your HD is partitioned in a certain way. What happens in a partition may be created for the /home directory, but when it is created it has no clue that is it the /home directory. That gets decided later on, Ill come back to it in a moment.
Now.. When Grub boots(Or lilo, etc) it reads a file off your boot partition as it is saved in the MBR. Very simplified there, but the details can be confusing even for me, and we don't need to know them completely to do this.
At any rate, in the file it reads, in our case it is menu.lst it is told what partition is equivalent to the root partition of our linux install. The root partition is not to be confused with the folder and its contents /root which is in actuality the /home directory for the superuser. The root partition we are referring to for this is the '/' directory on your linux filesystem. So /home is in actuality the home folder on the root directory.
So why do we need to know this? Because what you need to mount is the partition that is your root partition. Depending on wether your HD is IDE or SATA/SCSI will determine where it is located. IDE HDs are in general /dev/hdx where the 'x' in hdx can be ANY letter. However for most people this will be 'hda' as that equates to the master device on your primary IDE channel. hdb would be the slave device if I remember right, though it has been some time since I bothered much with it. Pretty much the simplified way to remember it is it is the order in which your computer detects your devices. If in doubt mount /dev/hda and then cd to the directory you mounted it at and see if it is correct, if not go to the next device("/dev/hdb" in this case)
No for SATA and SCSI devices it is nearly identical but instead of being /dev/hdx it would be /dev/sdx again where the 'x' can be any letter.
Now the catch is, in most cases a typical hard drive will have more than one partition. As such we don't want to mount the entire hard drive, and will probably get an error if we try. As such in linux we determine what partition we are referencing in the above commands, by attaching the partition number at the end of the device ID. So for example... /dev/hda1 would be the first partition on the first IDE device(Usually the Hard Drive as I mentioned earlier) /dev/hda2 would be the second partition on the first IDE device, and so on. /dev/sda2 would be the second partition on the first SATA device. /dev/hdc1 would be the first partition on the third IDE device. Make sense so far I hope?
So what you would want to do is mount the correct partition at whatever location you wish to use to access it, and then use that location in your chroot command above. If you are in doubt as to which partition is correct, go ahead and mount them one at a time, cd to that folder, check if it is the correct partition. If it is not, cd OUT of that folder, and use the command umount to unmount that location, and move on to the next partition, repeat step one, until you find it
Then you can move on.
For the purposes of reinstalling grub, you need to make sure your /boot directory on your linux HD is mounted BEFORE you attempt to install grub. Otherwise it will hopefully just fail
On most general distros like Ubuntu, Suse, whatever, the boot folder is located on your root partition, so there is no extra work involved, though some people(Like myself) have it on its own partition as it is not needed at all once linux is booted, unless you are doing something like recompiling the kernel, in which case I mount it by hand.
Hope I wasn't to confusing, have fun.