Gentoo Archives: gentoo-user

From: Mike Gilbert <floppym@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] mount -o bind /dev /mnt/gentoo/dev
Date: Tue, 23 Jun 2015 18:09:59
Message-Id: CAJ0EP40AOzgyJQ62+6weotOjsFGOwOsKnvQ=WxXSVuOLowDXzA@mail.gmail.com
In Reply to: Re: [gentoo-user] mount -o bind /dev /mnt/gentoo/dev by Alan McKinnon
1 On Tue, Jun 23, 2015 at 5:14 AM, Alan McKinnon <alan.mckinnon@×××××.com> wrote:
2 > On 23/06/2015 09:27, Ran Shalit wrote:
3 >> Hello,
4 >>
5 >> I am a beginner with Gentoo.
6 >> I have followed the instruction for the installation, and tried to see
7 >> that I really understand all of them.
8 >> There is the command:
9 >> mount -o bind /dev /mnt/gentoo/dev
10 >> Which I'm not sure I really understand.
11 >
12 >
13 > It's a bind mount, not a regular mount. A regular mount takes a
14 > volume/block device/whatever and mounts it somewhere.
15 >
16 > A bind mount makes a copied mount that is already present on your system
17 > and makes it also available somewhere else.
18 >
19 > You do not want /dev/ and /sys mounted twice - they are core system
20 > directories and bad things can happen if you mount them twice then
21 > change one of them. You get sync issues for one thing. Much much easier
22 > to use bind mounts and potential problems just go away
23
24 Err... that's not actually true. You can mount as many instances of
25 devtmpfs as you like; they all point to the same memory and contain
26 the same files. Add a file to one and it will appear in all other
27 instances. This is a distinction between tmpfs and devtmpfs.
28
29 sysfs is even more straightforward; the kernel maintains all of the
30 files in sysfs, so mounting it multiple times is no issue at all.