Moving files between shares

I want to reorganise my share / folder structure on my My Book Live.

I’m pretty sure that moving files within a share just updates pointers (or whatever the technical terms is), so is quick.  But I suspect that moving files between shares will require each file to be moved individually, taking hours for no good reason (it’s the same physical drive after all). 

Is there any way to move files and folders between shares that doesn’t involve waiting for hours?

Thanks.

Your assumptions are correct.

You can do that via SSH, using the command  “mv”, which is the Linux command “move.”

OK, I see the following thread has a bit more on this:

http://community.wdc.com/t5/My-Book-Live/Fast-copy-between-shares/m-p/161650

Are there any implications of moving files this way?  I’m quite picky about preserving all the file metadata / datestamps etc as I migrate over time from one device to another.  In particular, I want to preserve file creation and modification timestamps, because they hold valuable information in my view that mustn’t be lost in moving from one drive to another, or one folder to another.

Also, moving files in this way “by stealth” won’t confuse the drive controller’s view of what is stored, where?  For example, even just using “mkdir” to creat a new share won’t mean that that new share isn’t visible to the drive’s web interface setup facility? 

Borrowing from the above thread, can I just check that I’ve understood what I should do (not wanting to mess up), in moving everything (folders, files) from share existing “ShareA” to new “ShareB”…

(1) Go to http://yourIP/UI/ssh where yourIP is the IP address of the MyBook.

(2) Login as root, password welc0me (that’s a zero in there).

(3) cd /DataVolume/shares (change dir to where your shares are).

(4) ls (list your shares).

(5) mkdir ShareB (make a new folder for the new share).

(6) mv ShareA/* ShareB/ (move everything in ShareA into ShareB).

That’s it?

Another question: in step (5) above, if mkdir at the top level makes a new share, if you then cd (change directory) into that new share, and use mkdir again, will it just create a “normal” folder.  There appears to be a big distinction with this drive between a share (which is like a complete separate partition) and a folder.

And another related question: if I am moving files/folders from ShareA into “ShareB\subfolder” (i.e. a subfolder within new ShareA, not at the top level), will the above method work, just using mkdir in step (5) to create the subfolder, and putting in the full path to the new subfolder in step (6).  In other words:

(5*) mkdir ShareB (make a new folder for the new share).

(6*) cd ShareB

(7*) mkdir subfolder

(8*) cd /DataVolume/shares

(9*) mv ShareA/* ShareB/subfolder

Thanks!

OK I did a test move of stuff from one share to another using the above method.  Seemed to work well.

Only thing is, when I log into the standard dashboard, and look at the list of shares there, against the share where I copied loads of stuff to, the dashboard is showing “0GB / 0.9TB”, i.e. it thinks that that share is empty, whereas I know it is not. 

In fact, I’m not even sure this is related to my moving files via SSH, because another of my shares is showing 

“375GB / 0.9TB” when I know that it doesn’t hold that much (any longer)… I didn’t touch that share via SSH.

How do I get that information to update / correct?

Thanks.

Or what you could do is create another network share that is not accessable using the Web UI where this new share is at the root of all of the shares then when moving files “between shares” for Samba will simple be moving files between directories and Samba will simply move the fiolders.

Usual disclaimes apply.  The technique is NOT WD supported but cab be reversed as easily as it’s put in.

Login to the Linux shell and use nano to edit the file /etc/samba/overall_share.

You’ll see something like…

[SmartWare]
  path = /DataVolume/backup/SmartWare
  comment = SmartWare share
  public = yes
  browseable = no
  writable = yes
  guest ok = yes
  map read only = no

## BEGIN ## sharename = Public #
[Public]
  path = /shares/Public
  comment = Public share
  public = yes
  browseable = yes
  writable = yes
  guest ok = yes
  map read only = no
## END ##

 There is a lot more after ## END ##.

DO NOT CHANGE ANYTHING THAT’S ALREADY THERE!!!

What you are doing is adding a few more lines under the section labelled [Smartware].

This would be …

[__NAS_all_shares]
  path = /shares
  comment =
  browseable = no
  invalid users =
  valid users = admin
  read list =
  write list = admin
  map read only = no

 You’ll end up with …

[SmartWare]
  path = /DataVolume/backup/SmartWare
  comment = SmartWare share
  public = yes
  browseable = no
  writable = yes
  guest ok = yes
  map read only = no

[__NAS_all_shares]
  path = /shares
  comment =
  browseable = no
  invalid users =
  valid users = admin
  read list =
  write list = admin
  map read only = no

## BEGIN ## sharename = Public #
[Public]
  path = /shares/Public
  comment = Public share
  public = yes
  browseable = yes
  writable = yes
  guest ok = yes
  map read only = no
## END ##

 The share name __NAS_all_shares is hidden and accessible only using the admin login.

If the MBL has not been renamed then once this change is saved (there is no need to reboot the MBL as the change is active immediately the overall_share file is saved) then \\MyBookLive\ __NAS_all_shares gives you access to all the shares under the one share __ NAS_all_shares as folders.

You can simple move files from one folder to the other and the data should not be copied to the computer to then be copied back to the MBL.  Samba should simply move the files and folders directly on the MBL’s disc.

I have this configuration on my own MBL and it does not break the Web UI.  Everything works fine.

Now, it works for me.  If you wish to put this tweak into your own MBL then you understand that you do so at your own risk!