TimeMachine2

From BubbaWiki
Revision as of 17:05, 22 January 2012 by Ubi (talk | contribs)
Jump to navigation Jump to search

Introduction

This How-To describes turning the B3 into a time capsule, compatible with OSX lion. The steps are 1) updating netatalk, 2) create a special volume for Time Machine to fill, and 3) to create a mount point.


Updating Netatalk

If your version of netatalk is too old, you may need to update from the unstable repositories. Add unstable repository by editing /etc/apt/sources.list.d/excito.list. just add at bottom of the file

deb http://b3.update.excito.org vincent main

Then run

apt-get update
apt-get install netatalk

Once it's done Lion's Time Machine will see your B3 box in "Select Disk" config and you can backup your Mac to public folder "out of the box".

Creating a time capsule volume

While this step can be skipped, time machine is programmed to fill the entire volume (this means your whole drive!). To prevent this, it is best to create a special partition just for time machine.

1. connect to the B3

You must SSH into the B3 as root DIRECTLY (i.e. not as a regular user). This is because all other user have home dirs in /home and you cannot unmount /home if you log in as a regular user. To allow direct root login, you may need to set "PermitRootLogin yes" in /etc/ssh/sshd_config.

2. Prepare

Check if the home partition is unlocked:

lsof | grep home 

This command should not give output.

3. Resize the partition

Now, umount the home partition, and resize the ext3 partition. Here I change my 920GB home partition into an 800GB partition. BACKUP your stuff before doing this!!

umount /home 
resize2fs /dev/mapper/bubba-storage 800G 

This may take a long time (> 60 min). If your connection dies in the middle of the operation you are SOL. So maybe let the "at" daemon do it. First type "at now", then you get a prompt. Enter the resize command, enter, control-D to execute. Try this with a simple command first if you never used at.


4. Resize the volume

Now reduce the LVM volume

lvreduce /dev/mapper/bubba-storage 800G 


And then create and format the a new partition Code: Select all

lvcreate -l 100%FREE -n timemachine bubba

mke2fs -j /dev/bubba/timemachine


Make the new mount point and add an entry in /etc/fstab Code: Select all mkdir /timemachine cp /etc/fstab /etc/fstab.ori echo "/dev/mapper/bubba-timemachine /timemachine ext3 defaults 0 2" >> /etc/fstab mount -a df -h

This last command should now report the timemachine volume.