Difference between revisions of "TimeMachine2"
(6 intermediate revisions by one other user not shown) | |||
Line 5: | Line 5: | ||
== Introduction == | == Introduction == | ||
'''Important:''' Since firmware version 2.5 (May, 2012), the B3 comes with built-in TimeMachine support, meaning that most of this How-To is no longer applicable (and no longer necessary). Your B3 will show up in the list of available TimeMachine devices in your Macintosh TimeMachine settings. | |||
There is one notable exception: Without user intervention, TimeMachine will be allowed to use your whole B3 disk, meaning that it will fill up the disk over time. There is a simple way to restrict TimeMachine's disk usage without creating, and resizing, a separate partition on the B3 (see the following chapter). | |||
== Updating Netatalk == | == Restricting TimeMachine Disk Usage On Recent B3 Firmware (≥ 2.5) == | ||
You will need to modify the configuration file <code>/etc/bubba/AppleVolumes.default</code>, but the modification is a very minor one, so there is little potential to make any bad mistake. You should nevertheless be very careful when editing configuration files, and maybe you want even to make a backup of the file before editing. You need root privileges for editing this file. | |||
Locate the line defining the TimeMachine share. On 2.5.x, this line looks as follows: | |||
/home/.TimeMachine "TimeMachine" options:tm allow:@users rwlist:@users | |||
For my installation, this is line 177. You may locate it by using the search function of your editor - just search for the string "/home/.TimeMachine" (this is unique), or for the string "TimeMachine" (there is more than one occurrence in the file, but you will easily find the right one). | |||
Now, all you have to do is append the string <code>volsizelimit:500000</code> to the line, 500000 being the desired size in ''MB'' (so, 500000 is roughly 500 GB, 200000 would be 200 GB, 1000000 would be 1 TB, and so on): | |||
/home/.TimeMachine "TimeMachine" options:tm allow:@users rwlist:@users volsizelimit:500000 | |||
Next, you need to restart the AFP services on your B3. You may do so using the following command: | |||
/etc/init.d/netatalk restart | |||
It may take a while for everything to settle, and you may (but need not) restart your Mac, your B3, or even both to speed things up, but afterwards, your Mac will "see" a TimeMachine partition of the specified size, meaning that your TimeMachine backups will never use more than that size, and that there is no danger of your backups filling up your ''whole'' B3 disk. | |||
== Using TimeMachine With Older B3 Firmware Versions == | |||
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 | 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 | ||
Line 20: | Line 44: | ||
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". | 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 == | === 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. | 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 === | ==== 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. | 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 === | ==== 2. Prepare ==== | ||
Check if the home partition is unlocked: | Check if the home partition is unlocked: | ||
Line 35: | Line 59: | ||
This command should not give output. | This command should not give output. | ||
=== 3. Resize the partition === | ==== 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!!''' | 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!!''' | ||
Line 43: | Line 67: | ||
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. | 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 === | ==== 4. Resize the volume ==== | ||
Now reduce the LVM volume. Again, this example uses a 800G partition size. | Now reduce the LVM volume. Again, this example uses a 800G partition size. | ||
<pre>lvreduce /dev/mapper/bubba-storage 800G | <pre>lvreduce /dev/mapper/bubba-storage 800G | ||
</pre> | </pre> | ||
=== 5. Create and activat the time-machine partition === | ==== 5. Create and activat the time-machine partition ==== | ||
Create and format the a new partition | Create and format the a new partition | ||
Line 62: | Line 86: | ||
This last command should now report the timemachine volume. | This last command should now report the timemachine volume. | ||
== Create a mount point == | === Create a mount point === | ||
The mount points for AFP (Apple Filing Protocol) are defined in /etc/netatalk/AppleVolumes.default. You need to edit this file | The mount points for AFP (Apple Filing Protocol) are defined in /etc/netatalk/AppleVolumes.default. You need to edit this file |
Latest revision as of 07:48, 17 December 2012
Introduction
Important: Since firmware version 2.5 (May, 2012), the B3 comes with built-in TimeMachine support, meaning that most of this How-To is no longer applicable (and no longer necessary). Your B3 will show up in the list of available TimeMachine devices in your Macintosh TimeMachine settings.
There is one notable exception: Without user intervention, TimeMachine will be allowed to use your whole B3 disk, meaning that it will fill up the disk over time. There is a simple way to restrict TimeMachine's disk usage without creating, and resizing, a separate partition on the B3 (see the following chapter).
Restricting TimeMachine Disk Usage On Recent B3 Firmware (≥ 2.5)
You will need to modify the configuration file /etc/bubba/AppleVolumes.default
, but the modification is a very minor one, so there is little potential to make any bad mistake. You should nevertheless be very careful when editing configuration files, and maybe you want even to make a backup of the file before editing. You need root privileges for editing this file.
Locate the line defining the TimeMachine share. On 2.5.x, this line looks as follows:
/home/.TimeMachine "TimeMachine" options:tm allow:@users rwlist:@users
For my installation, this is line 177. You may locate it by using the search function of your editor - just search for the string "/home/.TimeMachine" (this is unique), or for the string "TimeMachine" (there is more than one occurrence in the file, but you will easily find the right one).
Now, all you have to do is append the string volsizelimit:500000
to the line, 500000 being the desired size in MB (so, 500000 is roughly 500 GB, 200000 would be 200 GB, 1000000 would be 1 TB, and so on):
/home/.TimeMachine "TimeMachine" options:tm allow:@users rwlist:@users volsizelimit:500000
Next, you need to restart the AFP services on your B3. You may do so using the following command:
/etc/init.d/netatalk restart
It may take a while for everything to settle, and you may (but need not) restart your Mac, your B3, or even both to speed things up, but afterwards, your Mac will "see" a TimeMachine partition of the specified size, meaning that your TimeMachine backups will never use more than that size, and that there is no danger of your backups filling up your whole B3 disk.
Using TimeMachine With Older B3 Firmware Versions
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. Again, this example uses a 800G partition size.
lvreduce /dev/mapper/bubba-storage 800G
5. Create and activat the time-machine partition
Create and format the a new partition
lvcreate -l 100%FREE -n timemachine bubba mke2fs -j /dev/bubba/timemachine
Make the new mount point and add an entry in /etc/fstab. For this example I mount the partition in /timemachine. This of course is completely arbitrary
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.
Create a mount point
The mount points for AFP (Apple Filing Protocol) are defined in /etc/netatalk/AppleVolumes.default. You need to edit this file
nano /etc/netatalk/AppleVolumes.default
At the bottom you will find two lines that describe the default shares that will be available, with the names "User Share" and "Public Share". After those, you can add your own shares. Like for example:
/timemachine/ "TimeMachine" cnidscheme:dbd dpath:/var/lib/netatalk fperm:0664 dperm:0775
The only thing you then have to do, is restart netatalk and the new share will also appear in the TimeMachine configuration:
/etc/init.d/netatalk restart
And do not forget to enable AFP in the B3 web interface, so it also works after you rebooted the B3...
Enjoy!