How do I mount an SSD?

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu

Which version of system do you use? Khadas official images, self built images, or others?

Khadas image

Please describe your issue below:

Hello all, I added an NVMe to my VIM4. I got the Khadas extender for SSD. I powered up the VIM4 no issues whatsoever. I looked into the /mnt/ and /media/ folders but they are both clean.

How do I mount the NVMe?

Thanks for your help.

Is it a brand-new SSD (unformatted)? If so, you’ll need to partition it first using the linux fdisk command (or others), and then format the partition using ext4… I just went through this yesterday with an SSD that arrived in the mail. Also, what is the brand/model of SSD you’re using? There are issues at this time with many/most SSD’s which are outlined in another thread. I bought a Kingston A2000 SSD and so far so good. It’s I believe the only one that others reported as working ok. I’ve got a Crucial P5 that is not working and I’ve set it aside for the time being.

would you be able to tell me how to do this step by step? I am a noob and learning to do this over SSH. I can’t use the Ubuntu GUI because the VIM4 is a headless media server that I am trying to build for my home.

Hello @gilmotta

It may a known issue of PCIe NVme SSD, please keep eyes on this topic.

You’re going to need some things to be installed more than likely… I’ll give you the cliff-notes version:

  • Install nvme-cli if you haven’t already. (sudo apt-get install nvme-cli)
  • Find the name of the SSD device in your case — “sudo nvme list”. It’s probably named /dev/nvme0n1.
  • use the Linux “fdisk” command (or equivalent) to partition the drive. I’ll let you google that — there are TONS of webpages describing its use. Basically you want to create a partition (or more?) — I create an extra swap partition here in addition to my “data” drive taking up most of my 500Gb SSD. My partition looks like the snippet further down.
  • Once you partition the drive and write the partition table using the “w” command within fdisk, it’s probably a good idea to reboot to let the Kernel be sure it’s all good with the new table — might be optional but I did it.
  • Time to format the drive as ext4 — using the partition name for the drive (e.g. in my case it’s named “/dev/nvme0n1p1”. You can google how to format an ext4 file system. It’s pretty easy and takes only a moment.
  • Update your /etc/fstab to have the new mount points. Mine is shown below as a reference — yours will probably be similar.

You should reboot after doing all this to make sure everything gets mounted properly on boot.

One huge caveat at this point — which is what the post above speaks of. Many many SSD’s right now do not behave well with the VIM4. It’s believed there’s some bug(s) in the kernel code that is keeping most SSDs from working properly without I/O errors. There’s a separate thread here discussing that. As far as we know only the Kingston A2000 appears to work without issue for whatever reason.

Below is what my partition table looks like as dumped by “sudo fdisk -l”:

Device         Boot     Start        End   Sectors  Size Id Type
/dev/nvme0n1p1           2048  950000000 949997953  453G 83 Linux
/dev/nvme0n1p2      950001664 1000215215  50213552 23.9G 82 Linux swap / Solaris

Below is my /etc/fstab at this point — working without issue from my limited testing since I did this yesterday — I only added the last two lines. If you aren’t adding any swap space you can omit the swap line below and obviously the partition above too:

$ more /etc/fstab
# <file system>                              <mount point>   <type>  <options>                                                           
  <dump>  <pass>
tmpfs                                          /tmp            tmpfs   defaults,nosuid                                                   
       0   0
UUID=7664d268-7efa-49fe-8961-efd1a4e36ffe      /               ext4    defaults,noatime,nodiratime,commit=600,errors=remount-ro,x-gvfs-hi
de     0   1
UUID=d6e475fd-f7be-4110-b1bf-aea24f8f3f24      /boot           ext4    defaults,noatime,nodiratime,commit=600,errors=remount-ro,x-gvfs-hi
de     0   1
/dev/nvme0n1p2                                 swap            swap    defaults                                                          
       0   0
/dev/nvme0n1p1                                 /media/data     ext4    defaults,errors=remount-ro                                        
       0   0 

I hope this helps … please keep an eye out for the other thread regarding NVME I/O errors.

4 Likes

This is the other thread being referred to: https://forum.khadas.com/t/khadas-wip-vim4-nvme-io-errors/16572

If you followed the information that @ps23Rick provided and are having problems, you may want to have a look at that.

Привет! Поставил SSD xpg sx8200 pro Khadas vim 4 не включается вообще!
Без диска включается и работает исправно, когда соединяю диск, khadas отключается.
Посоветуйте пожалуйста

What is the wattage of the power supply you have?

12 вольт 3 ампер у меня лабораторный блок питания

I presume the drive works in other devices?

У меня нет других устройств где я мог бы проверить этот диск


Мой диск не поддерживает khadas vim 4
Я подключил на прямую без платы расширения компьютер запустился но не стал работать с моим диском.

Интересно, какие диски поддерживает khadas vim 3?

Hello All,

A year later, I am trying to make my NVME work. I followed the instructions above but I got errors when I was trying to format the NVME.

Did Khadas update the NVME driver? Is there new procedures to make the NVME work on a VIM4?

Here is what’s happening!

khadas@flight:~$ sudo mkfs.ext4 /dev/nvme0n1p1
mke2fs 1.46.5 (30-Dec-2021)
Discarding device blocks: done
Creating filesystem with 61049385 4k blocks and 15269888 inodes
Filesystem UUID: 6e630db1-269c-4924-aaef-25340aeafc36
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: mkfs.ext4: Input/output error while writing out and closing file system
khadas@flight:~$

Please let me know!
Thanks.

@Electr1 do you think that you can help with the NVME issue?

I have a brand new NVME from Samsung but the VIM4 does not seem to like it. I followed the instructions above but no luck!

khadas@flight:~$ sudo smartctl -a /dev/nvme0n1
[sudo] password for khadas:
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-5.4.125] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       Samsung SSD 980 250GB
Serial Number:                      S64CNJ0R304691T
Firmware Version:                   1B4QFXO7
PCI Vendor/Subsystem ID:            0x144d
IEEE OUI Identifier:                0x002538
Total NVM Capacity:                 250,059,350,016 [250 GB]
Unallocated NVM Capacity:           0
Controller ID:                      5
NVMe Version:                       1.4
Number of Namespaces:               1
Namespace 1 Size/Capacity:          250,059,350,016 [250 GB]
Namespace 1 Utilization:            40,960 [40.9 KB]
Namespace 1 Formatted LBA Size:     512
Namespace 1 IEEE EUI-64:            002538 d311406239
Local Time is:                      Mon Oct 16 14:47:50 2023 CST
Firmware Updates (0x16):            3 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x0055):     Comp DS_Mngmt Sav/Sel_Feat Timestmp
Log Page Attributes (0x0f):         S/H_per_NS Cmd_Eff_Lg Ext_Get_Lg Telmtry_Lg
Maximum Data Transfer Size:         512 Pages
Warning  Comp. Temp. Threshold:     82 Celsius
Critical Comp. Temp. Threshold:     85 Celsius
Namespace 1 Features (0x10):        NP_Fields

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     5.24W       -        -    0  0  0  0        0       0
 1 +     4.49W       -        -    1  1  1  1        0       0
 2 +     2.19W       -        -    2  2  2  2        0     500
 3 -   0.0500W       -        -    3  3  3  3      210    1200
 4 -   0.0050W       -        -    4  4  4  4     1000    9000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        51 Celsius
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    28%
Data Units Read:                    114,362,876 [58.5 TB]
Data Units Written:                 214,789,960 [109 TB]
Host Read Commands:                 112,799,913
Host Write Commands:                243,166,318
Controller Busy Time:               7,246
Power Cycles:                       54
Power On Hours:                     146
Unsafe Shutdowns:                   44
Media and Data Integrity Errors:    0
Error Information Log Entries:      0
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0
Temperature Sensor 1:               51 Celsius
Temperature Sensor 2:               52 Celsius
Thermal Temp. 2 Transition Count:   1

Error Information (NVMe Log 0x01, 16 of 64 entries)
No Errors Logged

khadas@flight:~$

I have a Western Digital SSD (SN570) and I’m able to format it without issues.

Do you have any success when using gparted to format the disk, I’m able to use it and it works.

Data Units Read:                    114,362,876 [58.5 TB]
Data Units Written:                 214,789,960 [109 TB]

It seems like your device has been in usage for quite a while, are you sure its new ?

Let me try the other one, I probably mixed them up. I will let you know and send an update to you.