Ask Your Question

How to move rootfs to SATA disk ? (Fedora 23 for arm)

asked 2016-04-15 02:58:00 -0500

annbigbig gravatar image

I 've installed Fedora 23 Image on CubieTruck (v3)
basically I followed instructions from here

it's working , I have a bootable SD card that Fedora 23 running on it.
but I want the rootfs could be on SATA disk
so I copied whole rootfs to /dev/sda1 with these commands:

mkdir -p /mnt/sda1
mount /dev/sda1 /mnt/sda1
cd /
tar --backup -c * | tar -C /mnt/sda1 -xv

then I know I have to do something to tell CubieTruck where it's rootfs is
first I type 'blkid' for showing UUID of all partitions on CubieTruck


then I got

/dev/sda1: UUID="c97a1e9e-d747-4f89-a31a-c81eeec173f7" TYPE="ext4" PARTUUID="e0482b6f-01"
/dev/mmcblk0: PTUUID="e596b3d6" PTTYPE="dos"
/dev/mmcblk0p1: LABEL="_/boot" UUID="1109afb6-2f19-4bc0-b0a5-b5eda3ee62e7" TYPE="ext4" PARTUUID="e596b3d6-01"
/dev/mmcblk0p2: LABEL="_swap" UUID="e993b93b-8c2b-4c92-8af9-81cfe01cb7be" TYPE="swap" PARTUUID="e596b3d6-02"
/dev/mmcblk0p3: LABEL="_/" UUID="a088dbd6-b8f0-4201-bfad-c2fdd15576fe" TYPE="ext4" PARTUUID="e596b3d6-03"

now I know UUID="a088dbd6-b8f0-4201-bfad-c2fdd15576fe" is mapping to /dev/mmcblk0p3
and UUID="c97a1e9e-d747-4f89-a31a-c81eeec173f7" is mapping to /dev/sda1
then I modify this file /boot/boot.cmd change this line (original mapping to /dev/mmcblk0p3)


to this line (new mapping to /dev/sda1)


and run these command for translate boot.cmd to boot.scr

cd /boot
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "a-b-c on Thu Apr 14 21:29:00 CST 2016" -d boot.cmd boot.scr

but after reboot I realized the rootfs is still on /dev/mmcblk0p3

df -h

I got

檔案系統        容量  已用  可用 已用% 掛載點
devtmpfs        978M     0  978M    0% /dev
tmpfs          1007M     0 1007M    0% /dev/shm
tmpfs          1007M  728K 1007M    1% /run
tmpfs          1007M     0 1007M    0% /sys/fs/cgroup
/dev/mmcblk0p3  4.5G  3.5G  981M   79% /
/dev/mmcblk0p1  457M  210M  233M   48% /boot
tmpfs           202M     0  202M    0% /run/user/1000

I really want rootfs could be on /dev/sda1 of SATA harddisk
because It has stronger faster read/write speed
could someone help me ? any suggestion will be appreciated

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2016-04-15 17:08:00 -0500

cmurf gravatar image

What about fstab? I'm gonna guess systemd could be changing to the old root at switch root time by honoring the old / entry in fstab. You should be able to get a hint of what's going on by looking at the journal. If not, you can make it more verbose by adding boot parameter 'systemd.log_level=debug' which will slow things down a bit but you'll see a lot more detail. There's an off chance that there's a UUID baked into the initramfs, which I'd argue is a bug, but to learn about that you'd use rd.debug as a boot parameter and grep a portion of the old root UUID from the journal -b output and see if there are any references for that old UUID. If so you might have to assemble the new system at /mnt, then bind mind /dev, /proc/, and /sys, chroot /mnt, then dracut -f to rebuild the initramfs.

edit flag offensive delete link more

answered 2016-07-28 11:26:30 -0500

jeroen gravatar image


I've just moved the rootfs over to my SATA disk. First I've used a different approach to cloning the root partition to the SATA partition. Instead of tar I've used the command cp -xva / /mnt/sda1 I found that the method you are using also cloned folders such as /dev and /proc.

Once the cloning was successful I updated the fstab in /mnt/sda1/etc/fstab to included the correct UUID for the new root partition. After that I created a new default boot entry the following file: /boot/extlinux/extlinux.conf Make sure to leave the original entries in this file so you always have a fall back in case the boot from SATA fails for some reason.

Good luck and let me know the outcome.

edit flag offensive delete link more

Question Tools


Asked: 2016-04-15 02:58:00 -0500

Seen: 279 times

Last updated: Apr 15 '16