Hi all.
I'm referring to a May post from Chris Stone and others about using
amanda (client) on a Mac OS X (Darwin 10.0.4 in my case).
I finally been able to backup the Mac!
It was really a long quest but seems to work:
............ c1t3d0s0 2 94495 9152 9.7 0:38 244.0 0:10 879.7
mac-paolo.un -v/disk1s11 0 36842432060576 55.9 33:101035.3 41:02 837.1
............ hd2 1 516 64 12.4 0:35 1.9 0:002181.9
First: the only way to use amanda is to have and Apple UFS file system
and NOT an Apple Mac OS Extended. We need someone from Apple to solve
the puzzle regarding super block definition of the 2 different file
system types.
The version I have used is 2.4.2p2.
Now the big problem.
Before configuring and compiling amanda we must solve the puzzle of the
missing restore comand.
The dump comand is in /sbin and it is working with Apple UFS file
systems but NOT with Apple OS Extended ones but amanda want to know
where both dump AND restore are located. Even if complaining of missing
dump what is really missing (and looking for) is restore. Both comands
must be in the path of the shell when configuring amanda.
You can try the following from terminal (and immediately stop it with
Cntl C) which simulate an amanda session:
dump 0uf - /dev/rdisk1s11 (your disk/s taken from the df -k).
If it is not complaining you will get it working with amanda.
Why Apple decide to include (in /sbin) dump rdump and dumpfs an NOT
restore and rrestore while including /usr/share/man/man8/restore I don't
know, but without a restore command somewhere in the shell path, amanda
will compile but will not work. You can check this looking at
/tmp/amanda/amanda...date...time debug file: if everything is correct
you will find a line containing DUMP=/sbin/dump (and naturally
(RESTORE=/sbin/restore) if not amanda would not work and complain for
missing DUMP file (and not RESTORE one !!!).
So dump will not work because amanda think it is not present but most
than all because restore it is not present.
A work around if you never plan to use the local restore command (as we
do) is to link dump to restore (or whatever). This will make amanda
happy and you will find the line:
DUMP=/sbin/dump RESTROE=/sbin/restore in the debug file.
Restore Command.
It was not easy task to find & compile restore. Again why Apple left it
out it is a mistery to me. My feeling is that it is not working fine. I
do not have tried yet to restore something (on the client Mac, but I can
retrieve anything from the server host with amrestore).
Also why the man page is there? So I immagined that in NeXt
distribution, from which Darwin is derived, the restore command would be
present since it is in the BSD distribution. I've checked at
http://www.opensource.apple.com/tools/cvs/ and I've found it.
It is at
http://www.opensource.apple.com/cgi-bin/registered/cvs/Commands/NeXT/diskdev_cmds/restore.tproj
(you need to sign up before anyway).
You can also find it in the Darwin Collection CDs by Dr. Michael L. Love.
To compile it you need also to download an compile a library called
libdisk. I do not know if the missing object referred in libdisk are in
one of the static or dynamic libs which come with MacOS X distribution:
I could not find them anyway using nm). I also want not to spend anytime
recoding. So I had to compile libdisk.a.
If one own the Darwin Collection CDs there is an already compiled
libdisk.a there too.
The source for disklib is at:
http://www.opensource.apple.com/cgi-bin/registered/cvs/Darwin/Commands/NeXT/diskdev_cmds/disklib/
Compile it is simple and I didn't spend time in making the Makefile
friendly: it will create the lib in a dir called BUILD in /tmp. Inside
you will find libdisk.a.
TO compile it you have to change in file dksecsize.c:
#include <bsd/dev/disk.h>
to
#include <dev/disk.h>
make & make install will put the lib in /usr/local/lib.
Be sure to include disk.h which is in /usr/include/dev and not the one
which is the CVS tree or Darwin Collection CDs: it will ask you for a
bunch of other include files.
Then cd to restore dir and make (some warnings but it will compile
straight). Make install will install restore, rrestore and the man page
(updated respect the one already in man) in the right places with right
UID GID and permissions.
Make sure /usr/local/lib is in the path of your shell or make will not
find libdisk.a. Otherwise you have to put it somewhere make can look at
or directly refer to it using:
LIBS=-Lyourpath -ldisk in the restore Makefile.
Now you are set to use amanda: it will be happy and you will have all
the objects needed.
Setting the source for Darwin is an easy task:
to prepare the original ./config/config.guess to make it working with
Darwin. Change (or add) the following:
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
to
Power*:Darwin:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
I have used the following ./configure to set-up amanda:
./configure --prefix=/usr/local/amanda --exec-prefix=/usr/local/amanda
--sysconfdir=/etc --localstatedir=/var --mandir=/usr/local/man
--infodir=/usr/local/info --with-tape-server=amanda
--with-config=your_config --with-fqdn --with-user=root
--with-group=wheel --with-amandahosts --with-buffered-dump --with-db=db
--without-server
As you can see I had to use UID root and GID wheel because even creating
an user (dump or bin) for some reason netinfo do not let amanda dump (no
access to the Mac).
make and make install will put amanda in place ready to go.
Then you have to set inetd.conf, services (as in the INSTALL of amanda)
but most than all Netinfo. Also the file ".amandahosts" must go in the
home dir of the user amanda uses to backup (root) in the form"
hostnameof the server group (as in INSTALL). Finally you have to create
under /etc the files dumpdates with correct user(root) and group (wheel)
and write permission to the user.
Netinfo. Apple choose to keep the real complex way of handling system
configs on Netinfo DB as on NeXt (try to change a group ID without
setting up Netinfo and will obtain nothing... or try to find the passwd
file or change it: again nothing) and not in "normal" UNIX files.
So to give access to amanda server dumper you have to insert a line for
any new services you want to include in Netinfo.
Open Netinfo Manager choose Domain>Security>Authenticate. Insert root as
name and the appropriate pwd (you have to set root pwd with sudo passwd
root if you didn't already).
Then choose services and create a new entry or duplicated an existing
one and insert what amanda arequire to be in services (I personally have
added amanda 10080 udp, amandaidx 10082 tcp and amidxtape 10083 tcp).
Anytime you insert a service it will ask to save and update the data
base. Click OK and update.
You then need to kick inetd (a kill -1 PID) to make it aware of amandad
in /usr/local/bin/libexec.
You are ready finally.
If you want to take a look at the debug file amanda create you can
manually launch /usr/local/amanda/libexec/amanda (or whatever path you
have choosen): it will create the debug files named amanda...date..time
and selfcheck...date...time files where you take a look and see what's
going on and if you have errors. It will timeout and exit by itself.
You can find on ftp://ftp.unipi.it/local/amanda_MacOSX the following
files if you do not feel puzzling with make and compiling:
disklib.a,gz - which is the lib ready to use for people which do not
want to compile.
restore.gz - which is the comand to be put in /sbin
disklib.tar.gz - which is the libdisk.a source and compiled lib -
need only to make install
restore.tar.gz - which is the restore program source and binaries -
need only to make install
config.guess - which is the replacement of the config/config.guess
file of the amanda distrib to be aware of Darwin distrib
My Mac uses MacOS X 10.0.4 and the development kit (second CD of MacOSX)
updated (but I do not think make any difference for UNIX like programs.
The kit is only available to registered developer).
TODO:
Server source for amanda. Even if I will never have the chance to try it
since I do not have a tape available for the Mac. I think anyway is
going to be a very hard quest. Adding device on the new MacOS X is not
like adding them on the Classic Mac OS (look at the scsi adapters,
printer, USB and FW devices: almost none of them is handled by OS X) and
I bet a SCSI tape for example can hardly work with the new Acqua looking OS.
Backup of Mac OS extended file system type. I think the problem is in
the dump code: it always complain, running it from the command line,
about wrong superblock magic number:
dump 0uf - /dev/rdisk1s11
DUMP: Date of this level 0 dump: Wed Jul 11 17:29:21 2001
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdisk1s7 to standard output
DUMP: bad sblock magic number
DUMP: The ENTIRE dump is aborted.
Need to know in which way an Extended partition handle superblocks (the
disk access information). There is also the problem of using a case
ignoring file system type such the Apple extended. Anyway the raw device
is there and somehow the UNIX side of this Jekill/Hide OS can access
files on a Mac OS Extended partition.
Try a way of handling different user/group for amanda to access the box
and not root:wheel. I think this is just a matter of play with the
incredible Netinfo Manager and give right permissions to what is needed.
On Solaris we need to change the permission to the dev dir and files to
make user bin:bin to access the boxes. I suppose something similar even
if user bin on BSD is not there.
Hope it helps: enjoy.
Ciao
Paolo
--
___________________________________________________________
Paolo Caturegli Tel: +39 (050) 2212564
Fax: +39 (050) 2212560
[EMAIL PROTECTED]
===========================================================
U N I V E R S I T Y O F P I S A
SERRA - Centro di Servizi per la Rete di Ateneo
===========================================================