Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to chroot for recovery purposes from install CD [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
h2sammo
Veteran
Veteran


Joined: 11 Mar 2009
Posts: 1025
Location: Michigan

PostPosted: Tue Mar 17, 2009 2:04 pm    Post subject: How to chroot for recovery purposes from install CD [solved] Reply with quote

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
View user's profile Send private message
Leon_UK
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2006
Posts: 128
Location: London

PostPosted: Tue Mar 17, 2009 2:16 pm    Post subject: Reply with quote

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.
Code:
fdisk -l


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
View user's profile Send private message
TheAbu
Apprentice
Apprentice


Joined: 08 Jun 2008
Posts: 160
Location: Lyon, France

PostPosted: Tue Mar 17, 2009 6:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
h2sammo
Veteran
Veteran


Joined: 11 Mar 2009
Posts: 1025
Location: Michigan

PostPosted: Thu Mar 19, 2009 12:53 am    Post subject: Reply with quote

worked
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum