I just copied my home folder to a separate partition and it seems to work fine.
Everything was done using a temporary admin account to make sure I wasn't writing to my home folder while copying it, and to make sure I wouldn't be locked out if something went wrong after setting it as the new home folder in system settings.
I used cp -a /Users/myname /Volumes/MyVolume/Users/myname
. In this specific case you would probably want to use
cp -a /Users/myname/ /Volumes/MyVolume
The trailing /
after the source path results in copying its contents but not the directory itself, when combined with the -a
option.
The -a
option corresponds to the -pPR
options:
-a Same as -pPR options. Preserves structure and attributes of files but not
directory structure.
-P If the -R option is specified, no symbolic links are followed. This is the
default.
-p Cause cp to preserve the following attributes of each source file in the copy:
modification time, access time, file flags, file mode, user ID, and group ID,
as allowed by permissions. Access Control Lists (ACLs) and Extended Attributes
(EAs), including resource forks, will also be preserved.
If the user ID and group ID cannot be preserved, no error message is displayed
and the exit value is not altered.
If the source file has its set-user-ID bit on and the user ID cannot be pre-
served, the set-user-ID bit is not preserved in the copy's permissions. If the
source file has its set-group-ID bit on and the group ID cannot be preserved,
the set-group-ID bit is not preserved in the copy's permissions. If the source
file has both its set-user-ID and set-group-ID bits on, and either the user ID
or group ID cannot be preserved, neither the set-user-ID nor set-group-ID bits
are preserved in the copy's permissions.
-R If source_file designates a directory, cp copies the directory and the entire
subtree connected at that point. If the source_file ends in a /, the contents
of the directory are copied rather than the directory itself. This option also
causes symbolic links to be copied, rather than indirected through, and for cp
to create special files rather than copying them as normal files. Created
directories have the same mode as the corresponding source directory, unmodi-
fied by the process' umask.
In -R mode, cp will continue copying even if errors are detected.
Note that cp copies hard-linked files as separate files. If you need to pre-
serve hard links, consider using tar(1), cpio(1), or pax(1) instead.
Actually, I accidentally left a trailing /
after my source folder which is how I know it will definitely include all hidden files as well as exclude the topmost directory.