Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Ubuntu This forum is for the discussion of Ubuntu Linux.


  Search this Thread
Old 01-28-2008, 03:09 PM   #1
Senior Member
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,818

Rep: Reputation: 135Reputation: 135
Backup/restore and/or cloning of a hard drive Ubuntu 7.10

I have 7.10 installed and working to my liking. So now it is time to make a backup. For my first try I used Norton Ghost 8 and made a complete hard drive image. I restored it to a like model drive. It does not boot - Grub error 15.

So I am thinking that the MBR is hosed and perhaps Ubuntu installs Grub there - it did not give me a choice. With Fedora I always installed Grub on /dev/sda1. I copied the MBR from the first drive to the second thusly:

from the original drive...
dd if=/dev/sda of=/media/myusbdrive/backup.mbr count=1 bs=512

to the new drive...
dd if=/media/myusbdrive/backup.mbr of=/dev/sda count=1 bs=512

Still no luck. I tried backing up and restoring the partitions using g4l which I have used successfully with Fedora (providing I do no use LVMs). Still no success.

I installed Ubuntu 7.10 from scratch on the new drive. I then restored the g4l images of the partitions. Now I can boot however I am told "...your home directory is /home/ken... it is not present..." I looked at the drive from the live CD and the directory and files are present.

Which gets me to I think the root cause (pardon the pun). I looked at the fstab file and the partitions are identified with UUIDs. They are of course different on the new drive after the format/install although I am not sure why the initial Ghost copy did not set them the same as the originals??? So My next step will be to edit the fstab values to match the values on the disk. I believe I can determine these with ls -l /dev/sda -by-uuid.

Here is my unresolved question... Where are the UUIDs stored by Grub? and how can I edit them when Grub will not boot? I believe that is why my first attempt at cloning did not work.

So now my plan of attack is:

1 - take the dog for our afternoon walk
2 - shut down windoze and pull the windoze drive tray
3 - install my "new" Ubuntu drive
4 - boot from the live CD
5 - make the fstab changes as discussed above



p.s. I think a Microsloth refuge must be working on Linux now. Smacks of Windoze SIDs. Is there a UUID changer for Linux similar to the SID Walker from Symantec???
Old 01-28-2008, 08:13 PM   #2
Simon Bridge
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Use free software - rsync say - to handle backups.

Grub Error 15 : "Error while parsing number"
This error is returned if GRUB was expecting to read a number and encountered bad data.
... of course - changed UUIDs will do this too. AFAIK: UUIDs are stored on the drive. This means that dd method should preserve these.

Have you tried simply:

dd in=/dev/sda of=/media/clone.img
dd in=/media/clone.img of=/dev/sda

You will only have a problem with fstab, so the easy workaround is to not use uuids in fstab.
Old 02-01-2008, 05:06 PM   #3
Senior Member
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,818

Original Poster
Rep: Reputation: 135Reputation: 135
Thanks Simon for your detailed reply. A simple dd will not do what I am looking for long term. I have partitioned my hard drive thusly:

/ 10 GB
/home 20 GB
/vmworld the rest ~ 50 GB for VMWare and virtualbox images

I can hot backup /home and /vmworld (which represent the bulk of my data) to another drive or server. rcsync might be of use in this regard. What I am trying to accomplish is to snapshot the Operating System as installed and configured in the event of a hard drive failure or some mischief which renders the OS or installed programs unusable.

I removed UUIDs from fstab and from /boot/grub/menu.lst and the machine would boot. However, I could not login as it was unable to access my /home/ken directory structure. I received an error message relating to permissions. I wonder if permissions are assigned based on the UUID where the directory or file is created???


Old 02-02-2008, 08:47 PM   #4
Senior Member
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,818

Original Poster
Rep: Reputation: 135Reputation: 135

Stranger than truth... It seems the my problem resulted from the OS not being able to find the swap partition(?) I performed the following process successfully:

1 - I transferred the drive partition layout from the original to the new drive using sfdisk (easier than doing it manually)

2 - I transferred the boot sector using dd as described earlier.

3 - I moved the / and /home partitions using g4l (Ghost for Linux) which is basically a menu driven dd process.

4 - I booted the new drive and received the same error re. my /home/ken directory not being available to me.

5 - I booted the live CD and made the following repairs:

- determine the UUID for partitions sda1, sda2, sda3, sda4 using sudo vol_id -u /dev/sda1 etc. and recorded these

mkdir /repair
mount /dev/sda1 /repair
I then examined fstab
sudo gedit /repair/etc/fstab

The UUIDs for sda1 (/) and sda3 (/home) matched as I had in effect copied them with dd.

The UUID for sda2 - the swap partition - did not match so I replaced the value in fstab with the value determined with vol_id -u.

The UUID for sda4 (/vmworld) also did not match as I had not restored any data to this partition for this test. I updated fstab for this one also while I was at it.

After rebooting to the new hard drive I was good to go. The /vmworld file system was available although I had to change permissions on it so I could copy my virtual box files back. Honestly I do not recall formatting this partition(?) I intentionally did NOT format the other 3 in this test. Perhaps sfdisk also copies the format - I will have to look that up.

So I now have a proven cold iron backup and restore process. Time to do some more experimenting with Ubuntu as I know how to recover from whatever disasters I might create.




Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Backup and Restore Ubuntu System using Sbackup LXer Syndicated Linux News 0 03-21-2007 05:01 PM
Cloning a hard drive! Shioni Linux - General 6 03-19-2006 12:39 PM
Hard drive cloning sabeel_ansari Programming 2 02-14-2006 02:40 PM
Cloning a hard drive davcefai Debian 3 11-28-2005 06:36 PM
Cloning Hard Drive rls Linux - Software 3 08-23-2003 03:32 PM > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 07:23 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration