Skip to main content

2.linux面试题(二)

如何查看网卡速率?

使用 ethtool 命令:

ethtool <interface_name>	#<interface_name> 是你要查看的网卡接口的名称,比如 eth0。

使用 ip 命令:

ip link show <interface_name>	#<interface_name> 是你要查看的网卡接口的名称。

示例:

ethtool

ethtool enp7s0
#显示结果
Settings for enp7s0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
2500baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
2500baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 1000Mb/s #1000M速率
Duplex: Full
Auto-negotiation: on
master-slave cfg: preferred slave
master-slave status: slave
Port: MII
PHYAD: 0
Transceiver: external
Supports Wake-on: pumbg
Wake-on: d

ip

ip link show enp7s0
#显示结果
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master brqdcc333fb-83 state UP mode DEFAULT group default qlen 1000 #1000M速率
link/ether 58:11:22:b9:38:7f brd ff:ff:ff:ff:ff:ff

是什么是lvm,raid与lvm的使用场景

LVM(Logical Volume Manager): LVM是一种用于Linux系统的逻辑卷管理器,它允许在硬盘上创建和管理逻辑卷,提供了对存储资源更灵活的控制。LVM将物理存储划分为物理卷(Physical Volumes),然后将这些物理卷组合成卷组(Volume Groups),最终创建逻辑卷(Logical Volumes)供操作系统使用。

RAID(Redundant Array of Independent Disks): RAID是一种将多个硬盘组合起来形成一个逻辑单元的技术,目的是提高数据的冗余性、性能和/或可用性。RAID有多个级别,包括RAID 0、RAID 1、RAID 5、RAID 10等,每种级别都有不同的特点和用途。

  1. RAID的使用场景:
    • RAID 0: 适用于对性能要求高而对数据冗余要求低的场景,因为RAID 0提供了较高的性能,但没有冗余。
    • RAID 1: 适用于对数据冗余要求高而对性能要求适中的场景,因为RAID 1提供了镜像,但写性能相对RAID 0较低。
    • RAID 5: 适用于对性能和数据冗余要求平衡的场景,因为RAID 5提供了较好的读性能和一定的冗余。
    • RAID 10: 适用于对性能和数据冗余要求都较高的场景,因为RAID 10结合了RAID 1和RAID 0的特点。
  2. LVM的使用场景:
    • 动态卷管理: LVM允许在运行时动态地调整逻辑卷的大小,这在需要对存储空间进行灵活管理的情况下非常有用。
    • 快照: LVM支持创建快照,用于备份或测试目的。快照是逻辑卷的只读镜像,可以在不影响原始数据的情况下进行备份或测试。
    • 扩展和收缩卷组: 可以在不停机的情况下扩展或收缩LVM卷组,使得对存储资源的管理更加灵活。

      inode满了有什么影响