Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Creating /dev/dk* nodes so as to be persistent



On Sat, 19 Oct 2013, Thomas Mueller wrote:
How do I make device nodes in the underlying disk file system?

How do I access the underlying file system and MAKEDEV?

Normally, /dev is on a disk file system. However, in your case, I think you did not run MAKEDEV at the right point during the installation process, so the /dev on disk is missing some entries, or perhaps it's almost empty. When you boot, /sbin/init notices that /dev/console is missing, and runs the moral equivalent of (cd /dev ; ./MAKEDEV -MM). That creates a /dev file system in memory (using mount_tmpfs(8) or mount_mfs(8)) and populates it. Anything in the memory file system is lost when you reboot.

You can run the "/sbin/mount" command, with no arguments, to check whether you have a memory file system mounted on /dev. If so, then
there will be a line like "tmpfs on /dev type tmpfs (local)".

        /sbin/mount | grep /dev

You can unmount the tmpfs file system:

        /sbin/umount /dev

Now that the tmpfs file system has been removed, your /dev directory should be on the underlying disk. To make device nodes there, use commands like this:

        cd /dev ./MAKEDEV all ./MAKEDEV dk16 dk17 dk18 dk19

You need to do all this as root, and some things might fail during the time that /dev is not fully populated (between the umount and the MAKEDEV). I'd probably do it in single user mode.

Instead of all the above, if you are able to access your disk from some other working NetBSD system, then you can mount it as /mnt, and run commands like (cd /mnt/dev ; ./MAKEDEV all; ./MAKEDEV dk16 dk17 dk18 dk19).


Now I don't know if fsck_root would run if root is above the /dev/dk* range.

I don't know.

NetBSD 6.1_STABLE hung on boot on MSI Z77 MPOWER motherboard, every time, most of the time reaching login prompt but hanging there.

Perhaps that could be fixed. You could report the problems via send-pr.

I could run fsck_ffs from FreeBSD.

There are some differences between NetBSD and FreeBSD's FFS file systems. I would probably not run the fsck from one OS on a disk from another OS.

Most valuable part of this USB-stick NetBSD installation is subversion (svn), which I don't want to disable by high-risk fixes to /dev.

I don't think the /dev fixes are high risk.

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index