|This is another in the series documenting my setup of a new home server with the Linksprite pcDuino3 Nano. A listing for the entire series can be found here. More information on the pcDuino3 Nano can be found at Linksprite’s website and the pcDuino website.|
Now that I have the corrupted nand root file system resolved the next step was to configure the system with the root file system on the SATA drive.
I booted the system without the sd card as I Once the system booted the first thing I did was to check to make sure that the system could see the drive. There are a number of ways to do this. I used the lsblk command:
The lsblk command reports two block devices. These are sda which is the SATA disk I just connected to the system and the onboard NAND storage. You can tell that the system is running from the root file system nandd by looking at the mount point.
1) Format the drive. This is done using fdisk, In my case I was looking to have one partition that consisted of the entire drive.
root@ubuntu:~# fdisk /dev/sda
The device presents a logical sector size that is smaller than
Command (m for help): n
Command (m for help): t
Command (m for help): w
Calling ioctl() to re-read partition table.
If you run the lsblk command again you will see the changes.
We now have a partition sda1.
2) Copy the root file system to the SATA disk. Insert the sd card and run lsblk and you now have three block devices. We will be copying the root file system which is on the second partition of the sd card on /dev/mmcblkl0p2.
3) When the dd command completes there are several additional steps to do with the SATA disk.
Labeling the disk is optional. If you wish to label the disk you will use the e2label command.
The next step is to generate a new uuid for the SATA disk. As the data on the SATA disk is just a copy of the sd card it will have the same uuid. The system will work this way but as uuid’s are supposed to be unique on a system it isn’t good. The new uuid is set on the drive using the tune2fs command.
root@ubuntu:~# e2label /dev/sda1 System
4) Set the system to load the root file system form the SATA disk. This is done by updating uEnv.txt on the sd card. Using lsblk you will see that the boot partition is mounted on /mediaCDE1-5BFE so using a text editorthe file is updated.
root$ubuntu:~#: nano /media/CDE1-5BFE/uEnv.txt
The line that needs to be changed is the one that starts with mmc_root.
/dev/mmcblk0p2 –> /dev/sda1
5) Reboot the system and you should boot into the root file system on your SATA drive.