Custom Samba Sizing

After reorganizing my ZFS datasets a bit, I suddenly noted I couldn’t copy any file larger than a few MB. A bit of investigation later and I figured why it was so.

My ZFS data sets were as follows:

zfs list
 NAME                            USED  AVAIL  REFER  MOUNTPOINT
 Data                           2.06T   965G    96K  none
 Data/Users                      181G   965G    96K  none
 Data/Users/User1               44.3G  19.7G  2.23G  /Data/Users/User1
 Data/Users/User2               14.7G  49.3G   264K  /Data/Users/User2
 Data/Users/User3                224K  64.0G    96K  /Data/Users/User3

And my Samba share was pointing to /Data/Users/.

Guess what? Path /Data/Users was not pointing to any dataset as my parent dataset for Data/Users was not mounted. Instead it pointed to memory disk md0 which had just a few MB free. Samba doesn’t check full path for disk size but only its root share.

The easiest way to workaround this would be to simply mount parent dataset. But why go for easy?

A bit more complicated solution is getting Samba to use custom script to determine free space. We can then use this script to return available disk space for our parent dataset instead of built-in samba calculation.

To do this, we first create script /myScripts/sambaDiskFree:

#!/bin/sh
DATASET=`pwd | cut -c2-`
zfs list -H -p -o available,used $DATASET | awk '{print $1+$2 " " $1}'

This script will check current directory, map its name to dataset (in my case it is as easy as stripping first slash character) and return two numbers. First is total disk space, followed by available diskspace - both in bytes.

Once script is saved and marked as executable (chmod +x), we just need to reference it in Services > CIFS/SMB > Settings under Additional parameters:

dfree command = /myScripts/sambaDiskFree

This will tell Samba to use our script for disk space determinations.

Seattle Code Camp 2017

Illustration

If all went as expected, my fourth visit to Seattle Code Camp is currently in progress and my second talk is winding down just about now. If you decided to see me talk among more than 70 talks in 11 parallel tracks - thank you!

If not, here is what you missed:

My first talk was about my experience with Microsoft’s project Centennial, a way to Windows Store for classic desktop applications. It was based on my experience with getting Bimil to Windows Store.

Second talk is a bit of copout as it is rerun of my talk from last year. And no, it is not completely the same. I added a bit more ranting. :)

Slides are available for download but they won’t be substitute for attending conference.

Easier Certificate Access in Chrome

Illustration

One of the rare reasons I have for occasionally using Internet Explorer is actually to view HTTPS certificate. In Internet Explorer accessing certificate is as easy as clicking on the lock icon. It used to be like that in Chrome too. And then some smartass decided to move setting in Developer Tools behind zillion mouse clicks.

However, since Chrome 60, Google has silently returned option to view certificate under its lock icon. To enable it, one has to navigate to chrome://flags/#show-cert-link and enable Show certificate link option. Quick restart later and option to view certificate is present at its natural place once again.

Why the heck is this not default, I have no idea.

ReFS No Longer in Windows 10 Pro

I love copy-on-write file systems and ZFS always loved me back. With ReFS story was a bit more tangled as something always stood between us. Be it requirement for registry hacks, be it idiotic decision that integrity streams are not supported for virtual disks, be it lack of boot support (even when using it only for data), or be it just general slowness and opaqueness of its development. Despite all those issues, I have used it for all data on my Windows computers since 2015.

Well, I guess that is history now. With the advent of Windows Pro for Workstations, ReFS is gone from all lower editions - including Windows 10 Pro.

I’ll shed a tear while formatting my disk to NTFS; and dream of ZFS…

PS: No, even more than 5 years of its creation, ReFS is still not bootable. PPS: Yes, I am aware that read/write will still be supported even in Windows 10 Home. Not good enough for me.

Bimil 2.10

Illustration

For this version the main focus was on improving auto-type - both interface and discoverability. Hopefully, this will get more people to use and abuse this feature for login automation.

One surely controversial change is that entries are now editable by default. The most common complaint by new users was about the extra step needed to actually change anything. For those who prefer it that way (e.g. me), option to have entries in read-only mode until Edit button is pressed is still there in Options dialog.

Additionally, some minor bug fixes and interface adjustments were made but nothing to write home about. :)

You can download the new version either from application itself, from web page, or, for the first time ever, from Windows Store.

PS: Windows Store version doesn’t allow for credit-card information storage due to Microsoft’s policies.