Wednesday, June 20, 2018

friendlyarm nanopi t4 with rockchip 3399


Notes about setting up Lubuntu bits on the t4 board

login is pi, default pi

http://wiki.friendlyarm.com/wiki/index.php/NanoPC-T4#Connect_NVME_SSD_High_Speed_Hard_Disk_to_T4

Connect NVME SSD High Speed Hard Disk to T4

Connect a NVME SSD hard disk to NanoPC-T4's M.2 interface, initialize and automatically mount the SSD by running the following commands. Before proceed turn off your T4 and connect an SSD to your T4. Power on your T4 and open a command line utility(go to top left of the GUI and enter System Tools -> LXTerminal) or SSH to your T4.

We suggest you switch to "root" by running the following command:
su -
The password for "root" is "fa".

Detection of SSD

root@FriendlyELEC:~# cat /proc/partitions 
major minor  #blocks  name
   1        0       4096 ram0
 259        0  125034840 nvme0n1
If there is a nvme0n1 device node it means an SSD is recognized by T4.

Partition of SSD

To mount an SSD under Linux we re-partition it as one section by running the following command:
(echo o; echo n; echo p; echo 1; echo ""; echo ""; echo w; echo q) | fdisk /dev/nvme0n1
If you want to re-partition it to multiple sections you can run "fdisk /dev/nvme0n1". For more detail about this command refer to the fdisk's manual.

Format Section to EXT4

After an SSD is successfully partitioned you can check its sections by running "cat /proc/partitions". The image provided treats a PCIe nvme device's sections as an eMMC's sections you will find that an SSD has some small sections.

We can check the "blocks" column and the biggest section is available for users. The /dev/nvme0n1p7 section is used to store data:
root@FriendlyELEC:~# cat /proc/partitions 
major minor  #blocks  name
   1        0       4096 ram0
 259        0  125034840 nvme0n1
 259        1       4096 nvme0n1p1
 259        2       4096 nvme0n1p2
 259        3       4096 nvme0n1p3
 259        4      12288 nvme0n1p4
 259        5      32768 nvme0n1p5
 259        6      32768 nvme0n1p6
 259        7  124932440 nvme0n1p7

The following command formats a section to ext4:
mkfs.ext4 /dev/nvme0n1p7

Auto Mount SSD on System Startup

Before we mount an SSD's section you need to know its Block ID. You can check it by running "blkid":
blkid /dev/nvme0n1p7
/dev/nvme0n1p7: UUID="13fb682e-ef40-4c71-b98b-3d17403e1205" TYPE=“ext4"
Add a "Block ID" to "/etc/fstab" and here is what it looks like
UUID=<Block ID> /media/nvme ext4 defaults 0 0
You need to replace <Block ID> with the UUID obtained by running "blkid". To mount the SSD in our example we made the "/etc/fstab" file as follows:
UUID=13fb682e-ef40-4c71-b98b-3d17403e1205 /media/nvme ext4 defaults 0 0
We want to mount an SSD to "/media/nvme" but this directory doesn't exist. Therefore we create it and change its access right by running the following commands:
mkdir /media/nvme
chmod 777 /media/nvme
Run "mount" to check if the SSD is mounted successfully:
mount /media/nvme
You can reboot your T4 to check if your SSD will be automatically mounted:
poweroff

-30-

No comments:

Post a Comment