This page looks best with JavaScript enabled

Installing and Initializing a PCI SSD

 ·  ☕ 2 min read

1. Check the PCI Interface Device

Use lspci to check whether the device is already installed.

1
2
3
lspci |grep storage

d8:00.0 Mass storage controller: Shannon Systems Device 2275

Here a Shannon Systems device shows up, which means the SSD is already installed.

1
2
3
4
5
6
7
8
lsblk

NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                         8:0    0 893.8G  0 disk
├─sda1                      8:1    0     1M  0 part
├─sda2                      8:2    0     1G  0 part /boot
└─sda3                      8:3    0 892.8G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0 892.8G  0 lvm  /

But the corresponding device does not appear in lsblk, which means the driver is not installed or was installed incorrectly.

2. Check Whether the Driver Is Already Installed

This step is critical. If a driver with the wrong version or a mismatched kernel version is installed, the corresponding device may likewise be invisible in lsblk. If two versions of the driver are installed, the system may fail to boot normally and keep rebooting.

  • Check whether the SSD driver is already installed
1
2
3
dpkg -l | grep shannon

ii  shannon-module-5.4.0-164-generic      3.4.3.1                           amd64        Driver for PCIe SSD of Shannon Systems

3. Uninstall the SSD Driver

Note that if lsblk can already see the device, the driver is correctly installed and is very likely already in use; uninstalling the driver at this point will cause a system failure.

  • Uninstall the driver
1
dpkg -r shannon-module-5.4.0-164-generic

4. Install the Driver

  • Prepare the driver source package
1
2
3
ls -alh Shannon_Linux_Driver_Package_3.4.3.1.tar.gz

-rw-r--r-- 1 root root 11M Nov  8 07:57 Shannon_Linux_Driver_Package_3.4.3.1.tar.gz
  • Extract the driver source package
1
2
tar xvf Shannon_Linux_Driver_Package_3.4.3.1.tar.gz
cd Shannon_Linux_Driver_Package_3.4.3.1
1
2
tar xvf shannon-source_3.4.3.1.tar.gz
cd shannon-source_3.4.3.1
  • Install the build environment
1
apt-get install -y make gcc debhelper linux-headers-$(uname -r) libtinfo5 libncurses5
  • Install the dpkg-dev tool
1
apt-get install -y dpkg-dev
  • Compile and generate the DEB package
1
dpkg-buildpackage -us -uc

This produces the DEB package.

1
dpkg-deb: building package 'shannon-module-5.4.0-164-generic' in '../shannon-module-5.4.0-164-generic_3.4.3.1_amd64.deb'.
  • Install the driver
1
dpkg -i ../shannon-module-5.4.0-164-generic_3.4.3.1_amd64.deb
  • Check the SSD block device
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
lsblk

NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                         8:0    0 893.8G  0 disk
├─sda1                      8:1    0     1M  0 part
├─sda2                      8:2    0     1G  0 part /boot
└─sda3                      8:3    0 892.8G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0 892.8G  0 lvm  /
dfa                       252:0    0   2.2T  0 disk
└─dfa1                    252:1    0     2T  0 part

5. Format and Mount to a Directory

  • Partition the disk

Use fdisk to partition dfa.

1
fdisk /dev/dfa

It will prompt for input parameters:

command (m for help):n
Select (default p): p
Partition number(1-4):1
First cylinder (1-22800,default 1):Enter
command (m for help):w

  • Format the partition
1
mkfs.ext4 /dev/dfa
  • Create the mount point directory
1
mkdir /data
  • Mount the disk to the directory
1
mount -t ext4 /dev/dfa /data
  • Set up automatic mounting

Add an entry to /etc/fstab to mount automatically at boot:

1
/dev/dfa  /data  ext4  defaults  0  0

6. Verify the Disk Mounts Correctly

  • Verify automatic mounting at boot

Remount the partitions; if there are no errors, the configuration is correct.

1
mount -a
  • Verify the disk is mounted correctly
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
lsblk

NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                         8:0    0 893.8G  0 disk
├─sda1                      8:1    0     1M  0 part
├─sda2                      8:2    0     1G  0 part /boot
└─sda3                      8:3    0 892.8G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0 892.8G  0 lvm  /
dfa                       252:0    0   2.2T  0 disk /data
└─dfa1                    252:1    0     2T  0 part

7. Disk Testing

  • Install opscli
1
2
proxy=""
curl -sfL "$proxy"https://raw.githubusercontent.com/shaowenchen/ops/main/getcli.sh |VERSION=latest sh -
  • Install fio
1
apt-get install -y fio
  • Start the benchmark
1
2
3
4
5
6
7
8
opscli task -f .ops/tasks/get-diskio-byfio.yaml

Rand_Read_Testing: (groupid=0, jobs=1): err= 0: pid=21980: Thu Nov  9 07:05:26 2023
  read: IOPS=113k, BW=441MiB/s (462MB/s)(100MiB/227msec)


Rand_Write_Testing: (groupid=0, jobs=1): err= 0: pid=22027: Thu Nov  9 07:05:27 2023
  write: IOPS=103k, BW=403MiB/s (423MB/s)(100MiB/248msec); 0 zone resets

8. Shannon Systems Driver Download

https://github.com/shaowenchen/demo/tree/master/driver

There are mainly three related files:

  • driver/Shannon_Linux_Driver_Package_3.4.3.1.tar.gz , the driver source package
  • driver/shannon-utils_3.4.3.2_amd64.deb, the driver utility package
  • driver/UG201Direct-IO_PCIe_SSD用户手册_user_manual_rv2.6.docx, the user manual

微信公众号
WRITTEN BY
微信公众号