Mount CIFS on FreeNas to save Data on WinPC

Status
Not open for further replies.

Glon

Cadet
Joined
Oct 17, 2012
Messages
5
Hey,

i was looking for a way to save the files on my laptop automatically to the NAS.

I want to set up a cron job which checks whether there is the laptop is in the network and then save
the data form the cifs sharing of the laptop to the NAS.

My problem is to mount the CIFS to FreeNAS. First i tried to make a new folder as mount point

Code:
mdir /mnt/cifs


but it says

Code:
Can't open /dev/fd0: No such file or directory
Cannot initialize 'A:'


so i tried to mount the share to /mnt/existingCIFSShare/mountPoint

Code:
$ mount_smbfs -W WORKGROUP //myWindosUserName@MyServer/SharedFolder /mnt/existingCIFSShare/mountPoint


it asks me to type in my password and i typed in my windows user password, but then the NAS crashed - only power off helped.

Any idea what i could do? Especially what "Can't open /dev/fd0: No such file or directory; Cannot initialize 'A:'" means?
Thank You:)​
 

Stephens

Patron
Joined
Jun 19, 2012
Messages
496
Why are you pulling instead of pushing? Why not just make a share on FreeNAS that you have access to from your Windows laptop and schedule an event on the laptop that copies what you want copied to the NAS. I do it by using WinRAR to create an archive of the stuff I want backed up (you can create a filename like Laptop_BKUP_yymmdd), then copying that file to the NAS. This can all be done on the laptop with a batch (*.bat) file.
 

Glon

Cadet
Joined
Oct 17, 2012
Messages
5
Why are you pulling instead of pushing? Why not just make a share on FreeNAS that you have access to from your Windows laptop and schedule an event on the laptop that copies what you want copied to the NAS. I do it by using WinRAR to create an archive of the stuff I want backed up (you can create a filename like Laptop_BKUP_yymmdd), then copying that file to the NAS. This can all be done on the laptop with a batch (*.bat) file.

the problem is, then the laptop boots it wakes up the NAS. It takes a while till the NAS is also booted and so i cant perform a copy action to the NAS in a windows-start batch and i don't want to start this batch manually, because it should work not only for my laptop...
 

Stephens

Patron
Joined
Jun 19, 2012
Messages
496
In my experience, the normal way to backup to a server is to push to the server, not have the server grabbing data from clients. My "solution" was based on the scenario outlined. If you give a more complete scenario, I'll give a more complete solution, but it'll still be based on pushing. You're trying to do customizations to FreeNAS that will probably have to be redone everytime you upgrade. I realize I'm not answering your question, but I'd ask you to consider pushing backups from client to server.

A few questions:
- How many client computers are there?
- You mention the laptop "wakes up" the NAS when it boots. How do you do this?
- What time of day do you want the backups to occur?
- Do you turn off the laptop(s) or put it/them to sleep?

You absolutely can have a batch file on the laptop check for the existence of a share and loop until it's available (wait for the NAS)... then do your copy. In fact, as a quick test, I just went to the Win7 command line and typed "if exist \\freenas\backups echo yes" while my NAS was down and it didn't echo anything. Then I booted the NAS and it echoed "yes". So that'd take care of that.
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
the problem is, then the laptop boots it wakes up the NAS. It takes a while till the NAS is also booted and so i cant perform a copy action to the NAS in a windows-start batch and i don't want to start this batch manually, because it should work not only for my laptop...

Your "windows-start batch" can fork off the actual copy command (ie. another batch script, started with the "start" command) so that Windows doesn't stall while it waits for the copy to complete.
 

Glon

Cadet
Joined
Oct 17, 2012
Messages
5
You absolutely can have a batch file on the laptop check for the existence of a share and loop until it's available (wait for the NAS)... then do your copy. In fact, as a quick test, I just went to the Win7 command line and typed "if exist \\freenas\backups echo yes" while my NAS was down and it didn't echo anything. Then I booted the NAS and it echoed "yes". So that'd take care of that.

this is a good idea! thank you ;)

i wake up the NAS by an application called wol.exe (fund it somewhere)

Code:
C:\wolcmd.exe MAC_ADRESS IP_ADRESS SUBNETMASK


now i think i will let this batch script test whether the NAS is ready and then push the content or then not sleep a while and test again.
 
Status
Not open for further replies.
Top