Jump to content

How can I move the root filesystem manually from sata drive to eMMC


Recommended Posts

Posted

Hello,

 

After I first installed my Helios64, I feared the 16Gb eMMC would be quickly filled.

So when I used nand-sata-install, I chose to boot from eMMC but to have the root filesystem on a 500Gb sata drive.

 

I have now second thoughts about it, since I realized that the OS take less than 8Gb, AND I'd like to add a 5th disk to my raid :)

Halas nand-sata-install doesn't seem to work on an already moved filsystem.

 

lsblk show this for the eMMC and the root partition

peyo@helios64:~$ lsblk 
NAME         MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda            8:0    0 465,8G  0 disk  
└─sda1         8:1    0 465,8G  0 part  /
...
mmcblk2      179:0    0  14,6G  0 disk  
└─mmcblk2p1  179:1    0  14,4G  0 part  /media/mmcboot

 

And /etc/fstab shows this
 

UUID=f2d7d6e7-902c-44dc-bdae-aedeb4495385    /media/mmcboot    ext4    defaults,noatime,nodiratime,commit=600,errors=remount-ro,x-gvfs-hide    0    1
/media/mmcboot/boot                   /boot        none    bind                                0       0
UUID=0fcd9a2c-9a46-4a5e-a0f5-e407bd34e8fb    /        ext4    defaults,noatime,nodiratime,commit=600,errors=remount-ro,x-gvfs-hide    0    1

...

And in /media I have this

peyo@helios64:~$ ll /media/
total 8
drwxr-xr-x 3 root root 4096 déc.   6 11:31 mmcboot
drwxr-xr-x 2 root root 4096 déc.   6 11:31 mmcroot

 

 

Would it be so simple as

1 - rsync all that's on my present / (except for the NFS export and /tmp)?

2 - changin /etc/fstab to this

UUID=f2d7d6e7-902c-44dc-bdae-aedeb4495385    /    ext4    defaults,noatime,nodiratime,commit=600,errors=remount-ro,x-gvfs-hide    0    1

3 - reboot (with crossed fingers)
 

Thanks for you help

Posted

Yes unfortunately nand-sata-install does not work the other way around, I'm looking at it currently since there was another use case related to install on OS rootfs on HDD that wasn't also supported.

 

The step for you case should be :

 

1. First boot the system on a microSD card with a fresh install of Armbian.

 

2. Copy rootfs from old destination (HDD) to new destination (eMMC)

 

mkdir /mnt/rfs_new /mnt/rfs_old

mount /dev/mmcblk2p1 /mnt/rfs_new/
mount /dev/sdX1 /mnt/rfs_old/

rsync -avrlt --delete --exclude-from=/usr/lib/nand-sata-install/exclude.txt /mnt/rfs_old/ /mnt/rfs_new/

 

3. use command blkid to know the UUID of /dev/mmcblk2p1

 

4. Modify /mnt/rfs_new/boot/armbianEnv.txt to modify rootdev line with the UUID of /dev/mmcblk2p1

 

verbosity=1
bootlogo=false
overlay_prefix=rockchip
rootdev=UUID=075c8660-77ca-4048-a04b-be3364c60a40
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

5. Modify /mnt/rfs_new/etc/fstab 

 

- Remove /media/mmcboot and /boot mount point lines

- Edit / mount point to use the UUID of /dev/mmcblk2p1

 

# <file system>					<mount point>	<type>	<options>							<dump>	<pass>
tmpfs						/tmp		tmpfs	defaults,nosuid							0	0
UUID=075c8660-77ca-4048-a04b-be3364c60a40	/		ext4	defaults,noatime,nodiratime,commit=600,errors=remount-ro,x-gvfs-hide	0	1

 

6. Sync and Poweroff

 

7. Remove microSD and Poweron (maybe cross your finger also)

 

 

 

Posted (edited)

Great thanks, I'll try that as soon as possible

 

Update : Just did it, it worked like a charm, thanks a bunch!

Edited by ploubi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines