samba

Media Drive saga continues..

0

A couple of months ago I did something really stupid and installed an OS onto the wrong hard drive (due to sata drives being automatically moved to /dev/sda, and maybe a little stupidity on my part). So after much time wasting and much frustration, I ended up getting another 2TB drive and dumping what files I recovered onto it.

Now that’s all well and good but it appears that I have a fair amount of corruption on the recovered files. As I encounter corrupted files I can note and re-encode them later from their original Blu-ray/DVD sources.

Anyways that isn’t my primary issue at the moment; After I duplicated the recovered files off the original NTFS drive I wiped it and reformatted as ext4 so as to ensure I didn’t encounter issues with the linux implementation of NTFS (nfts-3g) – which I have encountered before. So that went smoothly, I Rsync’d the files back from the media PC (where I installed the new drive) and shared it in SAMBA. All of which happened relatively smoothly, which is strange for me, and I was finished by the next day.

Problem.

After a while I noticed that a transfer from the SAMBA share would never successfully complete and would seem to fail at random times (but usually the same place). I assume this has something to do with the corrupt files that occupy the drive but since I have no real fool proof way of figuring out which are corrupt and which aren’t (codecs are pretty damn good at guessing and the rebuilding pieces on the fly) , I’m stuck in a bit of a bind.

In the end I decided to reformat the EXT drive as XFS owing to its great track record in delivering media files and handling big HDD sizes. Luckily, IPFire has an addon for XFS support and even includes tools to make the XFS filesystem and make an XFS partition.

As I type, i’m running Rsync on the router, copying the files of the media-pc (it does take a while copying 1.6TB of data =D) over to the newly created XFS drive.

That all for now, hopefully this works and I can report on the performance figures of the XFS file system and if it solved my problems.

Later.

Windows – Linux Networking

0

So a few weeks ago I installed IPFire on my router primarily to enable me to put in an NTFS drive and share it via SAMBA.

I’ve only now got around to actually measuring how fast it actually transfers; not so good.

But first I did an IPerf test to check my actual throughput, with interesting results:

When the Router was Client I got 476Mbps or 59.5MB/s
Now with my Windows 7 machine as the client I got 268Mbps or 33.5MB/s

There’s something weird going on there.

Anyway on to the SAMBA results:

Source of file: /tmp (ext4 drive)

Router -> Desktop I got 20-21MB/s
Desktop -> Router I got 15-17 MB/s

Source of file:  /mnt/media (ntfs drive)

Router -> Desktop I got 15 MB/s
Desktop -> Router I got 8-9 MB/s

Funny thing about all this: I have no idea what conclusions I can draw from the data provided. It appears that the slowest transfer occurs when I try copying a file from my desktop machine to the media drive on the router. Why? Not a clue. It really doesn’t make much sense to me. Possibly it’s the NTFS driver, maybe the HDD has something wrong, perhaps the mount point isn’t configured right.
One thing I can be sure of is that the problem happens primarily when transferring from my desktop machine, to the router. Guess it’s gonna be trial and error

Samba on IPFire

0

As I have previously mentioned, IPFire supports addons by way of package manager, Pakfire.

One of the many addons you can get, is Samba. Now since I’ve got my media drive working in the new setup, I needed a way of sharing the data across my network (all windows based machines).

So after I installed samba, you get a new entry “Samba” on the side-bar of the Pakfire page, not sure why they put it there but whatever.

After much research and tinkering I found the best settings were essentially what you are given as the default but with a few tweaks.

I set “Security” to User and Map to Guest to “Bad User”. Also, as the router is essentially the server, I enabled Local Master and Preferred Master; hopefully that means that Samba will take charge of resolving Netbios names and means (I guess) less traffic.

And these are the setting for the share:

[media]
path = /mnt/media
comment = Media Drive
browseable = yes
writeable = yes
create mask = 0777
directory mask = 0777
public = yes
read only = no

Now this will allow for essentially anyone to read/write the share, which is a mega security risk normally, but considering this is a home network, it’s function over security and I’m not too worried about hackers watching my Harry Potter rips =D.

On top of this share, I also have another share I need to make for backups.

For this one, I made a new samba user. Now you could either do it the long way in the shell (useradd [user] -p [pass], then smbpasswd -a [user]), or just use the great little web interface they give you.

So I made up a new user ‘backups’ and gave it a password.

Then I used the following settings for the share

[backups]
path = /var/backups
browseable = yes
writeable = yes
create mask = 700 – ensures the files created are owned by its’ owner (backups)
directory mask = 0700 – ensures the directories created are owned by its’ owner (backups )
force user = backups ensures all files/folders created will be owned by ‘backups’
valid users = backups – finally, locks the share to only one account

Now i’m sure I don’t need all of those options, for example, it seems rather redundant to limit the share to the backups user when only backups can read/write anyway, but until I can see a reason why not to, I will err on the side of caution.

Note: the unix permissions will first need to be set on the target folder (/var/backups/ in this case). For example I did chgrp -R backups /var/backups to assign the folder to the backups group. And also you will want to change the file permissions to ensure no one else can access the folder, so chmod -R 700 /var/backups will give you read/write permissions only for the backups user.

When it comes to Samba, remember that it cannot override UNIX permissions, so its best to sort them out first. Oh and btw the user backups is a member of the samba user group, so if you give group permissions, I’m pretty sure that you would be essentially giving samba rights to deal with permissions on it’s own terms. Not a good thing imo.

Go to Top