Difference between revisions of "TimeMachine2"

From BubbaWiki
Jump to navigation Jump to search
(Created page with ' __TOC__ == 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...')
 
Line 3: Line 3:
== Introduction  ==
== 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.
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.  


<br>  
<br>  
Line 15: Line 15:
<pre>apt-get update
<pre>apt-get update
apt-get install netatalk
apt-get install netatalk
</pre>
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:
<pre>lsof | grep home
</pre>
</pre>
Once it's done Lion's Time Machine will see your B3 box in "Select Disk" config and you can
This command should not give output.  
backup your Mac to public folder "out of the box".


== Creating a time capsule volume ==
=== 3. Resize the partition  ===
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.
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!!'''


=== connect to the B3 ===
<pre>umount /home
* first SSH into the box as root DIRECTLY. You may need to alter AllowRootLogin in /etc/ssh/sshd_config for this.
resize2fs /dev/mapper/bubba-storage 800G
</pre>
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.  


then check if the home partition is unlocked:
Code: Select all
lsof | grep home
This command should not give output.


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!!
=== 4. Resize the volume  ===
Code: Select all
Now reduce the LVM volume  
umount /home
<pre>lvreduce /dev/mapper/bubba-storage 800G  
resize2fs /dev/mapper/bubba-storage 800G
</pre>
This may take a long time. 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.
 
Now reduce the LVM volume
Code: Select all
lvreduce /dev/mapper/bubba-storage 800G


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


And then create and format the a new partition
Code: Select all
  lvcreate -l 100%FREE -n timemachine bubba
  lvcreate -l 100%FREE -n timemachine bubba
mke2fs -j /dev/bubba/timemachine


mke2fs -j /dev/bubba/timemachine


Make the new mount point and add an entry in /etc/fstab
<br> 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" &gt;&gt; /etc/fstab mount -a df -h  
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.
This last command should now report the timemachine volume.

Revision as of 17:05, 22 January 2012

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.