{"componentChunkName":"component---src-templates-blog-post-js","path":"/blog/using-a-linux-server-for-windows-10-backups","result":{"data":{"allGhostPost":{"edges":[{"node":{"title":"Using a Linux Server for Windows 10 Backups","html":"

Windows has a built-in file history backup feature that is very convenient to use. If you have a home server with some storage to spare, it is definitely an option to host backups on. Windows is able to use Samba network shares for storage, so we'll start by setting up a share on the Linux server.

\n

UPDATE 21-Sep-2018 Recent versions of Windows 10 play nicely with recent version of Samba, without having to enable SMBv1 on Windows. Skip that step and just connect to the share!

\n

Set Up the Samba Share on Linux

\n

First, create a directory to hold the backups. Grant your user ownership to it.

\n
sudo mkdir -p /srv/storage/backups/windows/Kamals-PC\nsudo chown kamal:kamal /srv/storage/backups/windows/Kamals-PC\n
\n

Update the apt cache and install Samba.

\n
sudo apt-get update\nsudo apt-get install samba\n
\n

Now let's configure the Samba daemon. Open /etc/samba/smb.conf and edit some of the existing lines as follows (see annotations):

\n
# Make sure workgroup matches your Windows workgroup\nworkgroup = WORKGROUP\n\n# Set this to whatever you want\nserver string = Samba on %h\n\n# Prevent samba from messing with our unix system passwords\nunix password sync = no\n\n# Comment out the following lines\n\n# [printers]\n#    comment = All Printers\n#    browseable = no\n#    path = /var/spool/samba\n#    printable = yes\n#    guest ok = no\n#    read only = yes\n#    create mask = 0700\n# \n# # Windows clients look for this share name as a source of downloadable\n# # printer drivers\n# [print$]\n#    comment = Printer Drivers\n#    path = /var/lib/samba/printers\n#    browseable = yes\n#    read only = yes\n#    guest ok = no\n
\n

Then, add the following to the end of the file. This will configure the actual share. Replace the path and username with your own.

\n
[Kamals-PC Backups]\npath = /srv/storage/backups/windows/Kamals-PC\navailable = yes\nvalid users = kamal\nbrowsable = yes\npublic = no\nwritable = yes\nread only = no\n
\n

For authentication, Samba uses its own password file, so you will need to configure a password for your user. Keep in mind that said user must also be an existing unix user.

\n
sudo smbpasswd -a kamal\n
\n

Finally, restart Samba so that the changes can take effect.

\n
sudo systemctl restart smbd.service\nsudo systemctl restart samba-ad-dc.service\n
\n

We are now all done on the Linux end. Let's switch over to Windows.

\n

Configure the Share on Windows

\n

As of the Windows 10 Creator's Update, the Samba client required is disabled by default. To enable it, search for Turn Windows features on or off and check the Samba client:

\n
\"screenshot\"
\n

Then, you will need to allow Windows to discover the share on the local network. While connected to your home network, open Settings and go into Network & Internet.

\n
\"screenshot\"
\n

Click on Change connection properties and set your network to Private.

\n
\"screenshot\"
\n

Go back to the Network & Internet page, scroll down to Sharing options and click on it. Make sure network discovery is turned on.

\n
\"screenshot\"
\n

Now, verify that Windows can access the share. Open File Explorer and browse to the Network page in the sidebar. You should see your server there at the top. It might take a couple of seconds to show up.

\n

Double click on it. If you are able to access it using your username and password configured previously, you can skip the next step. Otherwise, you will need to manually configure the login credentials. (source)

\n

Open the Credential Manager program and select Windows Credentials. Click on Add a Windows credentials to add your login info for the Samba share.

\n
\"screenshot\"
\n

Enter your server's hostname in all caps and fill in your login details. Click OK and close Credential Manager.

\n
\"screenshot\"
\n

After performing these steps, go back to the Network page and try to browse to your share. You should now be able to browse into it. Create or copy a file to make sure that it works properly.

\n

Now, let's configure Windows to use the share for backups. Open Backup Settings and click on Add a drive. The list should be empty, so click on Show All Network Locations. Your share should now appear. Click on it, and you are all set.

\n
\"screenshot\"
\n

In the More options page, you will be able to adjust backup frequency, deletion policy, and other settings. You might want to exclude any cloud storage such as Dropbox, OneDrive, iCloud Drive, etc. since these are already reliable in terms of data redundancy.

\n","published_at":"2017-12-20T19:53:39.000+02:00","slug":"using-a-linux-server-for-windows-10-backups","tags":[],"plaintext":"Windows has a built-in file history backup feature that is very convenient to\nuse. If you have a home server with some storage to spare, it is definitely an\noption to host backups on. Windows is able to use Samba network shares for\nstorage, so we'll start by setting up a share on the Linux server.\n\nUPDATE 21-Sep-2018 Recent versions of Windows 10 play nicely with recent\nversion of Samba, without having to enable SMBv1 on Windows. Skip that step and\njust connect to the share!\n\nSet Up the Samba Share on Linux\nFirst, create a directory to hold the backups. Grant your user ownership to it.\n\nsudo mkdir -p /srv/storage/backups/windows/Kamals-PC\nsudo chown kamal:kamal /srv/storage/backups/windows/Kamals-PC\n\n\nUpdate the apt cache and install Samba.\n\nsudo apt-get update\nsudo apt-get install samba\n\n\nNow let's configure the Samba daemon. Open /etc/samba/smb.conf and edit some of\nthe existing lines as follows (see annotations):\n\n# Make sure workgroup matches your Windows workgroup\nworkgroup = WORKGROUP\n\n# Set this to whatever you want\nserver string = Samba on %h\n\n# Prevent samba from messing with our unix system passwords\nunix password sync = no\n\n# Comment out the following lines\n\n# [printers]\n# comment = All Printers\n# browseable = no\n# path = /var/spool/samba\n# printable = yes\n# guest ok = no\n# read only = yes\n# create mask = 0700\n# \n# # Windows clients look for this share name as a source of downloadable\n# # printer drivers\n# [print$]\n# comment = Printer Drivers\n# path = /var/lib/samba/printers\n# browseable = yes\n# read only = yes\n# guest ok = no\n\n\nThen, add the following to the end of the file. This will configure the actual\nshare. Replace the path and username with your own.\n\n[Kamals-PC Backups]\npath = /srv/storage/backups/windows/Kamals-PC\navailable = yes\nvalid users = kamal\nbrowsable = yes\npublic = no\nwritable = yes\nread only = no\n\n\nFor authentication, Samba uses its own password file, so you will need to\nconfigure a password for your user. Keep in mind that said user must also be an\nexisting unix user.\n\nsudo smbpasswd -a kamal\n\n\nFinally, restart Samba so that the changes can take effect.\n\nsudo systemctl restart smbd.service\nsudo systemctl restart samba-ad-dc.service\n\n\nWe are now all done on the Linux end. Let's switch over to Windows.\n\nConfigure the Share on Windows\nAs of the Windows 10 Creator's Update, the Samba client required is disabled by\ndefault. To enable it, search for Turn Windows features on or off and check the\nSamba client:\n\nThen, you will need to allow Windows to discover the share on the local network.\nWhile connected to your home network, open Settings and go into Network &\nInternet.\n\nClick on Change connection properties and set your network to Private.\n\nGo back to the Network & Internet page, scroll down to Sharing options and\nclick on it. Make sure network discovery is turned on.\n\nNow, verify that Windows can access the share. Open File Explorer and browse to\nthe Network page in the sidebar. You should see your server there at the top.\nIt might take a couple of seconds to show up.\n\nDouble click on it. If you are able to access it using your username and\npassword configured previously, you can skip the next step. Otherwise, you will\nneed to manually configure the login credentials. (source\n[https://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_web-insiderplat_pc/fix-windows-10-and-network-share-problems/f9b6d62d-839f-49a4-8fe9-7becc01aa911?auth=1]\n)\n\nOpen the Credential Manager program and select Windows Credentials. Click on \nAdd a Windows credentials to add your login info for the Samba share.\n\nEnter your server's hostname in all caps and fill in your login details. Click \nOK and close Credential Manager.\n\nAfter performing these steps, go back to the Network page and try to browse to\nyour share. You should now be able to browse into it. Create or copy a file to\nmake sure that it works properly.\n\nNow, let's configure Windows to use the share for backups. Open Backup Settings \nand click on Add a drive. The list should be empty, so click on Show All Network\nLocations. Your share should now appear. Click on it, and you are all set.\n\nIn the More options page, you will be able to adjust backup frequency, deletion\npolicy, and other settings. You might want to exclude any cloud storage such as\nDropbox, OneDrive, iCloud Drive, etc. since these are already reliable in terms\nof data redundancy.","meta_description":null}}]}},"pageContext":{"slug":"using-a-linux-server-for-windows-10-backups","prev":"exporting-email-threads-from-gmail-into-csv-file","next":"delegating-a-subdomain-to-he-dns-for-ddns"}},"staticQueryHashes":["3649515864"]}