Can a usb drive with data be safely transferred

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
nyddwrtuser330
DD-WRT User


Joined: 05 Mar 2018
Posts: 217

PostPosted: Thu Dec 30, 2021 3:21    Post subject: Can a usb drive with data be safely transferred Reply with quote
If replacing a primary router on latest firmware that has smb enabled on a usb hard disk with data, can that drive be safely transferred without data loss. destination would be a new router running a similar or later version of dd-wrt.

if there is a specific procedure, what should that be.
Sponsor
Mr R Design
DD-WRT User


Joined: 04 Nov 2020
Posts: 56

PostPosted: Thu Dec 30, 2021 6:54    Post subject: Reply with quote
Yes, I am forever pulling mine out and swopping it from one device to another for one reason or other.

Disable core usb support first, save, apply settings and reboot first if you want but I never do.
MesMurized
DD-WRT User


Joined: 08 Aug 2017
Posts: 83

PostPosted: Sat Jan 08, 2022 3:29    Post subject: Reply with quote
I've done it twice. So surprised it works. Saves a lot of work. Keep in mind, USB devices don't get unmounted with a power cycle. Had problems with e2fsck on ddwrt. Linux works great. I now manually [u]mount (using LABELS) in order to check the filesystems at boot. If problems arise, I know what works best.
fizikz
DD-WRT User


Joined: 10 Nov 2016
Posts: 265

PostPosted: Sat Jan 08, 2022 3:53    Post subject: Reply with quote
Depending on the router it may have a button to unmount the USB drive.
On the R7000 I recently discovered pressing and holding the WPS/SES button for a few seconds will turn the power light orange and a few moments later the webui shows the drive is unmounted.
Enable "Use SES Button to remove drives" under Services -> USB.
Really neat!
MesMurized
DD-WRT User


Joined: 08 Aug 2017
Posts: 83

PostPosted: Sat Jan 08, 2022 5:35    Post subject: Reply with quote
Unfortunately SES isn't available without automount. The random drive sda/sdb discovery messes with samba shares. Was fine with only two. My P9000 with internal jffs (now 3 partitions) forced a new plan.

Although I might rethink my current approach.

Update: Setting usb_ses_umount=1 restores functionally however it needs to be pressed twice (once for each device).


Last edited by MesMurized on Sun Jan 09, 2022 17:57; edited 2 times in total
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Sat Jan 08, 2022 11:25    Post subject: Re: Can a usb drive with data be safely transferred Reply with quote
nyddwrtuser330 wrote:
If replacing a primary router on latest firmware that has smb enabled on a usb hard disk with data, can that drive be safely transferred without data loss. destination would be a new router running a similar or later version of dd-wrt.

if there is a specific procedure, what should that be.

In the old Linux days, there is the "sync" command, and DD-WRT had it (/usr/sync)! Run it at least 3 times times before un-mounting the drive using /bin/umount.

That's why I hate USB drives without activity LEDs. Unfortunately, it's a trend now, to cut costs I guess. Smile

BTW, found some old messages:

DD-WRT Forum :: View topic - USB and safe umount script - possibly solved
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=45325

DD-WRT Forum :: View topic - How to unmount USB Drive?
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=979382

DD-WRT Forum :: View topic - Howto umount USB and shutdown the router properly?
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=701153

DD-WRT Forum :: View topic - Unmount USB help...
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1037087

DD-WRT Forum :: View topic - Shutdown script for any USB mounted drive
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=274512


_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
veekay
DD-WRT User


Joined: 09 Mar 2009
Posts: 77

PostPosted: Mon Jan 17, 2022 21:30    Post subject: Reply with quote
Looking to do the same thing, but wanting to test things before.

Is there a command to image the usb drive that is current plugged in? I was going to just copy files over ftp or ssh, but with thousands of small files it was going to take forever.

Ideally, plug in a second usb drive and clone it?
MesMurized
DD-WRT User


Joined: 08 Aug 2017
Posts: 83

PostPosted: Mon Jan 17, 2022 22:10    Post subject: Reply with quote
I use tar, ie: ' tar -cvf tarfile /jffs ' is fast and preserves all attributes.
The tarfile it can be saved anywhere even piped to remote storage

_________________
Current: Netgear R9000 DD-WRT v3.0-r55363 std (03/13/24)
Retired: Linksys WRT32X r39296, TP-Link Archer C7 v2, LinkSys WRT54G v5


Last edited by MesMurized on Mon Jan 17, 2022 22:17; edited 1 time in total
veekay
DD-WRT User


Joined: 09 Mar 2009
Posts: 77

PostPosted: Mon Jan 17, 2022 22:11    Post subject: Reply with quote
MesMurized wrote:
I use tar, ie: ' tar -cvf tarfile /jffs ' to preserve all attributes.
Then it can be saved anywhere.

With no local storage, tar's output can be piped to remote storage.


That is interesting since I was just trying that, but after 300mb it ends with an error of "tar: short read"
MesMurized
DD-WRT User


Joined: 08 Aug 2017
Posts: 83

PostPosted: Mon Jan 17, 2022 22:21    Post subject: Reply with quote
Not sure how I overcame those issues, but I use the full version in /opt/bin.

There's a tar option to split tarfiles into xxx size.

_________________
Current: Netgear R9000 DD-WRT v3.0-r55363 std (03/13/24)
Retired: Linksys WRT32X r39296, TP-Link Archer C7 v2, LinkSys WRT54G v5
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum