2014년 11월 8일 토요일

Use SSD as Rootfs of CT

Introduction


I had a redundant SSD, and I was worried about system size and speed of CT. So, I tried to use the SSD as rootfs. However, I don't use the SSD as rootfs any more, because their speeds are not quite different, and using SSD as extenal drive provides much more size. But, if you have small sd card, you can try it.

Step 1: Mount Current Rootfs on CT


At fisrt, mount the current rootfs. In my case, curenty rootfs is /dev/nand. It should be mounted at accessable directory, such as /tmp/src.
sudo su - root
mkdir /tmp/src
mount /dev/nandb /tmp/src

Also, we need to know where the SSD is. You can find the SSD by below commend
fdisk -l

Step 2: Format and Mount SSD


We need to format the SSD and set the SSD as ext4 to use in linux system. My SSD is /dev/sda1 found from fdisk command.
mkfs ext4 /dev/sda1

We need to mount the SSD to some accessable directory, such as /tmp/dst.
mkdir /tmp/dst
mount /dev/sda1 /tmp/dst

Step 3: Copy Rootfs From Nand to SSD


By using belowd command, you can copy all data from nand to SSD. It will take more than 10 minutes. In my case, almost 30 minutes are taken.
(cd /tmp/src; tar --backup -c *) | tar -C /tmp/dst -xv

Step 4: Set Boot Partition


When you finish the copy, you have last job. Without this, your CT will boot from nand always. You need to change boot partition by changing uEnv.txt.
mkdir /tmp/boot
mount /dev/nanda /tmp/boot
cd /tmp/boot
vi uEnv.txt

There is one line /dev/nandb. It should be changed to /dev/sda1.

We have done. Just do sync and reboot
sync
reboot

Your CT will boot by SSD. Enjoy your CT with SSD.

 

[contact-form-7 id="24" title="Karl"]

댓글 없음:

댓글 쓰기