4

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?

3 Answers 3

8
  1. Open Disk Utility application.
  2. From the Menu Bar select "File→New→Disk Image from Folder"
  3. Select home folder of the user account. Click "Image" button.
  4. 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
    Encryption: none
  5. Click "Save" button.
  6. 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 chown command to reassign ownership of any files copied from the mounted .dmg file.

Update 1:

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 /Users.

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.

enter image description here

If you modify "Sharing & Permission" as shown below, you will not get the above error message.

5
  • I tried this but after step 5, it said "permission denied" and failed. Any suggestions? I tried from two different admin user accounts.
    – rob
    Sep 14, 2015 at 23:58
  • @rob: I updated my answer to address your concerns. Let me know if you have any other problems. Sep 15, 2015 at 8:21
  • That won't work unless you've given the administrator permission to read the other user's files.
    – Kent
    Sep 15, 2015 at 8:33
  • 1
    @Kent, if you are already an administrator then a pop window will ask for your login password. If entered correctly, then you will be given permission to read the other users files. I did test this before posting it. Sep 15, 2015 at 9:54
  • Apologies!! I've had trouble with that in the past (on OSX Server) and have since resorted to the command line hdiutil or starting Disk Utility as root. Great to know that there's an easier way.
    – Kent
    Sep 15, 2015 at 10:47
2

You can use time machine, then when you set up, use migration assistant. It will allow you to copy specific files (your user account).

2
  • Can I configure Time Machine to exclude other user accounts?
    – rob
    Sep 14, 2015 at 23:56
  • Yes. You can go to sys prefs > time machine > options, then exclude the user folders.
    – At0mic
    Sep 15, 2015 at 4:21
0

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).

1
  • 1
    BTW, tar -j creates a bzip2 archive but you gave it a .gz extension. Gzip is the -z switch. If you want a bzip2, you should use a .bz2 extension. Mar 17, 2017 at 16:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .