AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[kernel-modules](server)

Martin Hope
Volker Raschek
Asked: 2022-01-13 01:50:27 +0800 CST

RockyLinux:无法加载 cifs 模块

  • 1

我已经安装了 RockyLinux 8.5 并试图通过 cifs 挂载一个目录。我收到以下错误消息:

# mount -t cifs -o user=<remarked>,domain=<remarked>,password=<remarked> //<remarked>/backups /mnt/backups
mount error: cifs filesystem not supported by the system 
mount error(19): No such device 
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

RPM 软件包cifs-utils和samba-utils都已安装,但似乎内核无法找到该cifs模块,因为无法加载它:

# find / -name "cifs"
/usr/lib/modules/4.18.0-348.el8.0.2.x86_64/kernel/fs/cifs
# lsmod | grep cifs
# modprobe cifs
modprobe: FATAL: Module cifs not found in directory /lib/modules/4.18.0-348.el8.0.2.x86_64

有谁知道为什么 RockyLinux 无法加载cifs模块?这可能是安装不工作的问题。

这里还有我的dmesg 日志。我找不到任何关于 cifs 的信息。

cifs kernel-modules rocky-linux
  • 2 个回答
  • 601 Views
Martin Hope
catleeball
Asked: 2021-09-27 17:32:18 +0800 CST

RHEL8 上的 BTRFS - 编译内核模块或使用户空间工具工作

  • 1

语境

我最近安装了 RHEL 8 却没有意识到它不再支持 BTRFS。

不幸的是,我在 BTRFS RAID10 中有 4 个磁盘。我的其他磁盘上没有足够的空间来保存 BTRFS 磁盘上的数据,因此在从 USB 驱动器启动时将其全部复制到其他地方是不可能的。

我有我最初的问题,然后是一些关于我采取的方法失败的后续问题。随意只关注这个问题的“如何让 BTRFS 工作”部分,尽管如果你有任何部分的答案,我很想了解其他问题。

问题 1

  1. 是否有一种(相对)简单的方法可以让 BTRFS 在 RHEL8 上工作?

用户空间 btrfs-progs

我的第一次尝试是btrfs-progs使用以下内容进行编译和安装:

# Install deps
sudo dnf install libuuid-devel libblkid-devel lzo-devel zlib-devel libzstd-devel e2fsprogs-devel e2fsprogs-libs e2fsprogs libgcrypt-devel libsodium-devel libattr-devel
# Install deps for doc gen
sudo dnf install asciidoc xmlto source-highlight

# Shallow-clone latest release
git clone --depth 1 --branch v5.14.1 https://github.com/kdave/btrfs-progs.git
cd btrfs-progs
git switch -c v5.14.1

# Build
#   --disable-zoned since that feature needs kernel >=5.10
export CFLAGS="-O3 -pipe -frecord-gcc-switches -mtune=native -march=native"
export CPPFLAGS=$CFLAGS
export SODIUM_CFLAGS=$CFLAGS
export ZSTD_CFLAGS=$CFLAGS
export ZLIB_CFLAGS=$CFLAGS
export UUID_CFLAGS=$CFLAGS
export PYTHON_CFLAGS=$CFLAGS

./autogen.sh
./configure --with-crypto=libsodium --disable-zoned
make -j12
sudo make install

它似乎安装正确并且我的用户可以访问:

$ which btrfs
/usr/local/bin/btrfs

$ ls -1 /usr/local/bin/ | grep btrfs
btrfs
btrfsck
btrfs-convert
btrfs-find-root
btrfs-image
btrfs-map-logical
btrfs-select-super
btrfstune
fsck.btrfs
mkfs.btrfs

$ btrfs version
btrfs-progs v5.14.1 

但是,默认情况下,root 显然没有/usr/local/bin在其路径中。我添加了export PATH+=":/usr/local/bin" to /etc/profile and/root/.bash_profile , but neither of them seem to get sourced automatically when using sudo or when dropping into a root shell withsudo su`。

当指定二进制文件的完整路径时,它会抱怨它 can't open /dev/btrfs-control。查询我的本地搜索引擎,有人建议需要 udev,但已经安装(可能配置错误?)

$ sudo btrfs version
sudo: btrfs: command not found

$ sudo /usr/local/bin/btrfs device scan
Scanning for Btrfs filesystems
WARNING: failed to open /dev/btrfs-control, skipping device registration: No such file or directory
WARNING: failed to open /dev/btrfs-control, skipping device registration: No such file or directory
WARNING: failed to open /dev/btrfs-control, skipping device registration: No such file or directory
WARNING: failed to open /dev/btrfs-control, skipping device registration: No such file or directory
ERROR: there were 4 errors while registering devices

其他 BTRFS 命令似乎有效:

$ sudo /usr/local/bin/btrfs filesystem show /dev/sda
Label: 'wdred'  uuid: aaaa-bbbb-cccc-dddd-eeee
    Total devices 4 FS bytes used 2.13TiB
    devid    1 size 5.46TiB used 1.07TiB path /dev/sda
    devid    2 size 5.46TiB used 1.07TiB path /dev/sdc
    devid    3 size 5.46TiB used 1.07TiB path /dev/sdb
    devid    4 size 5.46TiB used 1.07TiB path /dev/sdd

但是,鉴于上述错误,我一直害怕挂载分区或对它们执行任何操作,因为担心它缺少的组件会导致它破坏我的数据。

问题 2、3、4

  1. 鉴于上述错误,尝试使用 btrfs 挂载磁盘是否安全?
  2. 上的/dev/btrfs-control错误是btrfs device scan怎么回事?
  3. 默认情况下,我怎样才能获得sudo并sudo su拥有/usr/local/bin它的路径?

BTRFS 内核模块

我想知道编译内核模块是否会更好,但是几乎没有内核黑客经验,结果很糟糕。

看来我需要CONFIG_BTRFS_FS=m在我的内核配置中设置才能启动。它目前不存在,我似乎记得能够在menuconfig.

$ grep "BTRFS" /boot/config-4.18.0-305.19.1.el8_4.x86_64 
# CONFIG_BTRFS_FS is not set

RHEL 文档提到了如何加载内核模块等,但没有提到如何构建它们。我咨询了 archwiki,并尝试从 Red Hat 站点下载 RHEL8 内核。RHEL8 的下载页面有一个带有 20G .iso 文件的“Sources”选项卡。我下载了它,安装了它,发现里面塞满了 .rpm 文件,看起来一点也不像 linux 内核源代码库。我有点失落。

然后我去了/usr/src/kernels/,初始化了一个 git repo,因为害怕我会破坏一些重要的东西,然后继续试图弄清楚如何构建内核模块或更改 menuconfig 中的内容。

$ cd /usr/src/kernels/4.18.0-305.19.1.el8_4.x86_64
$ sudo su
# git init
# git add -A
# git commit -m "Unmodified kernel"

# make mrproper
  HOSTCC  scripts/basic/bin2c
scripts/kconfig/conf  --syncconfig Kconfig
arch/x86/Makefile:184: *** Compiler lacks asm-goto support..  Stop.
make: *** [Makefile:1361: _clean_arch/x86] Error 2

由于缺乏 asm-goto 支持,互联网建议我可能需要elfutils-libelf-devel,但我似乎已经有了。

对于 funzies,我尝试使用clang和 with构建它gcc-toolset-10,但两者都有相同的错误。

问题 5

  • 任何想法为什么Compiler lacks asm-goto support?
  • 关于如何构建内核模块/修补内核/修改系统内核的好资源是什么?

系统信息

$ uname -a
Linux rhel 4.18.0-305.19.1.el8_4.x86_64 #1 SMP Tue Sep 7 07:07:31 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux

$ gcc --version
gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1)


$ scl run gcc-toolset-10 'gcc --version'
gcc (GCC) 10.2.1 20201112 (Red Hat 10.2.1-8)

$ clang --version
clang version 11.0.0 (Red Hat 11.0.0-1.module+el8.4.0+8598+a071fcd5)

感谢您阅读到这里!任何帮助表示赞赏。

redhat linux-kernel kernel-modules rhel8 btrfs
  • 1 个回答
  • 896 Views
Martin Hope
fzeidler
Asked: 2020-08-04 05:29:08 +0800 CST

从 Ubuntu 18.04 -> 20.04 升级后缺少 iptables 内核模块

  • 3

从 Ubuntu 18.04 升级到 20.04 (focal) 后,缺少 iptables 内核模块:

root@server:~# iptables -L
modprobe: FATAL: Module ip_tables not found in directory /lib/modules/5.4.0-42-generic
iptables v1.8.4 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

我尝试了以下方法,但没有解决问题:

sudo apt-get install --reinstall iptables
sudo apt-get install --reinstall linux-headers-$(uname -r)
sudo dpkg-reconfigure iptables
dkms autoinstall

还安装了 linux-modules-extra

的输出ls -R /var/lib/dkms是:

/var/lib/dkms:
dkms_dbversion  wireguard

/var/lib/dkms/wireguard:
1.0.20200611  kernel-5.4.0-42-generic-x86_64

/var/lib/dkms/wireguard/1.0.20200611:
5.4.0-42-generic  source

/var/lib/dkms/wireguard/1.0.20200611/5.4.0-42-generic:
x86_64

/var/lib/dkms/wireguard/1.0.20200611/5.4.0-42-generic/x86_64:
log  module

/var/lib/dkms/wireguard/1.0.20200611/5.4.0-42-generic/x86_64/log:
make.log

/var/lib/dkms/wireguard/1.0.20200611/5.4.0-42-generic/x86_64/module:
wireguard.ko

有什么想法可以重新激活 iptables 吗?

ubuntu iptables kernel-modules ubuntu-20.04
  • 1 个回答
  • 24278 Views
Martin Hope
Dholakiya Hardik
Asked: 2020-03-23 05:22:46 +0800 CST

在 Debian 8.3 中获取网络 UNCLAIMED

  • 0

当我检查时lshw,我得到以下结果

user@user# lshw -c network
  *-network
       description: Ethernet interface
       product: I210 Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: eth0
       version: 03
       serial: **
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=igb driverversion=5.2.15-k firmware=3.25, 0x800005d0 ip=10.10.6.100 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:16 memory:f7e00000-f7e7ffff ioport:e000(size=32) memory:f7e80000-f7e83fff
  *-network
       description: Ethernet interface
       product: I210 Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: eth1
       version: 03
       serial: **
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=igb driverversion=5.2.15-k duplex=full firmware=3.25, 0x800005d0 ip=192.168.2.100 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
       resources: irq:17 memory:f7d00000-f7d7ffff ioport:d000(size=32) memory:f7d80000-f7d83fff
  *-network UNCLAIMED
       description: Network controller
       product: AR9462 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:03:00.0
       version: 01
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: latency=0
       resources: memory:f7c00000-f7c7ffff memory:f7c80000-f7c8ffff

根据我的研究,所需的驱动程序是 ath9k。但是 modprobe ath9k 给出了以下错误。

user@user#modprobe ath9k
modprobe: FATAL: Module ath9k not found.

在实际中,此文件位于库模块文件夹中

user@user:/lib/modules/3.16.0-4-amd64/kernel/drivers/net/wireless/ath# ls
ar5523  ath10k  ath5k  ath6kl  ath9k  ath.ko  carl9170  wil6210


user@user:/lib/modules/3.16.0-4-amd64/kernel/drivers/net/wireless/ath/ath9k# ls
ath9k_common.ko  ath9k_htc.ko  ath9k_hw.ko  ath9k.ko
debian wifi drivers kernel-modules linux-networking
  • 1 个回答
  • 1212 Views
Martin Hope
Kevin AB
Asked: 2016-09-01 09:01:39 +0800 CST

我需要重新编译内核吗?

  • 0

编译内核,还有一个选项我忘了给你我的卡支持。我需要重新编译内核吗?

$ Make && make modules_install
$ Make install

或者有没有更简单的方法来激活这个功能而不是再次编译所有东西。

kernel kernel-modules
  • 1 个回答
  • 40 Views
Martin Hope
raldi
Asked: 2010-03-19 20:47:32 +0800 CST

Linux 说内核模块有一个未知符号,但另一个加载的模块提供了它

  • 5

我正在尝试为 USB DAQ 盒安装驱动程序,这很烦人,我必须自己编译。我相信我已经成功了——我有两个 .ko 文件:

-rw-r--r--  1 root  root  45271 2010-03-18 21:24 advdrv_core.ko
-rw-r--r--  1 root  root  24312 2010-03-18 21:24 usb4761.ko

我能够在第一个上运行 insmod 而没有发生任何事故,但是当我尝试第二个时,我收到了大量消息:

kernel: [686782.106547] usb4761: no symbol version for adv_process_info_check_event
kernel: [686782.106555] usb4761: Unknown symbol adv_process_info_check_event
kernel: [686782.106691] usb4761: no symbol version for advdrv_unregister_driver
kernel: [686782.106695] usb4761: Unknown symbol advdrv_unregister_driver

但是, advdrv_core.ko 提供了这些符号。我的内核似乎肯定有它们在内存中:

# cat /proc/kallsyms | grep advdrv_unregister_driver
f8d88504 r __ksymtab_advdrv_unregister_driver   [advdrv_core]
f8d888d2 r __kstrtab_advdrv_unregister_driver   [advdrv_core]
f8d885a4 r __kcrctab_advdrv_unregister_driver   [advdrv_core]
086eb8fb a __crc_advdrv_unregister_driver       [advdrv_core]
f8d86e90 t advdrv_unregister_driver     [advdrv_core]

为什么我的 insmod 声称它们是未知符号?

编辑:以下答案之一建议我将文件复制到 /lib/modules 并运行 depmod。所以我这样做了,使用 depmod 的 -v (详细)选项。输出中有一堆行,例如:

/lib/modules/2.6.27-7-generic/kernel/drivers/pcmcia/usb4761.ko needs "advdrv_unregister_driver": /lib/modules/2.6.27-7-generic/kernel/drivers/pcmcia/advdrv_core.ko

然后我运行 rmmod advdrv_core 以确保我是全新安装的,运行 modprobe advdrv_core,最后运行 modprobe usb4761。

同样,一堆失败的符号,包括 advdrv_unregister_driver。

linux dependencies kernel-modules
  • 2 个回答
  • 24438 Views
Martin Hope
luison
Asked: 2010-02-24 02:51:26 +0800 CST

Karmic iptables 在 OpenVZ 容器上缺少内核模块

  • 1

在将我的 Ubuntu 服务器 p2v 迁移到我与之堆叠的 OpenVZ 容器失败后,我想我会尝试基于 Ubuntu 9.10 的干净 OpenVZ 模板重新安装(来自 OpenVZ wiki)

当我尝试在 VM 机器上加载我的 iptables 规则时,我遇到了一些错误,我认为这些错误与未从 /vz/XXX.conf 模板模型加载到 VM 上的内核模块有关。

我一直在测试我发现的一些帖子,但我遇到了错误:

WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
FATAL: Could not load /lib/modules/2.6.24-10-pve/modules.dep: No such file or directory
iptables-restore v1.4.4: iptables-restore: unable to initialize table 'raw'

Error occurred at line: 2
Try `iptables-restore -h' or 'iptables-restore --help' for more information.

我读到了模板没有加载所有 iptables 模块,所以我将模块添加到 VZ 虚拟机的 XXX.conf 中,如下所示:

IPTABLES="ip_tables iptable_filter iptable_mangle ipt_limit ipt_multiport ipt_tos ipt_TOS ipt_REJECT ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_LOG ipt_length ip_conntrack ip_conntrack_ftp ip_conntrack_irc ipt_conntrack ipt_state ipt_helper iptable_nat ip_nat_ftp ip_nat_irc"

由于错误仍然存​​在,我读到我应该在虚拟机上再次构建依赖项:

depmod -a but this returned an error:

WARNING: Couldn't open directory /lib/modules/2.6.24-10-pve: No such file or directory
FATAL: Could not open /lib/modules/2.6.24-10-pve/modules.dep.temp for writing: No such file or directory

因此,我再次阅读了有关创建空目录并重做“depmod -a”的内容。

我现在没有得到依赖项错误,但得到了这个,我不知道如何继续:

WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
FATAL: Module ip_tables not found.
iptables-restore v1.4.4: iptables-restore: unable to initialize table 'raw'

Error occurred at line: 2
Try `iptables-restore -h' or 'iptables-restore --help' for more information.

我知道虚拟机上的 iptables 规则必须不同,也许我们尝试应用的一些规则(来自我们的物理服务器)不兼容,但这些只是我希望能够进行的源 IP 和目标端口检查有可用的。我听说在 CentOS 模板上没有问题,所以我理解是与 VM 配置有关。

任何帮助将不胜感激。

linux iptables openvz kernel-modules ubuntu-9.10
  • 3 个回答
  • 3116 Views
Martin Hope
Daniel Quinn
Asked: 2010-01-15 09:24:48 +0800 CST

使用不同的参数加载 usbserial 两次?

  • 0

我有两个 USB 设备,都需要usbserial加载才能访问它们。但是,其中一个设备,USB GPRS 调制解调器要求它像这样加载:

modprobe usbserial vendor=0x1410 product=0x4400

而另一个像这样加载就好了:

modprobe usbserial

那么我可以同时使用这两种设备吗?这些附加vendor和product论点的目的是什么?

linux usb kernel-modules
  • 1 个回答
  • 714 Views
Martin Hope
yanchenko
Asked: 2009-05-29 09:57:02 +0800 CST

如何判断需要哪些内核模块?

  • 5

比如说,我有一个默认的 Gentoo 安装,其中编译了所有模块(例如设备驱动程序)。从这一点来看,下次我重新编译内核时,有没有一种简单的方法可以排除未使用的模块?

gentoo kernel-modules
  • 9 个回答
  • 10891 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve