NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
b1jzcbx
Apr 06, 2022Tutor
ssh and scp certs
Hey folks, I'm trying to migrate all my data from my old qnap to my readynas. I have a ton of very important folders with movies and also personal data (about 4TB worth of stuff), and considerin...
b1jzcbx
Apr 07, 2022Tutor
thanks for the reply.
So, if you don't mind, what do you mean by "be aware that shares are BTRFS subvolumes, not simple directories" ?
why should i be concerned about that? are you suggesting that if i were to get my certs squared away and perform a simple
"scp /source /destination.." it's not going to copy all the folders and contents? because, yeah.. there are a TON of folders and subfolders..
aside from just old work backups, (which are obviously most critical), i've got a ton of movies and tv series, and they're all in folders, within folders, etc..
i know about rsync, i was just trying to do it by way of scp because i've gotta set up rsync between the two boxes.. and in my mind it's more of a utility than a command. and i'm trying to learn the command line and the linux folder structure, etc altogether. yes, it's a bit masochistic but it's important to know.
StephenB
Apr 07, 2022Guru - Experienced User
b1jzcbx wrote:
So, if you don't mind, what do you mean by "be aware that shares are BTRFS subvolumes, not simple directories" ?
why should i be concerned about that?
ReadyNAS shares appear to be normal folders in the root of the volume, but they are not.
This doesn't matter if you are copying them to another system, or if you are adding to the shares. But if the ReadyNAS is the destination, and the destination share doesn't already exist on the ReadyNAS, then you need to create the share in the admin web ui before you copy the data. Otherwise you will end up creating an ordinary folder in the root, which can create problems later on.
Subfolders of shares are ordinary folders, so there no issues with them. You just need to be careful about folders in the volume root.
b1jzcbx wrote:
i know about rsync, i was just trying to do it by way of scp because i've gotta set up rsync between the two boxes.. and in my mind it's more of a utility than a command. and i'm trying to learn the command line and the linux folder structure, etc altogether. yes, it's a bit masochistic but it's important to know.
If there's a chance you will want to update the copy later on, then using ReadyNAS rsync backup jobs would probably be a better way tp go. Then you can just re-run the backup jobs, and get an incremental update. Setting up rsync on the ReadyNAS side is very simple, as it is built into the admin web ui.
One disadvantage to using SCP is that you cannot preserve the owner and group of the original files and folders. You can preserve permissions (using -p), but you cannot preserve owner/group.
- ipb_ukApr 07, 2022Aspirant
- StephenBApr 07, 2022Guru - Experienced User
ipb_uk wrote:
A little info.......
https://www.qnap.com/solution/qnap-ext4/en-us/
Synology and Netgear both went with BTRFS, Qnap took a different path. Personally I like the snapshot features of BTRFS.
Anyway, best practice is to create shares instead of folders in the data volume root. Even if the file system was ext, it would still be the best practice (since that's the only way to manage them from the NAS admin ui).
- ipb_ukApr 07, 2022AspirantStephen, I must admit that I took it as read, that he was copying his stuff to a share. As I believe you have to create a share when setting up the box. But it's been a long time since I set up the nas from scratch and memory is a fading thing with me.
- b1jzcbxApr 08, 2022Tutor
regarding the disadvantage of scp with the syncing vs rsync; yes i'm aware that rsync is more efficient with folder updates, as it only updates changes, however i'm also trying to learn the command line better, more than the simple commands such as cd, and ls.
if push comes to shove and i can't get around to it, i'll use rsync or just do a folder copy from my workstation before going to bed, but i'd prefer to do it via scp for the first copy. as i understand it, that will copy all the folder structure as well, so if i copy all my movies and tv shows from my media folder, all the files, folders and subfolders will go along with it. correct?
- StephenBApr 08, 2022Guru - Experienced User
b1jzcbx wrote:
as i understand it, that will copy all the folder structure as well, so if i copy all my movies and tv shows from my media folder, all the files, folders and subfolders will go along with it. correct?
As I tried to say before, you need to create at least one share on the ReadyNAS using the admin web ui. It sounds the main folder for your movies and tv shows is called media on the qnap - so you can give it the same name on the NAS. Then you will see an empty media folder in your volume root with ssh. Personal data is likely in a different main folder, so you'd need to create a share for that as well. You need to do this no matter what copy tool you choose to use.
You can then use SCP (or any other tool) to copy the qnap files to the ReadyNAS. It should copy subfolders, etc. Use -p if you want to preserve permissions (I suggest you do want to do that).
When done, everything in the folder will be owned by root and in the root group (assuming you are logging into ssh as root - which is the normal practice). I don't think you should leave it that way. You can reset the owner/group for all files in the share in the ReadyNAS web ui. Let us know if you need information on how to do that.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!