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?
-
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.– Julie PelletierJul 2, 2016 at 17:39
1 Answer
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.
-
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
?– DeltikJul 2, 2016 at 22:53 -
-
-