2 ms·
Running a service inside a chroot might require some combination of /dev/{null,random,console,log} to be present inside the chroot, and bind-mounting /dev expos
by tremon 5y ago
Running a service inside a chroot might require some combination of /dev/{null,random,console,log} to be present inside the chroot, and bind-mounting /dev exposes the entire underlying system (raw disk nodes) inside the chroot.
So there's actually a good reason for being able to create device nodes outside /dev.
- cperciva 5y agoOn FreeBSD you can mount devfs but tell it to only expose a subset of the device nodes, for exactly this reason.
- kragen 5y agoYeah, I used to do this to NFS-export a root filesystem for my diskless Sun-3. The NFS server was running Linux and the Sun was running IIRC NetBSD, so some of the device numbers in the Sun's /dev needed to be different. Pretty rickety setup but it worked okay. I don't recall ever accidentally overwriting my root filesystem or hanging up the modem line by accessing the bogus device nodes.