You are not logged in.

#1 2003-09-25 19:09:24

marin_linuxer
Member
From: San Rafael, CA U.S.A.
Registered: 2003-09-03
Posts: 111
Website

'chroot /mnt /bin/bash ...'

Just your friendly village-idiot, here, with another nOOb question:

While installing Arch from the base-iso, I've come to really enjoy keeping my config files on another partition so that I don't have to keep re-writing the install configs(rc.conf; lilo,conf, etc.).  I just 'ALT-F2' and mount my part on '/mnt/mnt/' and 'cp ... /mnt/etc'.  Works great.  However, since creating my own Con Kolivas patched 2.4.22-ck2 kernel, I have been installing that by:

# chroot /mnt/ /bin/bash
# pacman -U /mnt/.../kernel...

Now that seems to work fine and then I run 'lilo -v', re-boot and go on my merry way.

Question:  Why do some people add the following code _before_ they 'chroot'?

# mount -o bind /dev /mnt/dev
# mount -o bind /proc /mnt/proc

What advantages does that afford during install or using the cd-iso as a recovery disk?  I'm just not clear on the difference.

Thanx.


-- Linux!  Isn't it time?

Offline

#2 2003-09-26 15:31:30

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: 'chroot /mnt /bin/bash ...'

Adding those two lines fills in the /dev/ and /proc/ filesystems within the chrooted directory.  If you don't do those and check /dev or /proc after chrooting you'll notice they are empty.  For the most part, this is a bad thing.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#3 2003-09-26 16:21:17

marin_linuxer
Member
From: San Rafael, CA U.S.A.
Registered: 2003-09-03
Posts: 111
Website

Re: 'chroot /mnt /bin/bash ...'

OK, so my 'technique' of 'chroot' without the /dev & /proc switches works because Pacman is only using the mounted 'root' to install the kernel and is not attempting to access any other /dev's or /proc's?

I think that makes sense.  It would be more important to mount /dev & /proc for more involved operations?

I'm learning sooo much with Arch(!!).


-- Linux!  Isn't it time?

Offline

#4 2003-09-26 16:32:13

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: 'chroot /mnt /bin/bash ...'

I'd think that lilo needed the dev devices to write to the boot sector... but anyway.  Yeah, the more you try to do in a chroot, the more likely you'll need the dev and proc filesystems.  It could be that the arch install process has already mounted those (check 'mount' right before you do your chroot) and that's why it works in your case.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#5 2003-09-26 16:49:07

marin_linuxer
Member
From: San Rafael, CA U.S.A.
Registered: 2003-09-03
Posts: 111
Website

Re: 'chroot /mnt /bin/bash ...'

Thanx, that makes sense.  I appreciate the response.


-- Linux!  Isn't it time?

Offline

Board footer

Powered by FluxBB