Backup Gnu-Linux-PPC to OS X

I wanted to make a clean install of Ubuntu-PPC. Rather than burning everything to CDs, and since I have a dual-boot (OS X just for backup purposes), I reasoned that I could copy my Ubuntu account contents straight into OS X, reinstall Ubuntu onto the Ubuntu partitions, then copy my Gnu-Linux account contents back in.In term pass:

sudo mac-fdisk -l

Look for the line that ends in HFS. Take note of the “/dev/XXXX” that corresponds to the HFS partition (ie., hda3).

Look for “/mnt/macos”. If it doesn’t exist, create it with:

mkdir /mnt/macos

Now mount OS X using the previously noted output of “sudo mac-disk -l”:

sudo mount -t hfsplus -o rw /dev/hda3 /mnt/macos

Now use the cp function to copy. I decided to use a few flags, ‘-b’ to backup, ‘-r’ so that it copies recursively (‘-p’ preserves permissions but this is pointless since you new install will change this).

sudo cp -brp /home/USER /mnt/macos/Users/Shared/ubuntuBackup

To unmount OS X:

sudo umount -t hfs /dev/hda3 /mnt/macos

Or just log out if it refuses after two trials, although you should probably wait because its refusal to unmount suggests that there is an ongoing operation.

To copy back:

sudo mount -t hfsplus -o rw /dev/hda3 /mnt/macos
sudo cp -brp /mnt/macos/Users/Shared/ubuntuBackup /home/USER

This will dump the backed up USER account /home/USER into the the new /home/NEW_USER/ORIGINAL_USER. As you can see, you end up with a three level tree structure, whereas you started out with a two level structure (/home/WHAT_EVER_USER/). The only work around I can see is to simply drag and drop in nautilus or xffm, possibly one by one, thus copying straight into the new /home/USER and duplicating the original two level structure. Then delete the folder left over.

Medwards has just informed that the copying of a ‘.DOCP’ or ‘.MCOM’ file, invisible files, into the backup and then reintroduced into the fresh system (where these may already exist) might cause problems with Gnome or KDE. The solution is to identify the older duplicate and delete. Thanks medwards. (The GUI fix in the above paragraph which details moving documents, not dirs, will avoid this problem.)

In the worst case scenario pass:

/home $ ls -al

to see if there are any of these duplicates in ‘home’ and then the older file’s deletion should fix related issues.

He also brought up the issue of copying over a previous home dir as having permissions problems, as I suspected. This may be a problem even if both the old and new users have the same user name because they may have different UIDs. The solution is simple:

sudo chown -R USER:USER /home/USER

Maurice Cepeda
a.k.a. Chascon

This is licensed under the Attribution-NonCommercial-ShareAlike 3.0 Unported Creative Commons License. All brands mentioned are properties of their respective owners. By reading this article, the reader forgoes any accountability of the writer. The reading of this article implies acceptance of the above stipulations. The author requires attribution –by full name and URL– and notification of republications.

This article may be outdated and of historical value.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s