uname -r #-> 3.10.0-123.el7.x86_64 yum install kernel-devel kernel-headers cd /tmp wget http://vault.centos.org/7.0.1406/os/Source/SPackages/kernel-3.10.0-123.el7.src.rpm rpm -ihv kernel-3.10.0-123.el7.src.rpm (这时会在/root/rpmbuild/SOURCES下生成tar.xz包) cd ~/rpmbuild/SOURCES tar Jxvf linux-3.10.0-123.el7.tar.xz -C /usr/src/kernels/ cd /usr/src/kernels/ mv $(uname -r) $(uname -r)-old mv linux-3.10.0-123.el7 $(uname -r) cd $(uname -r) make mrproper cp ../$(uname -r)-old/Module.symvers ./ cp /boot/config-$(uname -r) ./.config make oldconfig make prepare make scripts make CONFIG_BLK_DEV_NBD=m M=drivers/block cp drivers/block/nbd.ko /lib/modules/$(uname -r)/kernel/drivers/block/ depmod -a
modprobe nbd 启用nbd模块
本文出自 “菜鸟也想飞” 博客,请务必保留此出处http://xiumin.blog.51cto.com/6205237/1878820
原文地址:http://xiumin.blog.51cto.com/6205237/1878820