Search This Blog

Tuesday, December 27, 2011

Apple TimeMachine backup to Ubuntu 11.10 over network

Time Capsule is a great way to backup your MacBook over the network.  But at $500 for the 3 terabyte version, why spend the money when you have an Ubuntu 11.10 media server with 6 TB of storage and an Airport Extreme base station (which is 1 of the 2 things the Time Capsule accomplishes)?  It does take a little bit of configuration to get it running, so here goes:


1) In the terminal, install netatalk so that your Ubuntu machine will communicate via AppleTalk.  While you're there, make sure that avahi-daemon is installed (it is by default on 11.10):
sudo apt-get install netatalk avahi-daemon

2)  Now edit the afpd config file (AppleTalk Filing Protocol) so we can communicate with the directory properly over the network.  To see a description of each option, view the afpd website or "man afpd" in terminal:
sudo gedit /etc/netatalk/afpd.conf
Add this to the bottom of the file:
- -tcp -noddp -uamlist uams_guest.so,uams_dhx.so,uams_dhx2.so -n

3) Create the directory for you TimeMachine backups:
mkdir /dir/dir/YourBackup/Folder
I chose /media/Backups/macbook/TimeMachine

4) Edit the permissions for that folder so that everyone can have read/write access.

5) Edit the netatalk AppleVolumes.default file to point to your directory:
sudo gedit /etc/netatalk/AppleVolumes.default 
/media/Backups/macbook/TimeMachine "TimeMachine" cnidscheme:dbd options:usedots,tm,upriv
The "tm" enables for TimeMachine use.  This page details all the options for AppleVolumes.default

6) Tell the avahi daemon to broadcast AppleTalk over the network:
sudo gedit /etc/avahi/services/afpd.service
This will open an empty (hopefully) file.
Enter the following, save, and close:
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">%h</name>
  <service>
    <type>_afpovertcp._tcp</type>
    <port>548</port>
  </service>
  <service>
    <type>_device-info._tcp</type>
    <port>0</port>
    <txt-record>model=Xserve</txt-record>
  </service>
</service-group>

7) Restart the services to read in the new config files:
service netatalk restart
service avahi-deamon restart

8) In order to not fill all of the hard drive space on the Ubuntu server with MacBook backups, create a disk image from OS X:
Disk Utility > New Image
Create whatever size image you'd like.  This will look like an external hard drive to TimeMachine, which it will fill until it is out of space, and then start replacing the oldest data first.
Save this to your networked folder on the Ubuntu server (/media/Backups/macbook/TimeMachine/backup.dmg)

9) On the Mac, select the Go menu > Connect to Folder > Browse > TimeMachine

10) Enable TimeMachine and see if that drive is available.  If not, I found this small hack for OS X on engadget.com:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
Enter that into your terminal and try again.

Sunday, December 25, 2011

Saturday, May 28, 2011

Wednesday, April 27, 2011

Troy's 3rd Birthday

I'm on leave in Henderson for Troy's 3rd birthday (24th)! Can't believe how quickly time has flown and how grown up he is getting. 

I've posted some pictures on Picasa of his party at my parents' house.
Troy playing in his new pool

Thursday, April 21, 2011

Removing extra OS X partitions (and troubleshooting)

I recently ran into a problem regarding partitions on my MacBook Aluminum. Originally I dual-booted OS X and Linux (Ubuntu), which means that there were 4 partitions on the hard drive. I was using rEFIt as the initial boot manager, and then once the Linux option was selected, it would go into GRUB for me to select from the normal menu. I know what 2 of the partitions are (Linux filesystem and swap space), but I don't know what the 3rd partition is (FAT 511.7MB in size)... possibly a share that I set up between OS X and Ubuntu back in the day.

At any rate, I now have another laptop that I use solely for Linux, and then the Ubuntu media server... negating my need to dual boot the MacBook. Using the Disk Utility, I erased these 3 extra partitions successfully, but hit the problem while trying to remove them. Once I pressed the "-" to remove 1 partition (any of them), it would go into Verifying disk, get about 10% complete, hang for a while, then come back with the error "Could not modify partition map because filesystem verification failed". This seemed very cryptic, and provided no path forward, only "OK", and the partition remained. After a bit of Googling, I found an article regarding this exact issue that talked about booting from the OS X install DVD and run Disk Utility from there. Since I'm not working on my filesystem partition, but rather one that can be unmounted within OS X, I figured this wasn't required, but decided to give it a shot anyways.

After searching around for my DVD of Snow Leopard, I came up with nothing... probably lost in one of the moves since buying it 3 houses ago...

So I "obtained" a copy, only to find out that it's filesize was obviously for a dual-layer DVD, leading me down this path: tonymacx86 Blog: Fit Mac OS X Snow Leopard on a Single Layer DVD

Great tutorial, except I didn't want to download ShowAllFiles and run it because it is a binary program (ie I can't see the source code), so I don't know what it actually does to the computer other than just show hidden files. Therefore, in Step 2 .1-2, just do this:
1) Open Terminal
2) Type the following: defaults write com.apple.finder AppleShowAllFiles TRUE
3) (enter)
4) And then: killall Finder
5) (enter)

This will show any file with a "." at the beginning of the name, which causes it to be hidden in OS X. At the end of deleting all the unnecessary files, simply repeat the above steps, changing TRUE to FALSE.

...

Back to the troubleshooting.

I have currently booted from the DVD and am in Disk Utility, only to find that the same problem arises. Except this time, it allows me to Repair the volume. Once the volume repaired successfully (with the only red errors showing on the OS X partition, it seems that I could move forward with removing the 3 extraneous partitions. I've attempted to remover "NO NAME" (the FAT partition), with the same error, "Could not modify partition map because filesystem verification failed". So I attempt to remove the aptly named after erasing "blank_01", again, with the same error message. On to "blank_02", same.

Now I go back and select my hard drive (top of the list), and Repair Disk again, with the following problems found and corrected:
Macintosh HD:
 Volume bitmap needs minor repair
 Volume header needs minor repair
 ...The volume Macintosh HD was repaired successfully (same thing I got the first time)

NO NAME:
 Phase 1 - Preparing FAT
 Phase 2 - Checking Directories
 Phase 3 - Checking for Orphan Clusters
 57 files, ...
 Updating boot support partitions for the volume as required

blank_01:
 ...The volume blank_01 appears to be OK.

blank_02:
 ...The volume blank_02 appears to be OK.
 Volume repair complete.
 Updating boot support partitions for the volume as required.

Now, this seems odd, NO NAME produced no errors, but it still updated the boot support partitions. blank_01 didn't do anything, and blank_02 said it was OK, but then "Volume repair complete" and then updated the boot support partitions.  Not sure why this is.

I am back at the Partition tab, press the "-", it goes into Verifying disk, moves on to Shrinking disk, and then comes back with Partition failed with the error: The partition cannot be resized. Try reducing the amount of change in the size of the partition.

Now I am fed up with dealing with this.  Most Googling on this specific errors shows that the free space is probably fragmented, and requires the purchase of software to defrag it...  or you can just wipe the entire drive and restore from a backup.  I regularly make backups using SuperDuper, so it sounds like it's time to start erasing...

Saturday, February 26, 2011

Media Server - on a side note

Not anything related with media server building, but just a little tidbit of information for the D-Link DWA-160 wireless 802.11N USB dongle.  Once again, using Ubuntu 10.10.  Follow this guide, mostly, with the exception of download the compat-wireless from here instead of where he says in the tutorial - that is, if you are using the .35 kernel.  Obviously this is not a future-proof blog, so when the linux kernel gets updated to a later version (current is linux-headers-2.6.35-23), you too will need to update where you download from.

Friday, February 18, 2011

Friday, February 4, 2011

USS Texas Submarine Tour

In case you've never been on a modern submarine, this is a tour video the Navy made for their website on board our boat:

http://www.youtube.com/watch?v=YjjVXLRaiw4&feature=youtube_gdata_player