6 Replies Latest reply: Oct 26, 2009 12:22 PM by Dominique Buenzli
Dominique Buenzli Level 1 Level 1 (35 points)
Hello,
I want to do a bootable clone of my snow leopard system on an external hard drive. I am doing this from a shell script as I am doing other things via the script before.

To accomplish this I am using rsync 3.0.6.

Here is the command I am using: (from http://www.bombich.com/mactips/image.html )

sudo rsync -xrlptgoEv --progress --delete / /Volumes/Backup

But the resulted clone won't boot at all (blue screen) What am I doing wrong ?

Should I add something to the command line ?
Also, do you know which folders I should exclude from the backup ?

Thanks for your answers

MacPro 1,1
  • Tony T1 Level 6 Level 6 (8,855 points)
    Did you Bless the System Folder after the Clone?

    sudo bless --folder "/Volumes/Clone of Macintosh HD/System/Library/CoreServices"


    I use the following rsync options:

    /usr/local/bin/rsync -aNHAXv --one-file-system --fileflags --force-change --delete
    --exclude='.Spotlight-V100' --exclude='/.fseventsd' --exclude='/Volumes/*'
    --exclude='/private/var/vm/*' --exclude='/private/tmp/*'
    --human-readable --stats --progress "$source" "$destination"


    You may need to compile rsync 3.0.6 as follows (see: also http://discussions.apple.com/message.jspa?messageID=10383609#10383609 )


    Follow these instructions in Terminal on both the client and server to
    download and compile rsync 3.0.?:

    Download and unarchive rsync and its patches
    Move patches directory to rsync-3.0.?
    cd rsync-3.0.?

    Apply patches relevant to preserving Mac OS X metadata
    patch -p1 <patches/fileflags.diff
    patch -p1 <patches/crtimes.diff

    Configure, make, install
    (note: creation times are not preserved in x64, so…)
    ./prepare-source
    CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 ./configure
    CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 make
    sudo make install

    Verify your installation
    rsync --version

    By default, rsync will be installed in /usr/local/bin. If that isn't
    in your path, you will need to call your new version of rsync by its
    absolute path (/usr/local/bin/rsync).


    Also, be aware that rsync 3.0.6 does properly not handle the metadata for the new HFS+ filesystem compression.

    Sub-test: creation time ... ok
    Verifying: hfs-compression ...
    Sub-test: decmpfs xattr ... not preserved
    Sub-test: UF_COMPRESSED flag ... not set
    Sub-test: file contents ... match
    Sub-test: creation time ... ok
    Sub-test: modification time ... ok
    Sub-test: hard link inode ... ok
    Sub-test: hard link decmpfs xattr ... not preserved
    Sub-test: hard link UF_COMPRESSED flag ... not set
    Sub-test: hard link modification time ... ok
    ok
    Verifying: hfs-compression_large ...
    Sub-test: decmpfs xattr ... not preserved
    Sub-test: UF_COMPRESSED flag ... not set
    Sub-test: file contents ... match
    Sub-test: creation time ... ok
    Sub-test: modification time ... ok
    Sub-test: hard link inode ... ok
    Sub-test: hard link decmpfs xattr ... not preserved
    Sub-test: hard link UF_COMPRESSED flag ... not set
    Sub-test: hard link modification time ... ok
  • Dominique Buenzli Level 1 Level 1 (35 points)
    Hello,
    Thanks for your answer.

    I used the rsync 3.0.6 binary from http://maclemon.at/mlbackup and no I didn't sudo bless --folder "/Volumes/Clone of Macintosh HD/System/Library/CoreServices"

    So I started all again and used your command line, then blessed the folder. I am able to boot of the disk (Grey Apple is here and turning wheel but then nothing happens).

    Strangely, if I Carbon Copy Clone the drive after rsync it still copied 2,4 Go of files and then I was able to to boot of my external drive...

    Carbon Copy Cloner log
    14:07:11 Summary statistics:
    Regular files copied: 149861
    Directories: 55423
    Regular files: 221484
    Symlinks: 8474
    Devices: 0
    Special files: 39
    Hard links: 1341
    Extended attributes: 181822 (1.99 Go)




    "Also, be aware that rsync 3.0.6 does properly not handle the metadata for the new HFS+ filesystem compression."

    What are the exact implications of this ? Could this be the problem ?

    Thanks,
  • Tony T1 Level 6 Level 6 (8,855 points)
    What are the exact implications of this ? Could this be the problem ?


    It won't be the problem, but System Files and some App's will have incorrect MetaData. CCC says that it handles this correctly. (Hopefully rsync will be updated soon)

    For a good explanation, see: http://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars/3

    One thought, if you ⌘I the clone, do you have "Ignore ownership on this volume" Unchecked?
  • Dominique Buenzli Level 1 Level 1 (35 points)
    "One thought, if you ⌘I the clone, do you have "Ignore ownership on this volume" Unchecked? "

    No and THIS solved the problem Thanks very much. My clone is now perfectly bootable.

    Is there a command line to uncheck "ignore ownership on this volume" ?
    Just to be sure that it is all the time the case (if I change external hard disk for instance).
  • Tony T1 Level 6 Level 6 (8,855 points)
    Is there a command line to uncheck "ignore ownership on this volume" ?
    Just to be sure that it is all the time the case (if I change external hard disk for instance).


    vsdbutil -d /Volumes/Clone of Macintosh HD

    however, please note that the vsdbutil command is deprecated.

    Here's a script that will test it:

    /usr/sbin/vsdbutil -c /Volumes/Clone of Macintosh HD | grep -sq "enabled"
    if [ $? -ne 0 ] ; then
    echo -e \aPermissions on /Volumes/Clone of Macintosh HD are disabled.
    \nUncheck 'Ignore ownership on this volume' for /Volumes/Clone of Macintosh HD
    exit 1
    fi


    And the Man Page:
    VSDBUTIL(8) BSD System Manager's Manual VSDBUTIL(8)

    NAME
    vsdbutil -- manipulates the volume status DB.

    SYNOPSIS
    vsdbutil [-a -path]

    vsdbutil [-c -path] [-d -path] [-i]

    vsdbutil [-h]

    DESCRIPTION
    vsdbutil manipulates the volume status DB. The following options are
    available:

    -a adopts (activates) on-disk ownership on the specified path

    -c checks the status of the ownership usage on the specified path

    -d disowns (deactivates) the on-disk ownership on the specified
    path

    -i initializes the ownership database to include all mounted HFS+
    volumes

    -h prints out a simple help message

    The vsdbutil command is deprecated.

    FILES
    /var/db/volinfo.database Database of volumes managed
    via vsdbutil.

    SEE ALSO
    diskutil(8), mount(8)

    Darwin December 19, 2001 Darwin
  • Dominique Buenzli Level 1 Level 1 (35 points)
    Thanks for your help. Works perfectly now.