Booting from NVMe USB enclosure
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#1 by rych » 22 Apr 2023, 13:44
* Realtek RTL9210B or RTL9210
* JMicron JMS583 A3
* Asmedia ASM2362 or even Asmedia ASM2364 (20Gbps)
Does anyone have any experience with those? Which chipset would be better?
The enclosure will be carrying a Samsung 980 Samsung 970 EVO Plus 1TB M.2 PCIe 3.0 NVMe Internal SSD. It's on sale but still not cheap. So need some advice first. I hope this works and I get as much speed out of my USB 3.1 as possible.
The motherboard/BIOS clearly support booting the Windows off the internal system disk which is also an NVMe PCIe disk. So I guess it's a matter of grub2 or a porteus native boot loader seeing and capable of booting off a similar disk through the USB interface?
rych
Ed_P
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#3 by rych » 23 Apr 2023, 01:07
Yes, I use grub2 instead of the native porteus boot loader. The question is which chip will work guaranteed?
(I'm leaning toward Realtek RTL9210B. The newer Asmedia ASM2364 will support up to 20Gbps though. Not that I have such USB ports yet. Besides, all that speed doesn't matter, if it won't boot reliably for example)
rych
- Ed_P
- Contributor
- Posts: 8960
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Booting from NVMe USB enclosure
Post#4 by Ed_P » 23 Apr 2023, 04:12
If you partition the drive to have a FAT32 partition you have the option for UEFI booting otherwise you're limited to BIOS booting. These are the two grub2 menus I use for booting my USB drives, which are all less then 32GB and formated as FAT32.
Code: Select all
menuentry " Porteus 5.0 USB - EFI" --class slackware --class icon-porteus {
set bootmgr=/EFI/boot/bootx64.efi #grubx64.efi # bootx64.efi
set bootdrv=$root
search -f $bootmgr --set=root
echo bootmgr: $bootmgr
sleep -v -i 3
if [ $root != $bootdrv ]; then
chainloader $bootmgr
else
echo "----------------------------------------"
echo USB drive NOT found.
echo
sleep -v -i 10
fi
set root=$bootdrv
}
menuentry " Porteus 5.0 USB - AF'" --class slackware --class icon-porteus {
set porteus_parms="volume=33 reboot=cold extramod=/Modules" #;cinnamon" # changes=EXIT:/changes/porteussave.dat"
set bootdrv=$root
search -f /boot/syslinux/vmlinuz --set=root
if [ $root != $bootdrv ]; then
linux /boot/syslinux/vmlinuz $porteus_parms
initrd /boot/syslinux/initrd.xz
else
echo "----------------------------------------"
echo USB drive NOT found.
echo
sleep -v -i 10
fi
set root=$bootdrv
}
Ed_P
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#5 by rych » 24 Apr 2023, 09:03
Code: Select all
lsusb -t | egrep -i "storage" -B1
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 10000M
|__ Port 1: Dev 2, If 0, Class=, Driver=usb-storage, 5000M
rych
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#6 by rych » 09 Jun 2023, 06:00
Code: Select all
root@porteus:~# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 10000M
|__ Port 1: Dev 2, If 0, Class=, Driver=usb-storage, 5000M
|__ Port 2: Dev 8, If 0, Class=, Driver=uas, 10000M
Next I'm going to test some actual speeds of the USB 3, the new USB-C, and the system SSD.
rych
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#7 by rych » 09 Jun 2023, 10:36
1. Samsung 970 EVO Plus 1TB M.2 PCIe 3.0 NVMe (rated 3,500MB/s) in Realtek RTL9210B USB 3.1 enclosure (10Gbs)
2. SanDisk Extreme Pro (5Gbs, upto 420MB/s)
3. System's SSD, NVMe SK hynix (upto 2200 MB/s)
Code: Select all
root@porteus:~# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 2502 MB in 3.00 seconds = 833.99 MB/sec
root@porteus:~# hdparm -t /dev/sdb
/dev/sdb:
Timing buffered disk reads: 1136 MB in 3.00 seconds = 378.36 MB/sec
root@porteus:~# hdparm -t /dev/nvme0n1p3
/dev/nvme0n1p3:
Timing buffered disk reads: 1798 MB in 3.00 seconds = 598.74 MB/sec
rych
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#8 by rych » 09 Jun 2023, 11:17
Code: Select all
root@porteus:~# hdparm -t --direct /dev/sda
/dev/sda:
Timing O_DIRECT disk reads: 2214 MB in 3.00 seconds = 737.83 MB/sec
root@porteus:~# hdparm -t --direct /dev/sdb
/dev/sdb:
Timing O_DIRECT disk reads: 1038 MB in 3.00 seconds = 345.96 MB/sec
root@porteus:~# hdparm -t --direct /dev/nvme0n1p3
/dev/nvme0n1p3:
Timing O_DIRECT disk reads: 1916 MB in 3.00 seconds = 638.55 MB/sec
rych
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#9 by rych » 19 Jun 2023, 10:13
Code: Select all
root@porteus:~# smartctl -x -d sntrealtek /dev/disk/by-label/PorteuX | grep Temp*
Warning Comp. Temp. Threshold: 85 Celsius
Critical Comp. Temp. Threshold: 85 Celsius
Temperature: 30 Celsius
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0
Temperature Sensor 1: 30 Celsius
Temperature Sensor 2: 33 Celsius
rych
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#10 by rych » 21 Aug 2023, 10:51
rych
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#11 by rych » 22 Sep 2023, 10:18
rych
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#12 by rych » 23 Oct 2023, 08:50
Code: Select all
dd if=/dev/zero of=/tmp/tempfile bs=1M count=1024 conv=fdatasync
sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches"
dd if=/tmp/tempfile of=/dev/null bs=1M count=1024
rych
-
- Shogun
- Posts: 248
- Joined: 12 Jun 2021, 21:59
- Distribution: Xfce 4.12 - 5.rc3 - x86_64
- Location: France
Booting from NVMe USB enclosure
Post#13 by Rapha_ » 23 Oct 2023, 15:09
Very interesting !rych wrote: ↑23 Oct 2023, 08:50Other ways to test read-write speeds: https://www.baeldung.com/linux/disk-performance-testCode: Select all
dd if=/dev/zero of=/tmp/tempfile bs=1M count=1024 conv=fdatasync sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches" dd if=/tmp/tempfile of=/dev/null bs=1M count=1024

Rapha_
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#14 by rych » 24 Oct 2023, 09:26
Here are my tests on this machine. Both the host system disk and the USB enclosed disk are NVMe SSD. The partitions are:
sda3: ext4 on USB
sda4: NTFS on USB
nvme0n1p3: NTFS host system
The NTFS driver is the FUSE ntfs-3g, hence perhaps slower than expected speeds. Unless that's the limitation of my system disk, see the bottom of this post. Anyways, will be interesting to compare when I learn how to remount my NTFS partitions with the kernel driver ntfs3.
Writing:
Code: Select all
dd if=/dev/zero of=/tmp/tempfile bs=1M count=1024 conv=fdatasync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.299371 s, 3.6 GB/s
dd if=/dev/zero of=/mnt/sda3/tempfile bs=1M count=1024 conv=fdatasync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.87841 s, 572 MB/s
dd if=/dev/zero of=/mnt/sda4/tempfile bs=1M count=1024 conv=fdatasync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.21219 s, 485 MB/s
dd if=/dev/zero of=/mnt/nvme0n1p3/tempfile bs=1M count=1024 conv=fdatasync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.51177 s, 427 MB/s
Code: Select all
sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches"
dd if=/tmp/tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.126275 s, 8.5 GB/s
dd if=/mnt/sda3/tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.35096 s, 795 MB/s
dd if=/mnt/sda4/tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 4.7413 s, 226 MB/s
dd if=/mnt/nvme0n1p3/tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.11127 s, 966 MB/s
Code: Select all
hdparm -t --direct /dev/sda
/dev/sda:
Timing O_DIRECT disk reads: 2182 MB in 3.00 seconds = 726.90 MB/sec
hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 2300 MB in 3.05 seconds = 755.00 MB/sec
hdparm -t --direct /dev/nvme0n1
/dev/nvme0n1:
Timing O_DIRECT disk reads: 1998 MB in 3.00 seconds = 665.79 MB/sec
hdparm -t /dev/nvme0n1
/dev/nvme0n1:
Timing buffered disk reads: 1856 MB in 3.00 seconds = 618.38 MB/sec
Sequential Read 1,382 MBytes/Sec
Sequential Write 579 MBytes/Sec
rych
-
- Warlord
- Posts: 787
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Booting from NVMe USB enclosure
Post#15 by rych » 25 Oct 2023, 09:33
We'll pipeline the output to the last line only (or, `2> >(grep copied)`)
Writing:
Code: Select all
dd if=/dev/zero of=/tmp/tempfile bs=1M count=1024 conv=fdatasync |& tail -1
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.33387 s, 3.2 GB/s
dd if=/dev/zero of=/mnt/sda3/tempfile bs=1M count=1024 conv=fdatasync |& tail -1
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 15.8858 s, 67.6 MB/s
dd if=/dev/zero of=/mnt/sdb3/tempfile bs=1M count=1024 conv=fdatasync |& tail -1
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.49062 s, 431 MB/s
dd if=/dev/zero of=/mnt/sdb4/tempfile bs=1M count=1024 conv=fdatasync |& tail -1
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.60756 s, 412 MB/s
Code: Select all
sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches"
Code: Select all
dd if=/tmp/tempfile of=/dev/null bs=1M count=1024 |& tail -1
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.169581 s, 6.3 GB/s
dd if=/mnt/sda3/tempfile of=/dev/null bs=1M count=1024 |& tail -1
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.09434 s, 513 MB/s
dd if=/mnt/sdb3/tempfile of=/dev/null bs=1M count=1024 |& tail -1
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.40742 s, 446 MB/s
dd if=/mnt/sdb4/tempfile of=/dev/null bs=1M count=1024 |& tail -1
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 8.42216 s, 127 MB/s
Code: Select all
hdparm -t /dev/sda3
/dev/sda3:
Timing buffered disk reads: 1352 MB in 3.00 seconds = 450.25 MB/sec
hdparm -t /dev/sdb3
/dev/sdb3:
Timing buffered disk reads: 1196 MB in 3.00 seconds = 398.64 MB/sec
1. writing on the system SSD NTFS is much slower than expected
2. reading from an NTFS partition on the USB is much slower than reading from the adjacent ext4 partition
(By the way, dd has `oflag=direct` and `iflag=direct` options to bypass caching?)
rych