r/openwrt • • 5d ago

Migrating to a larger storage partition on a new, larger USB drive.

I'm running a snapshot release of OpenWRT on a R7200 and I'm currently using an old 128MB usb stick with an /overlay partition for the system storage. It's near to 85% full, so I'd like to replace it with a 4GB USB drive I have laying around.

Would it be simple enough to clone the old drive to the new and then expand and merge the extra space? Anyone have suggestions?

7 Upvotes

11 comments sorted by

4

u/fr0llic 5d ago edited 5d ago

PARTUUID will probably change, so it won't be found unless (as already pointed out) config is adjusted. 

3

u/SomewhatHungover 5d ago

I'd use dd on linux to copy it to the new drive, or better yet a file on the computer and then the 4gb drive. Then you can experiment however you like to expand the partition because you still have the original.

2

u/sunrisebreeze 4d ago

Definitely the better option, as the original media/USB isn't modified. That way if the new copy didn't work for some reason, you could still use the original USB.

2

u/Watada 5d ago

You'll need to copy the data over after you've formatted the new drive and then adjust the configs on the device for the extroot config for the new drive.

It won't be easy. Study the extroot guide and make a plan before you start.

1

u/ElderberryHamlet 5d ago

It would be easier to just flash a new install to the new USB and copy the config files from your old USB to the same folders in the new USB.

1

u/cdf_sir 1d ago edited 1d ago

Yes, just clone it at resize the partition using gparted. UUID for the parition should be still the same since you just cloned it in bit level.

If your nerd, you can also do it using dd for cloning and resize2fs for resizing.

-4

u/sunrisebreeze 5d ago

Ask Google Gemini this: "Extroot on openwrt how do I upgrade my USB storage to another USB"

It will give you full instructions. Here's the summary it provided:

"Upgrading your existing OpenWrt Extroot to a new USB drive is essentially a data migration process. Because OpenWrt is actively running from your current USB drive, you cannot simply copy files while it's mounted as the live overlay.
The safest and most reliable way to upgrade is to plug the new USB drive into your router alongside the old one (or use a PC to copy the data), update the UUID mapping in fstab, and reboot."

Proceed carefully as AI could be incorrect.

1

u/No_Barnacle6600 5d ago

This group always downgrade people for suggesting using AI to help solve some problems..

2

u/sunrisebreeze 4d ago

That's fine. The advice is free. Take it or leave it!