Showing posts with label tc. Show all posts
Showing posts with label tc. Show all posts

Sunday, 22 June 2014

Mounting OSX Time Capsule shared drive on Linux

If you've been trying to mount an OS X Time Capsule disk over the network using Samba/CIFS/SMB and you've recently run into the problem: "mount error(13): Permission denied", and you KNOW the password is right then this may help. Basically you now need to inform Linux CIFS of the specific security mechanism to use (sec=ntlm). E.g. To mount the drive as root (where share_pwd is the password required to access the drive):
# mount -t cifs //server_ip/Data /mnt/Data -opasswd=share_pwd,sec=ntlm

As an alternative it is also possible to use the Netatalk package under Linux to mount the Time Capsule drive using Apple Filesharing Protocol (AFP).

PS: If you were hoping to mount the Time capsule drive that you either had plugged in or removed from inside your Time Capsule see my earlier post.

[28jun14: Updated to clarify that this regarding network mounting]

Thursday, 20 June 2013

Accessing the contents of a Time Capsule disk

So I took my (1st Gen) Time Capsule apart and switched the old 500GB drive for a 3TB drive - which worked in principle. I was impressed that the old thing could handle a 3TB drive ok. The problem that I increasing encountered was that Apple's File Sharing (AFP) server kept crashing - which basically meant my Time Machine stopped working and I had to go and manually switch it on and off every day.

To fix this issue I took the disk out of the Time Capsule and put it into an externally powered USB 3TB capable enclosure so that Time Capsule finally worked reliably again (and no longer crashed). The reason this worked was because the crashing was down to overloading of the power supply (which led to the crashes) in the Time Capsule itself - by moving the disk outside meant that the power to main board of the Time Capsule was now more stable, plus it wasn't getting over heated (which is another problem that besets such small embedded systems).

But along the way when I took the hard drive out of the Time Capsule and tried to look at it on my computer I only found two rather oddly named partitions - APswap APconfig. After searching on the net it seemed there should have been a third partition named Data but it was not showing up?! I was very puzzled as it showed up when inside my Time Capsule. After a lot of faffing about I finally discovered that problem was down to a hardware issue - all the harddrive enclosures I had tried with my drive were not actually capable of reading a 3TB drive - though they were all happy reading a 2TB drive (but quite few enclosures can only read 1Tb or less - so check this if you're having this issue). So I finally managed to find a 3TB capable enclosure and it reads the disk fine and mounts the Data partition (and may be used for external connection of the disk to my Time Capsule so it works as I explained above).

I did also try to mount the disk from Linux but the default filesystem used by the Time Capsule is Apple's HFS+ with journaling enabled used to be not so straightforward to mount. It seems that Linux now mounts hfsplus disks with journaling switched on without a problem (though I'm not clear whether what happens to the jornaling?). On older versions it's also possible to force mount the drive using Linux's hfsplus filesystem driver. It seems that under Lion it's no longer possible to switch off journaling on HFS+ using Disk Utility which is a pain - though I understand that it can be switched off using the diskutil command.

One final thing I tried was set up a Linux box as Time Machine capable network drive. One thing I learned along the way was that Linux's HFS support (i.e. Apple formatted disks) is not rock solid and it would crash when running the backups so I had to change the disk format of my backup drive to use Linux's ext3 filesystem instead (then I could use the ext2/3 fuse filesystem to mount it on OSX). This basically seemed to work on one of my machines, but unfortunately it seemed less reliable on another (It lead to this error message every so often: "Time Machine completed a verification of your backups. To improve reliability, Time Machine must create a new backup for you." - which makes it useless) so I've gone back to using the old Time Capsule with an USB external disk (having removed the internal one which means it no longer crashes).
[updated:9sept13]

Wednesday, 13 February 2013

Airport update 7.6.3: IPv6 OK

I just loaded up the Airport/Time capsule update 7.6.3 and everything works fine so far: my IPv6 tunnel is working fine (contrary to some other articles out there..). We'll see if it brings stability enhancements to the Apple networking...lets hope so....

I had some issues with my Hurricane Electric dynDNS setup (Very useful if you have a dynamic address for your ADSL) in conjunction with my IPv6 tunnel, but I fixed the problem by removing the dynDNS entry from the ipv6 tunnel Advanced settings and reinstating it. It may also have been down to making sure Ping (ICMP) was unblocked for the he.net servers.


Wednesday, 25 July 2012

Windows networking more reliable on Time Capsule

So you're trying to connect/backup to your Time Capsule (1st Gen OS7.6.1) and it seems like it just died...? But you can still connect using the AirPort Utility? And it still pings.... Oh but wait you can connect to the disc using...... Yes Windows file sharing protocol (SMB/Samba). What's going on?!

It seems that Apple's File Sharing (AFP) server just dies - quite often. Indeed it would seem that the Time Capsule's AFP implementation is flakier than their Windows (SMB) server. That's handy for an Apple product?!

The annoying thing is that whilst you can connect to the thing using the AirPort Utility you can't restart it - it just hangs. So you have go and turn it on and off.

Tuesday, 17 July 2012

Time Machine: Indexing backup......yawn....FIXED

Yeah it's getting boring seeing that message (and/or 'Waiting for index to be ready' in system logs /var/log/system.log) when your Mac is supposed to be actually backing up. I had this problem on Snow Leopard and then for a while on Lion but I now seem to have sorted it. I tried a few approaches and removing the spotlight index actually fixed it this time (though other times it has just been a question of waiting):
  • Wait: It can take a loooong time to complete backups and indexing of backups so wait a few hours or even a day or so to see if it just sorts itself out.
  • Repair Backup:
    1. Turn off Time Machine in the preferences.
    2. Mount the Time Machine Backups as follows: In Finder you navigate to your backup disk and then find your machine's actual backup file (your_computer_name.sparsebundle) and double click on it - it will put a new disk in Finder's sidebar: 'Time Machine Backups'. 
    3. Then open up Disk Utility and select the 'Time Machine Backups' disk and click repair.
    4. Eject the 'Time Machine Backups' disk and re-enable Time Machine in the system prefs.
  • Remove Spotlight Index: Follow steps (1) and (2) above then open a Terminal window and type the following:
    sudo rm -rf /Volumes/Time\ Machine\ Backups/.Spotlight-V100

    Then follow step (4) above. After this your backups may take longer for a day or so whilst Time Machine rebuilds its indexes but it should settle down soon.
  • Disable Spotlight for TM Backups: Spotlight can be disabled by firstly ensuring that 'Time Machine Backups' is
    mounted (see (2) above). The going to Spotlight Prefs and adding the disk to the 'Privacy' section. Alternatively it can be done on the command line as follows:
    sudo mdutil -i off /Volumes/Time\ Machine\ Backups
If you don't get anywhere with these approaches then check out this guy's page which has plenty of other things to try.

[Updated: 26oct12: Cleanup and Pondini link]

Sunday, 6 February 2011

Airport Update 7.5.2 kills IPv6 Router Advertisements [NOT?]

[22sept11]: UPDATE: It appears that I may be wrong as I've now seen my machines automatically obtain an IPv6 address now (using an RS and receiving an RA). Possibly what was needed was a full power cycle of the Time Capsule to effect the IPv6 configuration.

After carefully managing to set up IPv6 on my Time Capsule using a manually configured tunnel I noticed that it had stopped working after updating to 7.5.2. I hadn't had the time to look into it before,  but now I have it seems that 7.5.X has some kind of 'safety' feature that disables Router Advertisements (RAs) on your LAN when another box on your LAN is doing the DHCP  (or RA) which seems DUMB. It should be configurable as alot of people don't use their TC as their main router box - since it only supports PPPoE. If someone's going to bother manually setting up a tunnel then they probably want to use it...

It seems that the Time Capsule reports this an "IPv6 Tunnel Error" - despite the fact that actual tunnel is up - so this error must be indicating it has had to stop the RA service.

I now have to manually add the IPv6 route to my hosts which make IPv6 a bit of joke on things like my iPhone or other devices I can't configure manually for IPv6.

Nice one Apple - just when we thought IPv6 was getting easier!

Sunday, 28 November 2010

Time Machine backup...not

The other day I went to my Time Machine backup to try get a slightly older copy of a file that I'd been working on recently. But there was only a fairly ancient copy sitting there - and I KNEW I'd updated it since that date?!  My Time Machine backups seemed to be backing up just fine but only it wasn't..... Real handy?!

I Googled it and found a bunch of people had run into the same issue.

There are a bunch of files and directories that are normally excluded from backups - which are contained within the following plist files (You can see them just using a text editor or Quickview or edit them using e.g. Property List Editor) - check the 'ExcludeByPath' keys:
/Library/Preferences/com.apple.TimeMachine.plist
/System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist

Note: That in the com.apple.TimeMachine.plist there are a bunch of items that get added by certain Applications; Xcode adds the directories named 'build' (and maybe others) to the list exclusions, and Google's Chrome adds it's 'cache' directories to the exclusion list. There's probably others out there as it is achieved using a standard API call.

You can also find, using mdfind the OSX's command line version of Spotlight, all files or directories that have had the appropriate metadata attribute set (using xattr command) for backup exclusion:
sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"
Out of interest you can list the metadata attributes on any file/dir:
mdls /path/to/that_curious_file
However in my case none of the above applied and it seems that under Sow Leopard there's some 'bug' that stops TM working properly if you haven't rebooted in a while (which I hadn't). So a simple reboot fixed it?! Not reassuring though.

There's a good list of things to check here and there.

Sunday, 2 August 2009

IPv6 Tunnel with Thompson router (from a Time Machine)

[updated 5oct12, 25jul10] I've recently got myself a Thompson router which has a bunch of interesting stuff in it once you get into the telnet access (the username/password used depends on your provider e.g. Plusnet (Administrator/your_router_serial_num), O2 (SuperUser/O2Br0ad64nd OR your_router_serial_num), etc). To get a tunnel working for Hurricane Electric, Sixxs, you need to [temporarily] allow IPv4 pinging of your box. Once you enable it at tunnel setup time - so here's how to do it.
%telnet your_router
{Administrator}=>:service system ifadd name=PING_RESPONDER group=wan

Once you've set it up on the website then you can disable it again:
{Administrator}=>:service system ifdelete name=PING_RESPONDER group=wan

On some systems you may need to allow 6to4 IPv6 tunnelling through the NAT - just try the above first and see if the tunnel works. If it doesn't then you could look here for info enabling it. [Update18jul10]: To enable it telnet to your Thompson box and type the following - filling in outside_addr and inside_addr and intf (on O2 its O2_ADSL2plus) - you can find a list of your box's interfaces by using nat iflist and associated addresses ip iplist):

nat mapadd intf=Internet type=nat outside_addr=your_external_ip_addr inside_addr=your_time_machines_ipv4_addr protocol=6to4

OR if you have a dynamic IP address (common these days) then use the following (and it will dynamically install the appropriate rule to permit your 6to4 IPv6 tunnel through when your router reboots (as suggested on he.net) - But to get it all working you will also need to use some sort of dynamic tunnel update as provided by he.net):

:nat tmpladd group=wan type=nat outside_addr=0.0.0.1 inside_addr=your_time_machines_ipv4_addr protocol=6to4

To get a full listing of existing mappings use: nat maplist expand=enabled If you need to change a mapping then you'll need to delete it first using nat mapdelete and then add the modified one. Once you've got the right mapping in place then you'll need to save the config so it is persistent between reboots by typing config save filename=user.ini (on O2 anyway - for others you'll need to check the default config file by: config list)

This article follows on from one on using my Time Machine as IPv6 6to4 tunnel/router - though this advice could also be relevant to someone just using a 6to4 tunnel from any device.

Friday, 1 May 2009

Just setup Time Capsule as my IPv6 gateway

So Apple have taken a lead in the drift towards IPv6 adoption (though it seems we really are getting to the end IPv4 as we know it) - their Time Capsule (TC) uses IPv6 out of the box for administration when using the AirPort Utility (Using a proprietary encrypted protocol AACP). It also has facilities for setup of an IPv6 [6in4] tunnel using IPv6 in IPv4 encapsulation (specifically IP protocol 41) as specified in RFC4213.

So to get connected to the Global IPv6 Internet (such as it is...) you need to go get a free tunnel endpoint from Hurricane Electric (or others) then use the AirPort Utility and select 'Manual Setup', then go to 'Advanced' and 'IPv6' then select 'IPv6 mode:' as tunnel and select 'Configure IPv6:' as Manually. The enter the addresses as given by your IPv6 tunnel provider. In the LAN IPv6 Address enter an address that has the same IPv6 prefix as the others but with a different host id - the bit after the "::/64" - just choose a number (well up to 8 hex digits separated by ':'s - no "::" prefix used if exactly 8 digits are used for host_id) which will form your TC's [Global] IPv6 address (e.g. your_prefix::FE:ED:CO:FF:EE). It's probably best to disable incoming connections as you could open your machine to IPv6 attacks.

If you're on a public IP address space then you're all set, however if like most of us your TC is behind a DSL router/NAT then you'll need to make hole in your firewall/NAT so Porotocol 41 gets in and out. If you're lucky enough to have a Linux based DSL router then this how to do it - login to you router. If you've got a Netgear router then you can enable telnet access by going to http://your_router/setup.cgi?todo=debug. And then telnet to the router and type the following (which I found here) - given your TC has the address 192.168.0.2:
iptables -t nat -A PREROUTING -i ppp0 -p 41 -j DNAT --to 192.168.0.2
iptables -t filter -A FORWARD -i ppp0 -p 41 -d 192.168.0.2 -j ACCEPT

You may not need to do the above on some routers - all tht may be necessary is enable pings on the external interface.

[update 2aug09]: If you've got a Thompson router then see my new blog entry.

And you should now be able to access the world of IPv6.... Check out these for starters ipv6.google.com, the old Kame dancing turtle, and quite a few others...oh and these too...

[updated/corrected 6in4 - 18nov09]

Wednesday, 29 April 2009

Encrypted Timecapsule backups

Timecapsule backups aren't encrypted which seems a little dumb - as if someone nicks your TC then they've also got all your data in the clear too. There's a simple procedure that this smart post lays out - but I've copied it here in case that page goes away as it is so handy:
  • Set up Time Machine to back up to an AFP drive. I don’t think this will work with a local hard drive.
  • Let Time Machine start backing up, then stop the back up. This will have created _.sparsebundle on the AFP drive.
  • Disable Time Machine.
  • Open a Terminal and run these commands (replace name_mac with your mac's name, and TC_drive_name with your TimeCapsule's network drive name - ls /Volumes to check):
    $ cd /Volumes/TC_drive_name/
    $ mv name_mac.sparsebundle name_mac-old.sparsebundle
    $ hdiutil convert -format UDSB -o name_mac.sparsebundle -encryption AES-256 name_mac-old.sparsebundle

    It will ask you for a password. Type in a password you won’t forget.
  • Double click the sparsebundle in the Finder (You should find it in your TimeCapsule network drive). You will be prompted for your password. Type that in and tick the “Remember password” check box.
  • Open /Applications/Utilities/Keychain Access and find name_mac.sparsebundle. Right click it and select Copy name_mac.sparsebundle.
  • Select System Keychain on the left hand side of Keychain Access and paste it in the main area. Allow this action if you are asked. Remember to lock the System Keychain when you are done.
  • If using Snow Leopard then (as suggested here) you'll need to copy "com.apple.TimeMachine.MachineID.plist" from the old to the new sparsebundle. You can do this by going to the volume using Terminal as above and then doing:
    $ cd /Volumes/TC_drive_name/
    $ cp name_mac-old.sparsebundle/com.apple.TimeMachine.MachineID.plist name_mac.sparsebundle
  • Unmount the volume and then tell Time Machine to get busy.
  • Time Machine should not have no problem backing up to the encrypted volume. If everything works as planned, feel free to delete the name_mac-old.sparsebundle
[updated: 21sept09, 21aug10]