📜 ⬆️ ⬇️

Backup to Time Machine using a home server for Ubuntu as iSCSI target

Good evening, dear habroskoobschestvo!

For a long time, due to the lack of TimeCapsule or an external USB hard drive, I used Time Machine to backup to the home server using the SMB protocol (for details on how to do this, for example , see here ) However, it is not for nothing that in my opinion this method is not officially supported by Apple, the method is bad unfit Twice the image for backups turned out to be corrupted for no apparent reason, but the data was saved, for the third time the cup of my patience overflowed and I began to look for an alternative option. I present my solution to the backup problem to the community by providing access to a separate home server disk using the iSCSI protocol. What it is, what it is for, as well as advantages and disadvantages compared to SMB / nfs can be found, for example, here .

So, given:
1. Server running Ubuntu 9.04 server (made dist-upgrade from 8.10). Acts as an iSCSI target. For backup we will use a separate hard drive.
2. iMac running MacOS 10.5.7 Acting as iSCSI-initiator

')
Server Tuning.

1. We put the iscsitarget daemon. In the console, we write "sudo apt-get install iscsitarget"
2. Edit the file "/ etc / default / iscsitarget", the only line in it should be "ISCSITARGET_ENABLE = true".
3. Edit the file "/etc/ietd.conf", add 2 lines, "Target iqn.2001-04.com.example: storage.disk2.sys1.xyz" - the name of our new iSCSI target and "Lun 0 Path = / dev / sda, Type = fileio "where" / dev / sda "is the address of the disk block device.
NB Also in this file you can configure many other useful things, such as authorization.
4. Restart the daemon "/etc/init.d/iscsitarget restart".

Client setup

1. We install a free iSCSI-initiator globalSAN iSCSI Initiator for OS X, download it from here . The installation process will require a reboot.
2. Open System Preferences-> GlobalSAN iSCSI.
3. On the Portals tab, add the server address.
4. If everything went well then on the Targets tab you will see our newly created target. Put a tick in the positions Persistent and Connected.
5. A window should immediately appear with a warning that the disk is not initialized and a proposal to do so immediately. The proposal should agree. If no warning appears, open Disk Utility with your hands.
6. Using Disk Utility, format the new disk in the Mac OS Extended (Journaled) file system.
7. Open the Time Machine settings and specify a newly-formatted iSCSI disk as a backup disk.
8. Turn on Time Machine.

Enjoying perfectly working backups!

PS I apologize for some confusion, wrote in a hurry. I will be glad to answer questions in comments if any arise.


UPD: At the request of readers transferred to the blog "Mac OS X"

UPD: According to the respected user PingMe, to restore the user when you reinstall the system, you must do the following: "Install the OS, create the user after installation, log into the system, climb into the Utilities -> Migration, and from there you already take away the desired user."

Source: https://habr.com/ru/post/44536/


All Articles