Increase Performance or Add Redundancy?
Introduction
Now that you've enhanced your eisy with added storage and a virtual machine (VM), you may wonder how to further boost its performance and reliability. Well, wonder no more! In this blog, we'll guide you through the process of configuring your eisy to boot from an NVMe SSD, with the option to use the onboard eMMC drive as a mirror for redundancy. Are you ready? Let's go ...
Increased performance?
Yes, by having the OS run from a high performance SSD, you can expect increased throughputs especially for random read/write operations. The following is statistics from running eisy from the onboard eMMC drive:
Transfer rates:
outside: 102400 kbytes in 0.695155 sec = 147305 kbytes/sec
middle: 102400 kbytes in 0.662695 sec = 154521 kbytes/sec
inside: 102400 kbytes in 0.645822 sec = 158558 kbytes/sec
Asynchronous random reads:
sectorsize: 18050 ops in 3.021072 sec = 5975 IOPS
4 kbytes: 13222 ops in 3.029609 sec = 4364 IOPS
32 kbytes: 6519 ops in 3.063780 sec = 2128 IOPS
128 kbytes: 2584 ops in 3.154414 sec = 819 IOPS
1024 kbytes: 487 ops in 4.041280 sec = 121 IOPS
Now, take a look at the same when eisy is run from a 1T PCIe 4, NVMe SSD:
Transfer rates:
outside: 102400 kbytes in 0.074777 sec = 1369405 kbytes/sec
middle: 102400 kbytes in 0.069383 sec = 1475866 kbytes/sec
inside: 102400 kbytes in 0.069882 sec = 1465327 kbytes/sec
Asynchronous random reads:
sectorsize: 1384389 ops in 3.000543 sec = 461379 IOPS
4 kbytes: 1236376 ops in 3.000293 sec = 412085 IOPS
32 kbytes: 160586 ops in 3.002363 sec = 53487 IOPS
128 kbytes: 39947 ops in 3.009799 sec = 13272 IOPS
1024 kbytes: 5128 ops in 3.076463 sec = 1667 IOPS
As you can see, transfer rates (read/write operations) on the NVMe SSD are about 10 times more than those on the eMMC. Furthermore, random reads operations/second are significantly higher on the NVMe as opposed to the eMMC.
In essence, if you have many chatty plugins, you will definitely see notice immeidate performance improvements.
Assembly
If you already have an NVMe SSD installed, you may skip this section.
Get an NVMe M.2 SSD
You can get pretty much any M.2 NVMe SSD with the limitation that the capacity cannot be more than 1TB. For our test purposes, we chose Western Digital Blue SN580. Of course, their WD_BLACK SN850X will have better performance.
Install the SSD

- Press and hold the power button so that the light turns red
- Unplug the power cord
- Open the 4 screws at the bottom and gently remove the bottom cover
- Remove the screw that holds the SSD in place (top right on a stand)
- Plugin the SSD and screw in the screw in 4
- Gently put the bottom cover back ensuring that the label points to the back (where the connectors are)
- Screw in the 4 screws you took out in 3
- Plugin the power cord
That's it!
Configure the OS
It is much easier to use our latest tools/and instructions outlined here. But, if you insist on doing things yourself, please go ahead!
Warning
The procedures below will wipe out everything you might already have on your NVMe!
Tip
The procedures outlined below will be included as a command in
the upcoming udx release of 3.5.5_4:
sudo fl.ops setup.nvme.boot
Tip
Although these procedures were designed to be lossless, it's
always recommended to backup your ZMatter USB, your IoX,
and your PG3x.
ssh to eisy
- On Mac, open the terminal app (search | terminal)
- On Windows, open the command prompt (search | cmd)
- Type:
ssh admin@eisy.local
- When prompted, type in the password. Default is admin. If you have not already changed the password, change it immediately.
All sudo may prompt you for the password. Please use the password in step 4.
Create a script
Open a file and call it setup_nvme_boot.sh. Then, copy/paste the following, save, and exit
#!/bin/sh
remove_emmc_mirror()
{
echo "You have chosen to remove the eMMC mirror ..."
echo "Are you sure? (Y/n)"
read answer
if [ "$answer" != "Y" ]
then
echo "didn't accept final warning to remove emmc ..."
return
fi
cd /
echo "accepted final warning to remove emmc ..."
echo "removing freebsd-boot from the mirror ..."
gpart delete -i 1 mmcsd0
echo "removing efi from the mirror ..."
gpart delete -i 2 mmcsd0
echo "removing freebsd-zfs from the mirror ..."
zpool detach zudi mmcsd0p3
gpart delete -i 3 mmcsd0
echo "removing swap from the mirror ..."
swapoff /dev/gpt/swap0
gpart delete -i 4 mmcsd0
echo "destroying mmcsd0 ..."
gpart destroy -F mmcsd0
echo "completed removing the mirror ... "
echo "Do you want to reboot (you don't have to)? Y/n"
read answer
if [ "$answer" = "Y" ]
then
reboot
fi
}
setup_nvme_boot()
{
nvmecontrol devlist
if [ $? -ne 0 ]
then
echo "error: no nvme devices found ..."
return
fi
# prepare new NVMe, assuming no VMs here yet and it’s virgin.
nvme_p=$(gpart show | grep nvd0)
if [ "$nvme_p" != "" ]
then
echo "WARNING: removing all remnants ... "
zpool detach zudi nvd0p2
gpart destroy -F nvd0
if [ $? -ne 0 ]
then
echo "error: failed removing old nvd0 partition ..."
return
fi
fi
#create the gpt partition
echo "adding GTP partition to nvd0 ..."
gpart create -s GPT nvd0
if [ $? -ne 0 ]
then
echo "error: failed creating gpt partition ..."
return
fi
echo "adding the boot partition to nvd0 ..."
gpart add -s 64M -t efi -l efi nvd0
if [ $? -ne 0 ]
then
echo "error: failed creating boot partition ..."
return
fi
echo "calcuating size ... keeping 13GB free"
MAIN_SIZE=`gpart show nvd0 | grep GPT | awk '{printf ("%.0f\n", ($3-42)/(2*1024*1024)-13)}'`
echo "size, excluding swap is $MAIN_SIZE GB ..."
echo "adding the os/zfs partition using the whole disk ... "
gpart add -s ${MAIN_SIZE}G -t freebsd-zfs nvd0
if [ $? -ne 0 ]
then
echo "error: failed creating gpt partition ..."
return
fi
# make new EFI on that drive
echo "creating ms dos file system on partition 1 ..."
newfs_msdos -F 32 -c 1 /dev/nvd0p1
if [ $? -ne 0 ]
then
echo "error: failed ms dos file system ..."
return
fi
echo "mouting ms dos file system (for boot) ... "
mkdir -p /boot/efi
mount -t msdos /dev/gpt/efi /boot/efi
if [ $? -ne 0 ]
then
echo "error: failed mounting ms dos file system ..."
return
fi
echo "adding boot loader to boot partition ... "
mkdir -p /boot/efi/EFI/BOOT
cp /boot/loader_lua.efi /boot/efi/EFI/BOOT/BOOTx64.efi
if [ $? -ne 0 ]
then
echo "error: failed copying boot files ..."
return
fi
echo "unmounting boot parition ..."
umount /boot/efi
# attach new drive to existing pool
echo "attching ssd to existing zudi pool for copying files from emmc to ssd ..."
zpool attach -f zudi /dev/mmcsd0p3 /dev/nvd0p2
if [ $? -ne 0 ]
then
echo "error: failed attaching ssd to zpool ..."
return
fi
echo "adding the swap partition ..."
gpart add -t freebsd-swap -l swap0 -s 4G nvd0
if [ $? -ne 0 ]
then
echo "error: failed adding swap partition ..."
return
fi
echo "please continue to wait while creating a copy from emmc to ssd (resilver) ..."
while true;
do
echo -n "."
sleep 5
resilvering=$(zpool status | grep nvd0p2 | grep resilvering)
if [ -z "$resilvering" ]
then
break
fi
done
echo "Do you want to keep the mirror?"
echo "Pros:"
echo "- You will have a mirror of everything"
echo "- You can boot from either once (needs monitor)"
echo "Cons:"
echo "- Regardless of your NVME capacity, you are limited to the size of eMMC"
echo "- The slowest (eMMC) performance decides the system throughput"
echo "Please answer with N to remove the mirror. Anything else means yes."
read answer
if [ "$answer" = "N" ]
then
remove_emmc_mirror
else
echo "You have chosen to keep the mirror ... "
fi
echo "updating bootloader label(s) ... "
update_efi_boot_loader_label
}
Once the file is saved, make sure you update its permission:
chmod 700 setup_nvme_boot.sh
To Mirror or Not?
Before running the script, think about what you would like to configuration to look like:
- High Performance + Redundancy, or
- Highest performance and no Redundancy.
As with everything else, there are Pros and Cons:
Keeping the mirror (Redundancy)
In this scenario, you will have NVMe SSD and the eMMC mirror each other.
Pros
- You will have a mirror of everything
- Will automatically switch to eMMC is NVMe SSD failes
- You can boot from either one (needs a monitor)
Cons
- Regardless of your NVME capacity, you are limited to the size of the eMMC
- The slowest (eMMC) performance decides the system throughput
- You cannot use eMMC for anything else
Highest performance
In this scenario, all partitions on eMMC are deleted and destroyed.
Pros
- Higher performance
- Less things to maintain
Cons
- If it fails, it needs to be replaced.
Run the script
Type:
sudo -i
This way, you will be running as root. So, be very careful!
Once done, type:
./setup.nvme.boot
Wait for the process to complete!
You are done!
