Archive | Linux RSS feed for this section

Ubuntu Network Drive w/ USB External Drives

27 Mar

After installing a server at work with Linux Mint Helena, I needed to set up a large drive to store our work files. Our last drive crashed, causing us to loose months of work, and giving us seemingly endless headaches.

Solution

Buy two large USB External drives. One is to share to the network, and one is to be used as a nightly backup using unison. As of this posting 1 Terabyte drives cost $100 at Walmart, so you will spend $200 for a complete 1TB network storage solution.

You can not simply plug in and share these drives and expect it to work. Here are a few problems I ran into :

Plug in the drives, partition them, mount them using the Disk Utility program. Create a folder in each drive called “Work” or something fitting. The disk you wish to have as the source, or share point, you can simply right click and choose Sharing Options. Check all three boxes and modify the share.

Once you try to connect to this share you will get this error :

Unable to mount Location: Failed to mount Windows Share

and possably in the logs :

smbd/service.c:make_connection_snum(1077)'/media/usb_Drive/my_share_folder' does not exist or permission denied when connecting to [work] Error was Permission denied

or


param/loadparm.c:9783(widelinks_warning)
Share 'my_share' has wide links and unix extensions enabled. These parameters are incompatible. Wide links will be disabled for this share.

You will need to force samba to access the share under the username it was mounted with. You may also need to place some extra configuration to avoid the Wide Links and Unix Extensions conflict.

in the /etc/samba/smb.conf, under the [global] directive add :

force user = your_login

wide links = yes

unix extensions = no

Restart samba, and the share should be working. If not, then look at your samba log files.

Now you need to mirror that drive with Unison to ensure no loss of data in a catastrophic drive failure. Copy your shared folder to the mirror drive, then install and run unison :

sudo apt-get install unison

Let a nightly Cron to synch:

/usr/bin/unison -auto -silent /media/usb-source-drive/my-share-folder/ /media/usb-mirror-drive/my-share-folder/

You should now have a network drive backed up nightly.