View previous topic :: View next topic |
Author |
Message |
h2sammo Veteran
Joined: 11 Mar 2009 Posts: 1025 Location: Michigan
|
Posted: Tue Mar 17, 2009 2:04 pm Post subject: How to chroot for recovery purposes from install CD [solved] |
|
|
can anyone put the complete code for mounting the required drivers and unmounting them at the end, etc the whole nine yards. i need to chroot so i can change some settings in grub.conf.
i have seen a similar post on a different forum but i cant find it again and i bet others are looking for this info as well.
Last edited by h2sammo on Thu Mar 19, 2009 12:53 am; edited 2 times in total |
|
Back to top |
|
|
Leon_UK Tux's lil' helper
Joined: 06 Dec 2006 Posts: 128 Location: London
|
Posted: Tue Mar 17, 2009 2:16 pm Post subject: |
|
|
for chrooting into an install, I would do it just like the handbook, first make sure you know what the harddrives are in relation to /dev (different livecd's can report them differently
so.
that will give you an output of all harddrives and their partions you can generally identify what is what by the size of the disk. so if it says your install is on sda and it has 3 partions (sda1,sda2,sda3)
you would then use that for mounting the partions (if the cd does not have /mnt/gentoo you can make it with mkdir /mnt/gentoo)
Code: | mount /dev/sda3 /mnt/gentoo
mount /dev/sda1 /mnt/gentoo/boot
# next mount proc and /dev
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
#once everything is mounted we simply chroot into that install
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile
|
Now everything you do in that terminal will modify your install once you are done, you will need to exit the chroot and unmount the drives/partions
Code: | exit
cd
umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo
reboot
|
we use the 'cd' command to go back to the root directory of the livecd because if you are still in one of your partions it will not unmount because it will be reported as being in use/busy
hope this helps _________________ AMD 7750 BE (@3.0ghz) || pci-e 7600GT (@650/800)Nvidia-drivers || 4gb ddr2 || ~amd64(funtoo) ||gentoo-sources-2.6.35-r1 |
|
Back to top |
|
|
TheAbu Apprentice
Joined: 08 Jun 2008 Posts: 160 Location: Lyon, France
|
Posted: Tue Mar 17, 2009 6:38 pm Post subject: |
|
|
Leon explanation is very complete and describe what you should do to chroot on your system, now, if you only need to edit your grub.conf, you can simply boot from the cd and mount your /boot partition (in your case, it should be:
# mount /dev/hda1 /mnt/gentoo
then you can use nano to edit your grub.conf
# nano -w /mnt/gentoo/grub/grub.conf
once you are finished editing
# umount /mnt/gentoo
and you should be fine
For that particular task, both way works fine, the second is just a tad faster. _________________ "Please, forgive my bad English"
Gentoo made me love using my computer again. Thank you to the Gentoo devs and more generally to all the people who makes GNU/Linux possible |
|
Back to top |
|
|
h2sammo Veteran
Joined: 11 Mar 2009 Posts: 1025 Location: Michigan
|
Posted: Thu Mar 19, 2009 12:53 am Post subject: |
|
|
worked |
|
Back to top |
|
|
|