Replacing USB drive - best practice?

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.
A

andrew2018

Guest
Is there a best practice to replace a USB drive that contains entware, swap and skynet folders? Thanks.
 

dosborne

Very Senior Member
Not really sure what you asking for or about.

Lots of free usb imaging tools that you can use to take an image and write it to a new one.

Are you asking about speed, or brands, or ...
 
A

andrew2018

Guest
Sorry, I wasn't very clear. I have a small USB drive now and want to replace with a much larger one. I want to preserve the contents but expand the partition size to use the whole of the new drive. What's the best way to do that? Thanks.
 

RMerlin

Asuswrt-Merlin dev
Plug both disks at once, and copy all the content from one to another.
 
  • Like
Reactions: a5m

bluzfanmr1

Senior Member
I just had to do this a couple of days ago and moving all the folders from one usb to the other worked perfectly.
 
  • Like
Reactions: a5m

dosborne

Very Senior Member
Plug both disks at once, and copy all the content from one to another.
Or, use one of the many free utilities out there to take a backup image (which is never a bad idea to have), then write the image to the new device. Some utilities will allow you to expand the partition when you write the image, or you may have to do that manual afterwards.
 

RMerlin

Asuswrt-Merlin dev
Or, use one of the many free utilities out there to take a backup image (which is never a bad idea to have), then write the image to the new device. Some utilities will allow you to expand the partition when you write the image, or you may have to do that manual afterwards.

Don't use imaging solutions, just copy the content, as the new disk is already partitionned/formated.
 

dosborne

Very Senior Member
Don't use imaging solutions, just copy the content, as the new disk is already partitionned/formated.
Personal choice :)

I love imaging my usb drives. I can "roll back" or restore to various points in time or to newer devices. If one fails, I can have a new one ready in minutes. Most of my devices backup files daily as well so takes almost no time to get back to a working and up to date state.
 
A

andrew2018

Guest
Don't use imaging solutions, just copy the content, as the new disk is already partitionned/formated.
Thanks, I was able to do as you suggested. I changed the name of the mount point to match my old usb drive, just in case something needed that.
 

Diamond67

Senior Member
Or, use one of the many free utilities out there to take a backup image (which is never a bad idea to have), then write the image to the new device. Some utilities will allow you to expand the partition when you write the image, or you may have to do that manual afterwards.

Which very utility do you use @dosborne ?

Sometimes I would like to connect a spare usb flash drive to my usb hub (which is connected to my router) and take backup images of other flash drives to it.

Or is it possible to use some Windows applications and take images of flash drives to computer?
 

TechTinkerer

Senior Member

RMerlin

Asuswrt-Merlin dev
Personal choice :)

I love imaging my usb drives. I can "roll back" or restore to various points in time or to newer devices. If one fails, I can have a new one ready in minutes. Most of my devices backup files daily as well so takes almost no time to get back to a working and up to date state.

USB drives aren't always partitionned the same way. Some have a hidden partition with tools to handle disk encryption, for instance. You will also run into issues if trying to image a small FAT32 drive into a much larger one that's beyond the FAT32 limitations.

So unless you have sufficient technical knowledge to be aware of such potential issues, doing a simple tar-based backup for a thumbdrive is both safer and faster.
 

dosborne

Very Senior Member

L&LD

Part of the Furniture
My best practice?

Buy a new USB drive (16GB or larger, 64GB preferred). Format it in PC as NTFS, even if already using that format.

Check the 'Format JFFS partition on the next reboot' option and make sure you hit 'Apply' at the bottom of the page before rebooting.

Reboot the router 3 times in the next 15 minutes, waiting at least 5 to 10 minutes between reboots.

Connect the newly prepared drive to the router (over a short 'extension' cable, if possible) and proceed to format it using amtm to Ext4 with journaling and then adding a 2GB swap file.

The amtm Step-by-Step guide in the link in my signature below offers more details of that procedure.

Yes, I don't trust copies, backups or cloning, at all. No issues using this method so far. :D
 

dosborne

Very Senior Member
Yes, I don't trust copies, backups or cloning, at all. No issues using this method so far. :D
Yes, I do trust copies, backups or cloning. No issues using this method so far. :D

I've been using these methods for 30+ years :)
 

L&LD

Part of the Furniture
@dosborne as @RMerlin said above, you must be already aware of the pitfalls that can happen though.

The forums here are good examples when copies, backups (and I can't remember reading about cloning though) have been fraught with more issues than they were supposed to fix. :)
 

dosborne

Very Senior Member
While we've pretty much beaten the subject to death, my final comment on the topic is that "imaging" often can make it greatly easier in this situation if a person has little or no Linux knowledge or skills. Using a Windows PC or Mac makes it dead simple to create and restore backup images and the user doesn't know or care about multiple partitions, file systems, permissions, etc.

I agree with @RMerlin 100% that for a skilled user a tarball backup is the way to go. In fact, the system my website ran on created a daily backup on a daily basis from Feb 1998 all the way through to Mar 2016 and I have those files still today. I find it interesting to pull out the source code or configuration settings to see what I changed over time. But, I knew how to rebuild the o/s and partitions and filesystems and reset file permissions and ...

For setting up a dozen Raspberry Pi systems, cloning makes the tedious task of building and configuring all the base elements simple. Set 1 up. Clone 11 copies.

Either way, there are advantages and pitfalls and different skillsets required. Personally, I think that when presented with a fairly basic question such as the OP, it is best to match the answer to the perceived skill. Cloning/imaging, again IMO, is essentially a 2 step process that anyone with basic skills can handle. If the user was familiar with Linux commands and operating environment, they probably would not have asked this question.

Rsync, mentioned above, is also a great tool that allows for live backup across devices and systems. My 4x NAS boxes and 2x windows systems all rsync critical files amongst themselves, both live and time delayed,. My 6x Raspberry Pi systems similar all share rsynced configuration files and data and I've built an intricate system where these shared files are used in unique ways based on hostname or IP address turning a generic file into something specific to that system. I have many sdcard and usb devices that are cloned and ready for use at a moment's notice. Plug them in and they autoupdate and autoconfigure using cloned images, rsync, copy (cp) and tarballs.

Having multiple options so that a user can choose what works best for them and their situation is infinitely better than "do this." :)
 

L&LD

Part of the Furniture
@dosborne this is a 'fairly basic question' to yourself and your use of imaging software since 1998 is clouding your opinion, I think. :)

If they had set it up once from scratch already, they can do it again. :)

Learning the vagarities of cloning software and their cryptic options (for a beginner) is another skill for them to work on though. :)

I can wholeheartedly agree that choice is great. Many, if not most, beginners prefer a 'do this' approach too. :)
 
  • Like
Reactions: sto

Wallace_n_Gromit

Senior Member
I have a related question. Already have a 16GB USB Flash Drive partitioned to Ext4 and 2GB swap file with just about all the little Script programs installed via amtm on the USB 3.0 port. The problem I have with the flash drive is it sticks out about 2.5 inches from the back side of my AC68U. afraid that over time that I might accidently break it off, damage it.

So I bought a 16GB short (about 3/8 inch long) USB Flash Drive and have it installed into the adjacent USB 2.0 port of my AC68U. What I want to do, as simply as possible, is to copy/diskcopy/clone (whatever you wanna call it) what's on the existing Flash Drive to the new shorter Flash Drive and then swap out the New one into the USB 3.0 port. Then either keep the old one for back up, or wipe it and use it for something else, or give it to a buddy of mine for his AC68U and let him break it off :D

Plug both disks at once, and copy all the content from one to another.

Can I do this within a ssh session on the router? When I type in "rsync" at ssh command line I get [-sh: rsync: not found]. I'm guessing rsync isn't a recognized command in the router?

EDIT: I managed using amtm to format the new shorter USB drive with the "fd" command. Is there an equally easy way to diskcopy the contents of the original USB drive with the New USB drive to be swapped?


EDIT: just installed rsync using [opkg install rsync] just not certain of the proper syntax to do the diskcopy. :eek: Too many switches/parameters...

What is the syntax for the command line? I see both flash drives on the asuswrt-merlin GUI but I don't know how to see it at the command prompt in ssh session.

If not, then what is the best way to do this within windows 10.

TIA
 
Last edited:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top