1. PCIe 固态硬盘与SSD有什么区别
一、指代不同
1、PCIe 固态硬盘:是一种高速串行计算机扩展总线标准,它原来的名称为“3GIO”,是由英特尔在2001年提出的,旨在替代旧的PCI,PCI-X和AGP总线标准。
2、SSD:即固态电子存储阵列硬盘。由控制单元和固态存储单元(Flash芯片)组成。
二、特点不同
1、PCIe 固态硬盘:属于高速串行点对点双通道高带宽传输,所连接的设备分配独享通道带宽,不共享总线带宽,主要支持主动电源管理,错误报告,端对端的可靠性传输,热插拔以及服务质量(QOS)等功能。
2、SSD:结构简单,在写入数据时电压变化的区间小,所以寿命较长,传统的SLC NAND闪存可以经受10万次的读写。而且因为一组电压即可驱动,所以其速度表现更好。
三、原理不同
1、PCIe 固态硬盘:在消费者,服务器和工业应用中运行,作为主板级互连(连接主板外围设备),无源背板互连以及作为附加板的扩展卡接口。
2、SSD:应用于军事、车载、工控、视频监控、网络监控、网络终端、电力、医疗、航空等、导航设备等领域。
2. 固态硬盘在linux下怎么优化
1.使用Ext4 without journaling文件系统
传统的SSD+Linux组合一般推荐Ext2文件系统,主要是考虑到Ext3、Ext4需要额外的记录日志,会缩短SSD使用寿命,而且新出现的TRIM技术在Ext2中有两个缺点:
仅支持离线TRIM,换句话说文件系统必须只读挂载;
需要手动执行hdparm命令或wiper.sh脚本。
Ext4则没有这些限制,允许TRIM后台运行,并且日志记录功能可以手动关闭(没有日志的情况下,文件系统更容易损坏,如突然断电),如果你甘愿冒这样的风险,从而延长SSD使用寿命,值得一试。另外,许多测试中如:Testing EXT4 & Btrfs On A Serial ATA 3.0 SSD,像Btrfs这样为SSD准备的文件系统不如Ext4速度快(用SSD不就为了快么)。
所以,上面安装系统时,选择了Ext4系统,接下来需要关闭日志功能。
首先,系统挂载时无法停用日志功能,所以需要进入刚才的U盘系统,利用root权限执行:
tune2fs -O ^has_journal /dev/sda1
即关闭/dev/sda1上的日志功能。
然后,运行操作系统检测:
e2fsck -f /dev/sda1
不这样,文件系统可能会出错。
最后,重启,进入SSD中的系统,检查是否设置成功:
dmesg | grep EXT4
如果出现:
EXT4-fs (sda1): mounted filesystem without journal
说明设置成功。
原来是:mounted filesystem with ordered data mode
如果需要再次开启日志功能,只要运行tune2fs -O has_journal /dev/sda1即可。
2.开启TRIM功能
TRIM是一种操作系统调度SSD块写入的方式。主要是因为同一个SSD的闪存单元频繁操作会磨损,影响使用寿命,区别于传统的机械硬盘处理删除数据。Linux内核自2.6.33开始支持TRIM。
首先,检查内核版本是否支持TRIM:
uname -a
然后,检查SSD硬盘是否支持TRIM:
hdparm -I /dev/sda
如果显示比如(不同硬件可能不同提示):
* Data Set Management TRIM supported
说明支持。
这两个条件都满足,在/etc/fstab中将:
/dev/sda1 / ext4 defaults 改为:
/dev/sda1 / ext4 discard,defaults 分区、挂载点、已经存在的选项不一定一样。
测试新的fstab文件:
mount -oremount /dev/sda1
然后挂载:
mount
如果显示discard字样,说明成功,如:
/dev/sda1 on / type ext4 (rw,discard)
3.swap空间处理
对于大内存来说swap基本上都是空闲的,除非电脑进入休眠状态,系统会将内存内容转到swap中。有了SSD,开关机都在几秒中,对我来说swap没用,所以上面直接不分配swap空间。
如果分配了也行,空间要小,而且通过设置/proc/sys/vm/swappiness里面的值,来减少swap换出量:
echo 1 > /proc/sys/vm/swappiness
0到100之间,值越大换出量越大。
4.设置noatime
当访问文件时,系统会更新last-access这个文件/目录元数据,设置noatime后可以减少这种操作。
将2步中的:
/dev/sda1 / ext4 discard,defaults 改为:
/dev/sda1 / ext4 noatime,discard,defaults 测试设置成功方法与上面一样。
5.使用noop磁盘调度
通常操作系统调度机械硬盘时会提供一些数据的物理位置,这样有利于机械硬盘优化寻道,但是对SSD没意义,所以采用noop磁盘调度,即简单发送请求,可以提高效率。
可以通过以下命令查看调度方法:
cat /sys/block/sda/queue/scheler
比如显示:
[noop] deadline cfq
在/etc/rc.local中添加如下语句:
echo noop > /sys/block/sda/queue/scheler
6.内存分区加速
如果内存够大,可以用ramdisk的方式,将一些经常变化的位置如/tmp放入内存,加快速度,减少对SSD的访问。
依然是加在/etc/fstab中:
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/log tmpfs defaults,noatime,mode=1777 0 0
更新方法与2相同,记得将浏览器等程序的缓存目录设置到/tmp下。
3. nvme ssd 应该使用什么引导Linux
省去了控制器的NVMe比SAS/SATA的热插拔要复杂的多。在进行热插拔测试之前,第一步内就是要确认当前的系统是否容支持热插拔。
1,确认SSD的支持
对于SSD,热插拔需要保证在插盘的过程中不会产生电流波峰而损坏器件;拔盘的时候,不会因为突然掉电而丢失数据。这个可以向SSD供应商确定或者查看产品规格书。
2,确认PCIe卡槽的支持
上面提到,NVMe是直接连接到PCIe Bus上的,U.2接口也是直接跟PCIe相连(当判断插入的设备为NVMe SSD时)。某些U.2接口内部连接的PCIe卡槽并不支持热插拔。PCIe Spec规定了热插拔寄存器。下图(通过lspci -vvv获取)显示了一个PCIe卡槽的Capabilities寄存器信息。其中LnkSta,SltCap,SltCtl和SltSta 4个部分在热插拔过程中比较有用(具体意义请参考PCIe Spec)。HotPlug和Surprise是最基础的判断热插拔的标志位。SltSta中有一个PresDet位指示当前是否有PCIe设备插入卡槽。
4. 在LINUX中如何加载驱动网卡
直接找好对应的驱动 一般都会有readme 或者install 之类的说明文档来告诉你如何去安装这个网卡驱动的
Linux* Base Driver for the Atheros(R) AR8121/AR8113 PCI-E Ethernet Adapter
==========================================================================
Contents
========
- In This Release
- Building and Installation
- Command Line Parameters
- Additional Configurations
- Known Issues
- Support
In This Release
===============
This file describes the Linux* Base Driver for the Atheros(R) AR8121/AR8113 PCI-E
Ethernet Adapter, version 1.0.0.5 This driver supports the 2.4.x and 2.6.x kernels.
This driver is only supported as a loadable mole at this time. Atheros is not
supplying patches against the kernel source to allow for static linking of
the driver. For questions related to hardware requirements, refer to the
documentation supplied with your Atheros(R) adapter. All hardware
requirements listed apply to use with Linux.
Building and Installation
=========================
To build a binary RPM* package of this driver, run 'rpmbuild -tb
<filename.tar.gz>'. Replace <filename.tar.gz> with the specific filename of
the driver.
NOTE: For the build to work properly, the currently running kernel MUST match
the version and configuration of the installed kernel sources. If you
have just recompiled the kernel reboot the system now.
RPM functionality has only been tested in Red Hat distributions.
1. Move the base driver tar file to the directory of your choice. For example,
use /home/username/arl1e or /usr/local/src/arl1e.
2. Untar/unzip archive:
tar zxf arl1e-x.x.x.x.tar.gz
3. Change to the driver src directory:
cd arl1e-x.x.x.x/src/
4. Compile the driver mole:
make install
The binary will be installed as:
/lib/moles/<KERNEL VERSION>/kernel/drivers/net/arl1e.[k]o
The install locations listed above are the default locations. They might
not be correct for certain Linux distributions. For more information,
see the ldistrib.txt file included in the driver tar.
5. Install the mole:
insmod arl1e <parameter>=<value>
6. Assign an IP address to the interface by entering the following, where
x is the interface number:
ifconfig ethx <IP_address>
7. Verify that the interface works. Enter the following, where <IP_address>
is the IP address for another machine on the same subnet as the interface
that is being tested:
ping <IP_address>
Command Line Parameters
=======================
If the driver is built as a mole, the following optional parameters are
used by entering them on the command line with the modprobe or insmod command
using this syntax:
modprobe arl1e [<option>=<VAL1>,<VAL2>,...]
insmod arl1e [<option>=<VAL1>,<VAL2>,...]
For example, with two L001 PCIE adapters, entering:
insmod arl1e TxMemSize=80,128
loads the arl1e driver with 8KB TX memory for the first adapter and 10KB TX memory
for the second adapter.
The default value for each parameter is generally the recommended setting,
unless otherwise noted.
NOTES: A descriptor describes a data buffer and attributes related to the
data buffer. This information is accessed by the hardware.
media_type
Valid Range: 0-4
0 - auto-negotiate at all supported speeds
1 - only link at 1000Mbps Full Duplex
2 - only link at 100Mbps Full Duplex
3 - only link at 100Mbps Half Duplex
4 - only link at 10Mbps Full Duplex
5 - only link at 10Mbps Half Duplex
Default Value: 0
media_type forces the line speed/plex to the specified value in
megabits per second(Mbps). If this parameter is not specified or is set
to 0 and the link partner is set to auto-negotiate, the board will
auto-detect the correct speed.
int_mod_timer
Valid Range: 50-65000
Default Value: 100
This value represents the minmum interval between interrupts controller
generated.
RxMemBlock
Valid Range: 16-512
Default Value: 64
This value is the number of receice memory block allocated by the driver.
Increasing this value allows the driver to buffer more incoming packets.
Each memory block is 1536 bytes.
NOTE: Depending on the available system resources, the request for a
higher number of receive descriptors may be denied. In this case,
use a lower number.
TxMemSize
Valid Range: 4-64
Default Value: 8
This value is the number KB of transmit memory allocated by the driver.
Increasing this value allows the driver to queue more transmits.
NOTE: Depending on the available system resources, the request for a
higher number of transmit descriptors may be denied. In this case,
use a lower number.
FlashVendor
Valid Range: 0-2
Default Value: 0
This value standards on vendor of spi flash used by the adapter.
0 for Atmel, 1 for SST, 2 for ST
Additional Configurations
=========================
Configuring the Driver on Different Distributions
-------------------------------------------------
Configuring a network driver to load properly when the system is started is
distribution dependent. Typically, the configuration process involves adding
an alias line to /etc/moles.conf as well as editing other system startup
scripts and/or configuration files. Many popular Linux distributions ship
with tools to make these changes for you. To learn the proper way to
configure a network device for your system, refer to your distribution
documentation. If ring this process you are asked for the driver or mole
name, the name for the Linux Base Driver for the Atheros AR8121/AR8113 is arl1e
As an example, if you install the arl1e driver for two AR8121/AR8113 adapters
(eth0 and eth1) and set the speed and plex to 10full and 100half, add the
following to moles.conf:
alias eth0 arl1e
alias eth1 arl1e
options arl1e Speed=10,100 Duplex=2,1
Viewing Link Messages
---------------------
Link messages will not be displayed to the console if the distribution is
restricting system messages. In order to see network driver link messages
on your console, set dmesg to eight by entering the following:
dmesg -n 8
NOTE: This setting is not saved across reboots.
Known Issues
============
NOTE: For distribution-specific information, see the ldistrib.txt file
included in the driver tar.
Driver Compilation
------------------
When trying to compile the driver by running make install, the following
error may occur:
"Linux kernel source not configured - missing version.h"
To solve this issue, create the version.h file by going to the Linux source
tree and entering:
make include/linux/version.h.
Support
=======
For general information, go to the Atheros support website at:
http://support.atheros.com
If an issue is identified with the released source code on the supported
kernel with a supported adapter, email the specific information related to
the issue to [email protected]
License
=======
This software program is released under the terms of a license agreement
between you ('Licensee') and Atheros. Do not use or load this software or any
associated materials (collectively, the 'Software') until you have carefully
read the full terms and conditions of the LICENSE located in this software
package. By loading or using the Software, you agree to the terms of this
Agreement. If you do not agree with the terms of this Agreement, do not
install or use the Software.
* Other names and brands may be claimed as the property of others.
5. linux下pcie驱动开发,该看些什么资料
linux下pcie驱动开发大概可以分为4个阶段,水平从低到高:
从安装使用=>linux常用命令=>linux系统编程内=>内核开发阅读内容核源码
系统编程推荐《高级unix环境编程》;
还有《unix网络编程》;
内核开发阅读内核源码阶段,从写驱动入手逐渐深入linux内核开发
参考书如下:
1.《linux device drivers》
2.《linux kernel development》
3.《understading the linux kernel》
4.《linux源码情景分析》
然后还需要看资料理解elf文件格式,连接器和加载器,cmu的一本教材中文名为《深入理解计算机系统》比较好。
6. 求大神,PCIE通道 M.2接口的硬盘能装装linux吗
主板上的M..2 接口也有两种规格:一种为SATA总线,另一种为PCIEx2/x4 总线。安装设置方法如下:
1、首先要确认主板的M.2接口技术规格。可通过主板接口边上标识字符简单判断,如下示例,凡标有“32Gb/s”字样,即为PCIE x4 规格。若主板没有相应标识,可查看主板说明书得知;
2、而SSD卡盘一般在购买的时候,即可知道其技术规格。若为NVMe标准规格,必定是PCIE x4总线产品; 若为SATA总线规格的SSD卡盘(早期上市的产品),PCIE x4 总线接口是不能支持使用的;
3、当SSD卡盘与接口插槽为同一技术规格,卡盘插入卡槽后,锁固螺丝,即完成物理安装;
4、NVMe标准的卡盘,新主板(Intel 100/200系主板)还需要在主板BIOS中,设置“使用(Enabled)”该SSD卡盘,即使用PCIE总线工作 。有些主板BIOS中没有这一选项,设置为AHCI模式即可,NVMe控制器会在操作系统设备管理中出现;
5、注意事项:
①安装操作系统时,需要先安装该卡盘的NVMe驱动程序后,才能在SSD卡盘安装系统;
② 市场上多数非零售版(OEM版本)NVMe 规格卡盘,没有附带驱动程序,需要去其官网,查询是否有相应操作系统版本的驱动程序下载;
③如果厂商不提供该型号卡盘驱动程序,只能安装内箝NVMe驱动程序的Win10操作系统。