Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

AI_NAS

This project builds a NAS with AI capabilities to classify automatically stored files and make them usable in a semantic search.

Hardware

Updating Samsung 990 Pro Firmware (not working yet, but should with VFIO Kernel module)

  • Login into your NAS
  • Download the latest firmware update iso from Samsung Storage Firmware
    wget https://download.semiconductor.samsung.com/resources/software-resources/Samsung_SSD_990_PRO_7B2QJXD7.iso
    
  • Mount the iso-image:
    sudo mkdir -p /mnt/iso
    sudo mount -o loop ./Samsung_SSD_990_PRO_7B2QJXD7.iso /mnt/iso
    
  • Run the update image in a x86 virtual machine:
    qemu-system-x86_64 -kernel /mnt/iso/bzImage \
                       -initrd /mnt/iso/initrd \
                       -drive file=disk.img,format=raw,if=virtio \
                       -m 2G \
                       -nographic \
                       -append "root=/dev/vda rw console=ttyS0,115200 earlyprintk=serial earlycon"
    
    • this should show the kernel boot logs and ends in Samsungs fumagician cli nvme update tool
    • because no NVME is available in the VM, the tool does not find any NVME
  • Make the NVME available in the VM (in theory, not tested yet due to missing VFIO kernel module)
    # unbind the nvme:
    lspci -nn | grep -i nvme
    # outputs: 0003:31:00.0
    # use the pci address in the unbind command:
    echo 0003:31:00.0 | sudo tee /sys/bus/pci/devices/0003\:31\:00.0/driver/unbind
    
  • Bind it to the VFIO driver (works only, if IOMMU is supported!)
    sudo modprobe vfio
    sudo modprobe vfio-pci
    # bind the device:
    echo 144d a808 | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id
    # Use your device’s vendor & device ID (from lspci -nn).
    # Check binding:
    lspci -k -s 0003:31:00.0
    # should show: Kernel driver in use: vfio-pci
    
  • Add the NVMe to QEMU:
    qemu-system-x86_64
    [...]
     -device vfio-pci,host=0000:03:00.0,multifunction=on
    

Software

ZFS

  • Created an encrypted zfs-pool "naspool" with lz4 compression according to Alpine Wiki
    • encryption key is stored in /etc/naspool.key in the root-fs of the NAS (a backup can be found on WOPR)
# create the encryption key
sudo dd if=/dev/random of=/etc/naspool.key bs=32 count=1
sudo chmod 0600 /etc/naspool.key

# create the zfs pool
sudo zpool create -o ashift=12 -O acltype=posixacl -O compression=lz4 -O dnodesize=auto -O normalization=formD -O relatime=on -O xattr=sa -O encryption=aes-256-gcm -O keylocation=file:///etc/naspool.key -O keyformat=raw -O mountpoint=none naspool nvme3n1

About

A NVMe NAS with AI capabilities based on the FriendlyElec CM3588 NAS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors