Beginners Guide: Migrating to SSD
#1
This is for Rock 64 LINUX beginners who wants to migrate their Debian Jessie/Stretch minimal from the SD card to a much faster (SSD) and/or bigger drive.

Assuming  the SSD has already been connected,  partitioned,  and formatted to EXT4, here are few simple steps to follow: :

1. Label the SSD partition where the root file systems will be migrated to.


Quote:sudo e2label /dev/sda1 rootfs


Here, my SSD partition is /dev/sda1 (yours maybe different) and I use rootfs as the label. You can use whatever label of your choice but make sure you use the same label on step 4. 

2. Mount the SSD drive


Quote:sudo mount /dev/sda1 /mnt


3. Copy (or move) the root file system from the SD card to the SSD partition.


Quote:sudo cp -avx  / /mnt 


4. Tell Linux where to find the root file system by editing the configuration file  /boot/efi/extlinux/extlinux.conf


Quote:sudo nano  /boot/efi/extlinux/extlinux.conf


In the editor, you will see the text as follows:

Quote:label kernel-4.4
    kernel /Image
    initrd /initrd.img
    fdt /dtb
    append earlycon=uart8250,mmio32,0xff130000 rw root=LABEL=linux-root rootwait rootfstype=ext4 init=/sbin/init coherent_pool=1M


Change LABEL=linux-root to LABEL=rootfs  or whatever label you used on step 1.

Save the change and exit the editor.

5. Reboot

After reboot and login back, you can verify with lsblk -f command.

Quote:sudo lsblk -f 


Have fun.
  Reply
#2
There are several other ways to address the Linux root file system (rootfs) partition. One of the easiest way (but bad) is to use the partition name like “/dev/sda1” in your /boot/efi/extlinux/extlinux.conf file.
Code:
label kernel-4.4
   kernel /Image
   initrd /initrd.img
   fdt /dtb
   append earlycon=uart8250,mmio32,0xff130000 rw root=/dev/sda1 rootwait rootfstype=ext4 init=/sbin/init coherent_pool=1M ethaddr=${ethaddr} eth1addr=${eth1addr} serial=${serial#}

This is NOT a recommended way if you have more than one USB disk to be attached to your system since the name “/dev/sda1” can be grabbed by any other attached disk depending on how fast the disk first responds during boot time. Your linux rootfs partition may become “/dev/sda1”, “/dev/sdb1”,  “/dev/sdc1”, etc.

A good way would be to use UUID of the disk partition instead. Here is how:

To find out the UUID of your rootfs disk partition, run sudo lsblk –f command. 

Edit /boot/efi/extlinux/extlinux.conf to use UUID. For example:
Code:
label kernel-4.4
   kernel /Image
   initrd /initrd.img
   fdt /dtb
   append earlycon=uart8250,mmio32,0xff130000 rw root=UUID=f86f4f1d-a3bf-4b87-98d0-18f586c27723 rootwait rootfstype=ext4 init=/sbin/init coherent_pool=1M ethaddr=${ethaddr} eth1addr=${eth1addr} serial=${serial#}

Note: You will need external USB disk enclosure or USB3-SATA converter with its own dedicated power supply for the Rock64 to remain stable. If you have more than one disk, get a powered USB3.0 hub.
  Reply
#3
Excellent, thanks for posting this.  I was just getting ready to sort this out, and thought someone must have posted this info.  A quick search found your post. Smile

My Rock64 seems to be eating 4GB micro SD cards, as I've gone through 3 of them.  I'm moving the root FS to the HD now.
  Reply
#4
Fine tutorial. In a few days the wiki will be finished and there will be an extensive software tutorial section. For future tutorials, you can just log into wiki (your forum profile will work) and submit stuff on there. More info on this soon.
You can find me on IRC, Discord and Twitter


  Reply
#5
i also find this howto well written. i'm curious if anyone has had the opportunity to use a ssd drive as a boot /filesystem device and has also had the experience of using eemc card for boot/filesystem. both methods using the rock64 4GB as the sbc. i would like to know if the ssd setup is about the same as using eemc? thanks.
  Reply
#6
Rotant, Great instructions.
These really helped, but there's just one thing. After migrating to an USB FlashDrive, will I need to keep the microsd in there? 

My file system is now on the other drive, but will not boot without the microsd.

Code:
NAME        FSTYPE  SIZE MOUNTPOINT LABEL
sda                29.9G
|-sda1              3.9M
|-sda2               64K
|-sda3                4M
|-sda4                4M
|-sda5                4M
|-sda6      vfat    112M            boot
`-sda7      ext4   29.8G /          rootfs
mmcblk1            59.5G
|-mmcblk1p1         3.9M
|-mmcblk1p2          64K
|-mmcblk1p3           4M
|-mmcblk1p4           4M
|-mmcblk1p5           4M
|-mmcblk1p6 vfat    112M /boot/efi  boot
`-mmcblk1p7 ext4   59.4G            linux-root
NAME        FSTYPE  SIZE MOUNTPOINT LABEL
sda                29.9G
|-sda1              3.9M
|-sda2               64K
|-sda3                4M
|-sda4                4M
|-sda5                4M
|-sda6      vfat    112M            boot
`-sda7      ext4   29.8G /          rootfs
mmcblk1            59.5G
|-mmcblk1p1         3.9M
|-mmcblk1p2          64K
|-mmcblk1p3           4M
|-mmcblk1p4           4M
|-mmcblk1p5           4M
|-mmcblk1p6 vfat    112M /boot/efi  boot
`-mmcblk1p7 ext4   59.4G            linux-root
  Reply
#7
(08-19-2017, 12:59 AM)rontant Wrote: Assuming  the SSD has already been connected,  partitioned,  and formatted to EXT4, here are few simple steps to follow: :
Why is EXT4 mandatory?
  Reply
#8
With the SPI flash now functional on the Rock64, and with super simple instructions to USB boot available, I strongly suggest everyone who seeks to use the USB 3.0 HDD read SPI flashing instructions instead of the method in this tutorial.
You can find me on IRC, Discord and Twitter


  Reply
#9
(01-23-2018, 03:30 PM)Luke Wrote: With the SPI flash now functional on the Rock64, and with super simple instructions to USB boot available, I strongly suggest everyone who seeks to use the USB 3.0 HDD read SPI flashing instructions instead of the method in this tutorial.

I totally agree. I used your new instructions and brought up both of my Rock64's quite effortlessly.
  Reply
#10
(01-23-2018, 05:54 PM)GaryLa Wrote:
(01-23-2018, 03:30 PM)Luke Wrote: With the SPI flash now functional on the Rock64, and with super simple instructions to USB boot available, I strongly suggest everyone who seeks to use the USB 3.0 HDD read SPI flashing instructions instead of the method in this tutorial.

I totally agree. I used your new instructions and brought up both of my Rock64's quite effortlessly.


Hi GaryLa, yea I am almost considering locking this thread to spare people the headache of following the OPs instructions (that he posted prior to SPI being functional, so perfectly justified) and finding out there is a dead-easy way to achieve the same result in a much neater and simpler way. 

As a side-note; I got your PM but since you've disabled your PM I cannot respond (myBB system is crazy allowing this). So, would you please enable your PM or joint the IRC?
You can find me on IRC, Discord and Twitter


  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Step by step guide PXE diskless configuration. burglar_ot 12 3,888 04-08-2019, 08:27 AM
Last Post: burglar_ot
Thumbs Up A guide for how I made RetroPie, RetroArch, and EmulationStation Work on the Rock64 Mrfixit2001 4 5,039 12-17-2018, 03:52 AM
Last Post: va88
  Guide - XRDP - Debian Stretch / Ubuntu Xenial / OMV S3phi40T 3 6,374 05-05-2018, 06:08 AM
Last Post: S3phi40T
Information Guide - Raid Array (Raid 0) Ptheven 0 1,599 10-07-2017, 09:22 AM
Last Post: Ptheven
Information Guide - Setting up a NFS Share Ptheven 0 2,031 09-26-2017, 04:44 AM
Last Post: Ptheven
  Guide - Setting up a SMB(Windows) file server Ptheven 0 2,275 08-21-2017, 08:54 AM
Last Post: Ptheven
Information Beginners Guide: Locating your board, connecting to it. Ptheven 5 5,100 08-21-2017, 04:12 AM
Last Post: Ptheven
Information Beginners Guide: Adding USB Storage, Linux Formatting and Permissions Ptheven 3 3,584 08-16-2017, 01:19 AM
Last Post: Ptheven

Forum Jump:


Users browsing this thread: 1 Guest(s)