General NAS-Central Forums

Welcome to the NAS community
It is currently Mon Jan 22, 2018 12:28 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Tue Dec 12, 2017 10:40 am 
Offline

Joined: Fri Oct 21, 2016 1:12 pm
Posts: 31
Hello,

I am trying to move any file from a folder in the nas326 to another folder in the nas326 in windows 7. For some reason the move process is really slow! It needs to copy the file first at a rate of about 4MB/sec and then delete it from the source folder.

If I do this with SSH and midnight commander the move process is instant, no copy and then delete, just move, as it should be for a move process.

How can I do this in windows? Do I need to mess with the smb.conf file and if so can this be done since the smb.conf is created at boot time from firmware?

Thank you


Top
 Profile  
 
PostPosted: Tue Dec 12, 2017 6:44 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6127
With different folders you mean different shares, I guess?

You are facing a limitation of SMB. In SMB each share is a separate 'filesystem', and there is no move command to move a file from one share to another. So the only option the client has is to down- and upload the file.

There is a way, however. There is some underlying share, called 'Volume 1', or something like that. Only admin can open it. It contains all shares on that volume, so within that share you can do your move fast.


Top
 Profile  
 
PostPosted: Wed Dec 13, 2017 9:01 am 
Offline

Joined: Fri Oct 21, 2016 1:12 pm
Posts: 31
Wow man, spot on! I've been trying to communicate this problem over at homeforum.zyxel.com with another guy and it's taking ages, but you are the real expert here, you discovered the problem so fast!

I was trying to move files between //nas326/admin/!torrents/ and //nas326/hd1/Tv Shows/. If I move them within the same share everything happens in an instant.

So how do I find this Volume1 share? I am trying to access it from within windows using //nas326/Volume1/ but it shows nothing exists there. I cannot create a //nas326/Volume1/ as the web interface will let you add shares after that path, not only including "/Volume1".

How can I create this share? Do I need to edit smb.conf? How can I do this since the smb.conf is firmware generated at boot?


Top
 Profile  
 
PostPosted: Wed Dec 13, 2017 1:27 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6127
You have to enable it in Desktop->Control Panel->Privilege and sharing->Shared folders.


Top
 Profile  
 
PostPosted: Wed Dec 13, 2017 5:56 pm 
Offline

Joined: Fri Oct 21, 2016 1:12 pm
Posts: 31
Sorry man, maybe I wasn't clear enough. Currently I have the following shares which I have created myself with admin privileges:
//nas326/admin with path /Volume1/admin
//nas326/hd1 with path /Volume1/hd1
//nas326/hd2 with path /Volume2/hd2

When I try to create a new share, it will be added AFTER "/Volume1" path, so if I add a share "Volume1" through the Control Panel you suggest it will become:
//nas326/Volume1 with path /Volume1/Volume1

Of course there is nothing in there because the path is not the root "/Volume1" that we want.

I could probably add it through smb.conf and then reload smbd but how can the change be persistent to reboots?

Thanks


Top
 Profile  
 
PostPosted: Wed Dec 13, 2017 7:45 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6127
It seems my memories are fading aways. The 'underlying share' was available on the NSA series, and apparently not on the newer NAS series. Yet on my '520 a share 'Volume 1' is available, and it works. Looking at the directory listing, I think I created it myself. It's a symlink to the partition.
It's simple:
Code:
cd /i-data/sysvol
ln -s . "Volume 1"
chown admin:everyone "Volume 1"
Now go to the webinterface, enable the share, and give admin access rights.


Top
 Profile  
 
PostPosted: Wed Dec 13, 2017 8:12 pm 
Offline

Joined: Fri Oct 21, 2016 1:12 pm
Posts: 31
Nice workaround. You create a symbolic link to the root folder and then any folder within the "root" is linked to the same filesystem.

One small correction for the nas326. There is no way any folder will be chowned to "admin". It stays root and won't change. I don't know the reason. I even SSHed with username "admin" but no luck.

Also the name doesn't need to be "Volume 1" for this to work. It can be any name.

And a small final correction. After the commands have been typed (except chown, it doesn't matter anyways) you need to reboot the nas or restart smbd, otherwise the share will never appear at the control panel.

Thanks again Mijzelf

PS. Also another question I just noticed. As I was experimenting with symbolic links, there were several shares appearing in Control panel either as "Disabled" or as "Lost". Is it safe to DELETE them or will all of the contents of the hard drive be deleted since they were symbolic links to "." i.e. root?


Top
 Profile  
 
PostPosted: Wed Dec 13, 2017 9:16 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6127
Silly me. Of course you can't chown it this way, it's a symlink. It should be 'chown -h'. But I don't think it actually matters who is the owner of the symlink.

vprasinos wrote:
Also another question I just noticed. As I was experimenting with symbolic links, there were several shares appearing in Control panel either as "Disabled" or as "Lost". Is it safe to DELETE them or will all of the contents of the hard drive be deleted since they were symbolic links to "." i.e. root?

A lost share is a directory which was enabled as share, and since then disappeared. Probably because you deleted the directory manually. I guess it's safe to delete the share.

A disabled share is a directory (or symlink) which is there, but doesn't have a share coupled. Although the webinterface asks if you want to delete the contents or not, I would not use it. Better delete the symlink manually, in that case the share will disappear from the webinterface.


Top
 Profile  
 
PostPosted: Wed Dec 13, 2017 9:26 pm 
Offline

Joined: Fri Oct 21, 2016 1:12 pm
Posts: 31
Quote:
A lost share is a directory which was enabled as share, and since then disappeared. Probably because you deleted the directory manually. I guess it's safe to delete the share.

Let's say Volume 1 is a symlink to "." (basically root folder). Deleting the "Lost" share for example /Volume1/Volume 1/ (mind that you get a prompt to write "DELETE" with capital letters so that the contents of the share all get deleted) will delete everything within /Volume1/root folder or just the symlink?
Quote:
A disabled share is a directory (or symlink) which is there, but doesn't have a share coupled. Although the webinterface asks if you want to delete the contents or not, I would not use it. Better delete the symlink manually, in that case the share will disappear from the webinterface.

Now this is strange. I made a symlink "Volume 1" and then renamed it manually from ssh to "root". Both shares appear in control panel and they both work from windows (although the "Volume 1" symlink does not exist!) even after several reboots so I think the control panel share table does not get its data from the folder structure but from a different database. I can "Disable" the share "Volume 1" and keep only "root" share but the question again is what if I delete the share "Volume 1"? I fear that all contents of root will also be deleted as in the lost share case above. Please advise


Top
 Profile  
 
PostPosted: Thu Dec 14, 2017 6:33 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6127
Quote:
Now this is strange. I made a symlink "Volume 1" and then renamed it manually from ssh to "root". Both shares appear in control panel and they both work from windows (although the "Volume 1" symlink does not exist!) even after several reboots
That means that the firmware dereferences the symlink, I guess. Else 'Volume 1' wouldn't be accessible.
Quote:
so I think the control panel share table does not get its data from the folder structure but from a different database.
That's true. There is a database in /etc/zyxel/ (which is the mountpoint of a flash partition).
Quote:
Please advise
If you don't want to use the delete button, you can try to edit that database in /etc/zyxel/. Don't know if it's binary. The database for users is in plain text, maybe the shares are also in that file.
Another option is to use factory reset. That basically erases that flash partition, which deletes all owner settings.


Top
 Profile  
 
PostPosted: Thu Dec 14, 2017 8:07 pm 
Offline

Joined: Fri Oct 21, 2016 1:12 pm
Posts: 31
Thanks mijzelf, I believe it's working.

The file for the shares is /etc/zyxel/ugs_conf.db and it is in sqlite. I edited with the changes I wanted, rebooted and it seems good so far. All shares are working and the user interface reports the correct ones. Luckily it didn't get deleted from the firmware during reboot.

I will see how it goes when I shutdown and let you know if anything changes.

Thanks again for all your help, you are a real expert!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group