LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


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

Rep: Reputation: 174Reputation: 174
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

Later,

Ken

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, 07: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.
http://www.sanitarium.net/golug/rsync_backups.html
http://www.mikerubel.org/computers/rsync_snapshots/

http://www.informationweek.com/softw...urce/171200965

Grub Error 15 : "Error while parsing number"
This error is returned if GRUB was expecting to read a number and encountered bad data.
http://www.linuxquestions.org/questi...ror-15-431469/
... of course - changed UUIDs will do this too. AFAIK: UUIDs are stored on the drive. This means that dd method should preserve these.
http://ubuntuforums.org/showthread.php?t=599599

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, 04:06 PM   #3
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
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???

Regards,

Ken
 
Old 02-02-2008, 07:47 PM   #4
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Talking

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.

Cheers,

Ken
 
  


Reply



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 04:01 PM
Cloning a hard drive! Shioni Linux - General 6 03-19-2006 11:39 AM
Hard drive cloning sabeel_ansari Programming 2 02-14-2006 01:40 PM
Cloning a hard drive davcefai Debian 3 11-28-2005 05:36 PM
Cloning Hard Drive rls Linux - Software 3 08-23-2003 02:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 05:15 AM.

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