[Solved] Moving extroot to new USB drive

I currently have an Archer C7 running with a USB drive plugged for extra space (followed this guide https://lede-project.org/docs/user-guide/extroot_configuration).

I would like to replace this USB with a larger drive. What would be the best way to make the switch as seamless as possible? I'm thinking that I will run into issues when I put in the new USB drive as the installed programs will no longer be there.

Clone the current USB drive to the new USB drive.


So a bit by bit copy using dd would be sufficient?

I wouldn't do a bit by bit copy. There is no magic somewhere, like a bootloader. It's just a bunch of files.
A bit by bit copy won't use the whole size of the new stick, you'll copy over filesystem errors (if they exist), you are wasting time and write cycles of the stick by copying empty space and slack data.

So put a sufficient filesystem on the new stick, and copy everything over using 'cp -a'.

first you want to plug in the new usb, make sure it is visible as a mount point, find what device the new mount point is /mnt/sdb1 /mnt/sdc1 whatever, also make sure you have the usb device formatted as ext3 ext4, and all the appropriate kernel modules kmod-fs-ext3 kmod-fs-ext4 kmod-usb-storage, kmod-usb-storage-extras then open a shell and run.

mount /dev/sda1 /mnt/sda1 ; tar -C /overlay -cvf - . | tar -C /mnt/sda1 -xf - ; umount /mnt/sda1

you'll want to replace /dev/sda1 with the new device and /mnt/sda1 with the new device throughout the whole command for example:

mount /dev/sdb1 /mnt/sdb1 ; tar -C /overlay -cvf - . | tar -C /mnt/sdb1 -xf - ; umount /mnt/sdb1

then run this command:

block detect > /etc/config/fstab;
sed -i s/option$'\t'enabled$'\t''0'/option$'\t'enabled$'\t''1'/ /etc/config/fstab; /
sed -i s#/mnt/sdb1#/overlay# /etc/config/fstab;
cat /etc/config/fstab;

again replacing "sed -i s#/mnt/sdb1#/overlay# /etc/config/fstab; " with the new mnt point. it will give you a print out of the new mounts check to see if the /overlay corresponds with the new uuid for the new mount device. Everything that is currently installed should remain intact.
and a reboot.
that should work.

P.S. if its just for extra storage plug it in and check to see if its mounted, if its mounted then go to /mnt/sdX1 whatever its mounted as, and theres your new mounted storage, the above commands are for using a usb drive as your external root, meaning your device would use the new usb drive for all commands and installs, some what of a symbolic link from the root to the usb drive storage.
Here is what i had done previously when i first installed lede 17.01.4 archer c7 version 2 - #2 by sycohexor

Thank you, managed to upgrade the capacity.

1 Like

Dont know why wiki suggest using tar. Simple "cp -a" does the job perfectly

i tried that, gave me issues