I have a MacBook Pro that will be securely wiped and reverted back to factory state, but I want to save just one personal user account and restore it after the wipe. I don't think I want to use Time Machine to do the backup unless it can selectively back up a single account. Is there a way to copy just that user account folder and have my settings, etc., preserved? How would I restore it afterward?
- Open Disk Utility application.
- From the Menu Bar select "File→New→Disk Image from Folder"
- Select home folder of the user account. Click "Image" button.
- In "New Image from Folder" window enter:
Save As: Name for .dmg file that will be created.
Tags: Leave blank.
Where: Where to place .dmg file.
Image Format: compressed
- Click "Save" button.
- In the "Disk Utility" window, highlight the new .dmg file. From the Menu Bar select "Images→Scan Image for Restore".
You now can mount the new .dmg file and access the saved files. You may have to use the
chowncommand to reassign ownership of any files copied from the mounted .dmg file.
Personally, I would preform a backup of a users files while booted to a recovery partition or another partition containing OS X. Using internet recovery would also be preferable.
If you choose to preform a backup while logged into an administrator account, then choose to save the .dmg file to location where the user would normally have permission to save such a file.
For example, say I (davidanderson) open the disk utility and try to backup ronjanzen's files to the default folder
/Users, as shown below.
I would expect the following error message, because I do not have permission to create the file
ronjanzen.dmg in the folder
Now, if I choose to save to my
Documents folder, then I will succeed.
The other alternative would be to give read/write permission to the
/Users folder. If you do a "Get Info" from the Finder on folder
/Users, you get the following.
If you modify "Sharing & Permission" as shown below, you will not get the above error message.
All your settings are being kept in /Users/[username] folder.
You can make disk image of that folder, or you can create archive from command line:
$ tar cvpjf [where you want to save archive]/[archivename].tar.gz /Users/[username]
this command will create [archivename].tar.gz file (compressed archive) in [where you want to save archive]/ directory. It will contain all of the files found in /Users/[username].
Now, when you reinstall, get this archive, run
$ tar xvpjf [archivename].tar.gz
You will get your old home directory back. Now, just make sure all the rights are ok (run it even if username is the same as on old system - numerical user id or group id might differ):
$ chown -R [your new username]: [unpacked directory]
(might need admin password for that; don't forget ':' after the username - it makes sure that owner group is correct).