Uname-r #-> 3.10.0-123.el7.x86_64yum Install kernel-devel kernel-headerscd/tmpwget http://vault.centos.org/ 7.0.1406/OS/SOURCE/SPACKAGES/KERNEL-3.10.0-123.EL7.SRC.RPMRPM-IHV kernel-3.10.0-123.el7.src.rpm (This will be in/root/ Rpmbuild/sources build TAR.XZ Package) CD ~/rpmbuild/sourcestar JXVF linux-3.10.0-123.el7.tar.xz-c/usr/src/kernels/cd/usr/src /KERNELS/MV $ (uname-r) $ (uname-r)-OLDMV Linux-3.10.0-123.el7 $ (uname-r) CD $ (uname-r) make MRPROPERCP. /$ (Uname-r)-old/module.symvers./cp/boot/config-$ (uname-r)./.configmake oldconfigmake Preparemake Scriptsmake Config_blk_dev_nbd=m M=DRIVERS/BLOCKCP drivers/block/nbd.ko/lib/modules/$ (uname-r)/kernel/drivers/block/depmod-a
Modprobe NBD Enable NBD module
This article from "Rookie also want to fly" blog, please be sure to keep this source http://xiumin.blog.51cto.com/6205237/1878820
Centos7 installing the Compile NBD module steps