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操作系統。