Friday, August 15, 2014

Backup thoughts, hard won from recent experience.

Time machine is cool when it works.

When it does not though it is not so cool. 

Same goes for windows backup and rdiff-backup to another disk.

But! If the backup disk (or sparsebundle) is directly mounted on the machine that is doing the backup...  what if there is some hickup in your filesystem code somehow while the backup disk is mounted...? BOOM! goes your system disk AND backup.

This is exactly what happened recently with my wife's MacBook Pro. It appears that the machine had a crash somehow going to sleep while doing a backup to the NetATalk share on my home linux server. The system partition was irrecoverably corrupted and so was the sparsebundle containing time machine. (After cloning the system drive with dd) I ended up having to reinstall OSX and restore the profiles from a backup of the server, then recover some of the more recent files from the system drive image using DiskWarrior.  

I am rebuilding the home server real soon now (the new HDD is backordered and now I am on call until next weekend). I was already planning to set up a complex set of btrfs subvolumes, so now the plan is to have the TimeMachine NetATalk shares be subvolumes with frequent snapshots so that previous snapshots are out of scope of the machine doing the backing up. Likewise with the smb shares that 2 windows machines are backing up onto.

So the server's subvolumes are like so:

root (and snapshots)
home (and snapshots)
mytimemachine AFP (and snapshots)
wifestimemachine AFP (and snapshots)
aperturevault AFP (and snapshots)
testWin7Box SMB (and snapshots)
worklaptop SMB (and snapshots)
persistantshare SMB (and snapshots)
volatileshare SMB (NO Snapshots)


And after several steps, the intirim backup solution for the server itself will be one 2TB disk in   
an eSATA cradle with one main subvolume (and it's snapshots) to which the current version of each of those (except the volatileshare) are rsync'd.

Eventually the plan is to score a gratis small desktop with room for up to 4 drives that can live in another building (we have power line ethernet to it working already) so it can wake on schedule daily, receive the backup via rsync, snapshot the backup, and shut itself down when complete. Thus the server also will not have write access to it's own past backups. Also the uptime of the second server should be minimal (first backup will be done in the house via gigabit LAN) and thus power consumption as well.    

Wednesday, July 25, 2012

Create a roaming profile user from the command line

Use this to create a roaming profile user named potato with password potatopass

samba-tool user create potato potatopass --profile-path='\\testdc\profiles\potato'

Tuesday, July 24, 2012

Update....

I am currently working on a new version of the script that does the directory setup for roaming profiles and folder redirection, but it's not yet ready to share.

Saturday, July 21, 2012

BTRFS mirroring on root

If you have set up your system with btrfs mirroring for the root drive (ie by booting into the rescue environment on the installer, making the FS, then booting the installer, telling it to use one of the btrfs partitions as btrfs but not format... then when done doing a grub-install onto the other drives)...

If you lose a drive (on purpose or otherwise)...

When you reboot the first time if you have not replaced the drive you need to edit the kernel command line so that it says "rootflags=degraded,subvolid=@", not "rootflags=subvolid=@,degraded"...

Also, if you're testing by yanking the sata cables, re-adding, rebalanceing, removing the failed drive-id, etc over and over without rebooting, it will get to a point where all the data lives on only one drive without a mirror. If you reboot and rebalance again and remove any missing drive it should fix it.

(meta blog post) What is Cultek.com?

I see a few people (possibly from Russia) have been visiting by following a link from Cultek.com , which appears to be a members-only site... What is Cultek.com? Are you discussing this project internally?

Thursday, July 19, 2012

Updated Quick and Dirty Samba4 DC instructions

Made apparmor allow the specific libraries that bind9 needs, rather than any libraries under the samba heirarchy.


Monday, July 16, 2012

First version of the quick and dirty Samba4 Domain Controller Setup


Note that this requires the router to be configured to handle DHCP, passing the domain controller as primary DNS and WINS (see my earlier entry on router config).

For some reason it took doing an nslookup of testdc.testdomain.local at the command line on  the win7 box before the domain join worked... I will investigate why...