Shares vs. Folders on a linux server with Windows clients

This is my first try at a Ubuntu server (and I'm struggling a bit). I have four Windows clients, two smart TVs, four squeezeboxes of various descriptions and one linux box - none are heavily used concurrently. Hardware-wise it's a older Sempron with a 4TB raid 5. I have a small SSD as a system drive and a bigger RAID array (md0) for data.

So far I've created a share at /dev/md0/data. Should I continue to create shares under /data for /public, /music, /videos, /user1, /user2, etc. or can I simply use Windows to add these as folders?

I also want to start backing up the various machines on the network using Windows File History. Should I set up shares (or folders) for each machine?

Thanks for any advice. Including 'you can't get there from here' if my half-baked plan isn't feasible.

Posted Feb 1, 2019, 8:21 PM UTC

2219

So far I've created a share at /dev/md0/data.

I assume you've mounted /dev/md0 somewhere like /mnt/storage and created a data folder there?

Should I continue to create shares under /data for /public, /music, /videos, /user1, /user2, etc. or can I simply use Windows to add these as folders?

This is probably a matter of preference, but the simplest solution would be to just mount the \\server\data share as a drive letter in Windows and start creating folders within that.

I also want to start backing up the various machines on the network using Windows File History.

WFH is okay, but I recommend looking at a more robust solution if you're serious about backups. I recommend Veeam Agent for Windows, which is free. You can even do bare-metal restores if your machine's hard drive dies.

Should I set up shares (or folders) for each machine?

When you point Windows File History to a drive, it will create a folder structure like F:\FileHistory\%USERNAME%\%COMPUTERNAME%. Veeam Agent will create F:\VeeamBackup\Backup Job %COMPUTERNAME%.

Including 'you can't get there from here' if my half-baked plan isn't feasible.

This sounds feasible. I think you're on the right track.

9
bigtipsOP•

Thanks for the informative reply (I'm still parsing some if it :). Like I said, I'm very new at this and still struggling. (How on earth do you linux guys remember all those cli commands?)

I assume you've mounted /dev/md0 somewhere like /mnt/storage and created a data folder there?

I did not, and it sounds like I missed something pretty basic. Is using /mnt/storage as a mount point important?

 $ df 

shows, along with others including sda the system drive

 dev/md0 <mounted on> /data.

Please correct me - I was thinking that when I get up the nerve to edit the config files and restart Samba, I will have a share called //server_name/data that points to /dev/md0/data.

4

How on earth do you linux guys remember all those cli commands?

We don't. The simple stuff sticks but the rest is usually a lot of consulting the manual or Google.

I did not, and it sounds like I missed something pretty basic. Is using /mnt/storage as a mount point important?

Yes, you need to use a mount point.

  • Everything under /dev is a raw device. The kernel doesn't know what to do with it yet.
  • Devices get formatted with a file system (see mkfs) and then get mounted somewhere (see mount).
  • The traditional place to mount devices that aren't the system disk is under /mnt.

shows, along with others including sda the system drive dev/md0 <mounted on> /data.

Right, so you do have /dev/md0 mounted as /data then, that's good.

There's nothing wrong with that setup, except that you should just avoid mounting in the root directory.

I will have a share called //server_name/data that points to /dev/md0/data.

No you'll just point the path value of the Samba share to /data.

[data]
comment = Data
path = /data
read only = No
guest ok = No

​

5
bigtipsOP•

I'll chew on that for a bit. If I'm reading correctly, I should change

/dev/md0/data

to

/dev/md0/mnt/data <where I build my storage hierachy>

to follow convention, and go from there.

If you don't mind, how would you set this all up? If I'm asking too much, apologies. It almost seems like meeting an MD at a party and asking for a consultation there and then.

In any case, thanks again for the help.

2
ngoonee•

No, /data is the path, which points to the device /dev/md0

Anything under /dev is a device, and can't be directly manipulated. So you'd have /dev/sda for your first (a) scsi disk for example.

Every device must be mounted on a path. In your case that path is /data

This is what you use to access the files on the device. Just "/data" alone, which is technically a folder named data under the root of your filesystem.

5
zackyd665•

Set your share to /data since that is where you mounted the drive

Outside of mounting or fstab you shouldn't be pointing anything at /dev stuff

2
bigtipsOP•

It's finally making some sense. Many thanks. I added a few folders under /data and mapped to them successfully. I did have some struggles but got there in the end.

The biggest time sink was a windows "access denied" and wanting network credentials. Turns out I had no users defined for Samba (that was 3 hours).

1
oishishou•

How on earth do you linux guys remember all those cli commands?

Recent studies into the brains of programmers show programming languages aren't much different from normal human languages. They use that part of the brain, mostly. So, just like learning a second language, it takes studying, exposure, and time. If you use it all the time, you will learn it quicker, if you don't... you won't. Also, you'll only really remember the stuff you actually use regularly, just like normal language. We invented programming languages to "talk" to machines, since they can only understand 1's and 0's, and we can't really.

For me, I've been using CLI for about 13 years. I still use manuals and guides on a regular basis, but I'm much quicker than I used to be, just as if you were to look up a word in the dictionary you couldn't remember how to spell. If you really want to learn, just keep at it, and try to play around with the command line every day, even if you just log on and check updates, or move around files, or check the status of something. It builds familiarity, and one day, you'll just be comfortable.

5
bigtipsOP•

Interesting, thanks for the reply.

2
CakeDay--Bot•

Hey just noticed.. it's your 6th Cakeday bigtips! ^(hug)

1

Also, happy cake day!

2
bigtipsOP•

thank you (I think).

2
ClintE1956•

I create simple shares with appropriate security on the unraid server and map a few drive letters to them on the windoze boxes. I think those shares are pretty much the same as straight ubuntu shares, just a bit easier to manage through unraid web console.

Trying to move to mostly vm's for general use, and back those up on a schedule. Wife is quite amenable to all this, especially when a vm goes down due to garbage installed or whatever, and she likes how quickly I can restore one for her.

1
bigtipsOP•

I create simple shares with appropriate security on the unraid server...

you left me in the dust there. I'm struggling to remember simple terminal commands.

1
ClintE1956•

You probably know more about commands in Linux than I do. It's almost too easy to set up shares in UnRaid with their browser-based management console.

2
[deleted]•

[deleted]

1
[deleted]•

[deleted]

1