User Tools

Site Tools


odroid_root_microsd2sata

Перенос системного раздела Odroid HC2 (XU4) с microSD на SATA

https://wiki.odroid.com/odroid-xu4/software/building_webserver

Synchronize the MicroSD root to the external disk:

rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /mnt/sata.

This way you have the Micro-SD OS as a backup if anything goes wrong.

Find out the PARTUUID for the partition:

# blkid

Edit /boot/boot.ini, replace

root=UUID=${uuid}

with

root=UUID=the-uuid-you-found

Reboot the XU4.
If everything worked correctly, it should boot up as expected from the external disk. Check if mount | grep '/ ' contains /dev/sdaX or /dev/mmcblk1pX, it should be sdaX.

Edit /etc/fstab, add these:

/dev/mmcblk1p1 /mnt/microsd auto defaults 0 0
/mnt/microsd/boot /boot none defaults,bind 0 0

Пример

Исходная конфигурация

/media/boot/boot.ini:

setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0"

# blkid:

/dev/mmcblk1p1: SEC_TYPE="msdos" LABEL="boot" UUID="52AA-6867" TYPE="vfat" PARTUUID="3cedfd53-01"
/dev/mmcblk1p2: LABEL="rootfs" UUID="e139ce78-9841-40fe-8823-96a304a09859" TYPE="ext4" PARTUUID="3cedfd53-02"
/dev/sda2: UUID="47428b94-ab81-4822-8a3b-d7f24100438b" TYPE="ext4" PARTUUID="0d6fa616-c7af-8b43-ae9c-89a3fede2ef0"
/dev/mmcblk1: PTUUID="3cedfd53" PTTYPE="dos"
/dev/sda1: UUID="ff3a406b-3a3a-413f-99cc-c61e1454604f" TYPE="ext4" PARTUUID="a81f0eee-5375-484b-adf8-993d084289b8"

/etc/fstab (@ mmcblk1p2):

UUID=e139ce78-9841-40fe-8823-96a304a09859 / ext4 errors=remount-ro,noatime 0 1
LABEL=boot /media/boot vfat defaults 0 1

После изменения

/media/boot/boot.ini:

setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=ff3a406b-3a3a-413f-99cc-c61e1454604f rootwait ro fsck.repair=yes net.ifnames=0"

/etc/fstab (@ sda1):

UUID=ff3a406b-3a3a-413f-99cc-c61e1454604f / ext4 errors=remount-ro,noatime 0 1
LABEL=boot /media/boot vfat defaults 0 1
odroid_root_microsd2sata.txt · Last modified: 2019/06/07 19:39 by admin