1

I am running a server with Debian 8, and after running modprobe nbd, the program runs just fine. However, the device is not created since /dev/nbd0 does not exist. What should I do to get modprobe to run properly?

1
  • I have a feeling that you're comparing an old version to the system you're on. The fact that your application can access the networked drive is already proof enough that it is working. Jul 2, 2016 at 17:39

1 Answer 1

4

I have a partial answer that effectively works around your problem but does not conclusively explain why the problem happened in the first place.

Resolution

Run these commands:

sudo rmmod nbd 
sudo mount -t devtmpfs none /dev 
sudo modprobe nbd 
ls /dev/nbd*

The final command should look like this:

root@node51 [~]# ls /dev/nbd*
/dev/nbd0  /dev/nbd1  /dev/nbd10  /dev/nbd11  /dev/nbd12  /dev/nbd13  /dev/nbd14  /dev/nbd15  /dev/nbd2  /dev/nbd3  /dev/nbd4  /dev/nbd5  /dev/nbd6  /dev/nbd7  /dev/nbd8  /dev/nbd9

Explanation

We determined in chat that /dev was not being updated because it was mounted as tmpfs instead of as devtmpfs.

You can check the second column of the following command to see if /dev is mounted as tmpfs or devtmpfs:

df -T /dev

Without devtmpfs, only the device and character files defined during the initial boot would be populated in /dev. devtmpfs allows devices to be added and removed after boot.

It's not possible to unmount /dev with umount /dev because the special files in there are in use, but it is possible to load a fresh devtmpfs over the existing /dev mount.

sudo mount -t devtmpfs none /dev mounts a devtmpfs over the existing mount at /dev.

Now, when you do sudo modprobe nbd, the device files /dev/nbd0 through /dev/nbd15 get populated in /dev.

Cause

I did not determine why /dev was mounted as tmpfs instead of devtmpfs or why udev wasn't running. devtmpfs should have been the default.

This answer on Server Fault might have some leads.

9
  • Hmm. I tried doing this, and then doing sudo rmmod nbd. It actually removed the nbd from somewhere (I don't know where). Given that i'm running the whole system on google cloud platform, any tips on where the nbd might be? Jul 2, 2016 at 22:24
  • @SalmonKiller: Do you have the stock kernel that ships with Debian 8? Does nbd: registered device at major show up in /var/log/syslog?
    – Deltik
    Jul 2, 2016 at 22:53
  • Nope, it doesn't show up in /var/log/syslog. Jul 2, 2016 at 23:29
  • @SalmonKiller: And what kernel are you running?
    – Deltik
    Jul 3, 2016 at 0:16
  • 3.16.0-4-amd64 is the kernel Jul 3, 2016 at 0:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .