Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-03-2013, 11:51 AM   #1
LQ Newbie
Registered: Jan 2013
Posts: 8

Rep: Reputation: Disabled
help with imaging my Ubuntu laptop

This week I have acheived a very long time goal of mine to scrap Windows and move over to Linux on my laptop :-)
I have tried many times before over the years but allways failed to manage to do it.......

I now have my laptop all working and set up as I want it (and I must say I am very impressed with it)
but now I want to copy this over to my other laptop, but this what I expected to be really simple has baffled me for all of today - can someone please point me in the right direction before it drives me crazy


The other laptop is the same make/model although it has a different sized hard disk
Linux = xabuntu 12.04.1
The problem is that I have encrypted the hard disk (LVM) and so I can't just use Clonezilla (I think, as the hard drives are different sizes for one thing)

What I had planned to do was copy the files on my working laptop using
tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/media --exclude=/sys /
then do a basic install from DVD on the "new" laptop and then copy these files to it

all seems to work ok but when I restart the computer it wont boot

I am guessing there are some vital files I need to avoid overwriting - but for the life of me I can not figure out what they are???

Last edited by alanesq; 01-03-2013 at 12:36 PM.
Old 01-03-2013, 01:33 PM   #2
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 337

Rep: Reputation: 72
You could have just restored the backup without installing the new system first. You anyway overwrote it with the backup...

After restoring the backup you need to change /etc/fstab, and fix grub. Chroot into the new system and run 'update-grub' and install grub in mbr.
as root:
mount /dev/sdXY /mnt
cd /mnt
mount --bind /dev dev
mount --bind /sys sys
mount --bind /proc proc
chroot . /bin/bash
grub-install /dev/sdX
You should install grub to the disk, not to a partition, like sda - not sda1.

You should also have excluded /dev, but include dev/{console,initctl,null,zero} You can just delete the rest under /dev .

I have many times transfered Xubuntu to different machines (with rsync), but I haven't used LVM so I don't know if that is different.
Old 01-03-2013, 06:24 PM   #3
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
The first method I would probably try would be rsync running from a live CD on the as-yet-not-installed Linux laptop. First, build a rudimentary filesystem with a same or similar pattern of partitions and mountpoints. Hmm, that's starting to sound like work. Why not just do a fresh install? That saves the trouble of trying to bend the partition sizes of the older host to the newer one, and avoids all the encryption hassles.

--- rod.
Old 01-04-2013, 12:34 PM   #4
LQ Newbie
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks for the replies

I managed to run the commands suggested and I checked fstab is ok before rebooting
but it just comes up "cryptsetup: evms_activate is not available" :-(

Here is what is displayed at boot on the working laptop - boot screen
I suspect the problem is that the uuid is wrong when I try to restore the image to a different laptop?

Last edited by alanesq; 01-04-2013 at 02:36 PM.
Old 01-05-2013, 12:23 AM   #5
LQ Newbie
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
adnl info:

I tried restoring on a none lvm drive but it is still the same
i suspect it is something very basic I am not understanding ???

i just get the message "cryptsetup evms_activate is not available"
it seems to be looking for the ssid of the hard disk on my other computer

just a thought, but as I am restoring to an already running ubunto (basic install) should I exclude restoring the /boot folder?

Last edited by alanesq; 01-05-2013 at 04:38 AM.
Old 01-05-2013, 05:54 AM   #6
LQ Newbie
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Success :-) :-)

I excluded the /boot folder and it worked......I can't believe I have wasted 2 days of my life just to figure this out !

It doesn't seem to have restored everything, so I still need to figure out why this is
e.g. the desktop has copied over but apps I have installed don't seem to be installed, the wifi isn't set up etc.

what am I doing wrong?

Last edited by alanesq; 01-05-2013 at 06:10 AM.
Old 01-05-2013, 06:11 AM   #7
Senior Member
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,497

Rep: Reputation: 636Reputation: 636Reputation: 636Reputation: 636Reputation: 636Reputation: 636
You must exclude the files in /mnt, /media, /proc and /sys as you correctly did. However, you should have those directories present in your directory tree in the target machine. Creating them manually is easy (if you don't forget it, I always do). I am sure there is a way to tell tar to include the directories but not the files. Creating them manually might be faster than finding out how to do that.

Old 01-05-2013, 06:19 AM   #8
LQ Newbie
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
I am doing a basic install of Ubunto on the new machine, logging onto this and then restoring the archive file
this way I figure everything is set up already.

Turns out the missing out /boot idea was a false alarm, the backup didn't work, so it booted because the restore failed half way
I tried again and now all looks good but it then reports it cant load the drive in /boot
so I am still no better, although it looks like the problem is within the /boot folder

I was just about ready to give up with Linux, as if I can't back up my computer then I can't risk using it - i must have spent 20hrs on this :-(
but then there was a development - whilst it displays errors "the disk drive for /boot is not ready"... after a while it boots up and all is working great !

after much more time/stress I have finally done it :-)

Problem is now, I am not exactly sure how ;-)
I think the trick is dont backup /boot then despite the errors it will eventually boot and you then just have to edit the fstab (remembering the change of computer name)

but, in the process I booted from the install DVD, mounted the volumes and re configured grub (I don't think this was needed though)

Last edited by alanesq; 01-05-2013 at 01:25 PM.
Old 01-05-2013, 03:29 PM   #9
LQ Newbie
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Just an update in case anyone else has this problem:

I have tried re imaging my second laptop from scratch just to check - so this is what I do to get the image of my ubuntu laptop copied onto a similar spec other laptop:

I copy the files from the working laptop with tar, then copy this file to a USB hard disk
tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/media --exclude=/sys --exclude /boot /
I then install from the standard Ubuntu DVD onto the second laptop, then restore the above tgz file onto it with
tar xvpfz backup.tgz -C /
When this has finished edit /etc/hosts and /etc/hostname with the new computers name

then edit /etc/fstab (where it refers to a ssid I just change this to the name - e.g. //dev/sda1)
remember to change any reference to the computers name (as it has been changed above)

reboot - and the jobs a good un :-)

Can't belive how many hours of stress I have had to go through for this and it is so easy when you know how .....

Last edited by alanesq; 01-05-2013 at 03:35 PM.
Old 04-21-2013, 03:45 AM   #10
LQ Newbie
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
one other thing I have discovered:

If using hard disk encryption (as I do) make sure you also edit
and make sure the hard disks id number is correct

If you do not do this then when updates happen it will stop the computer booting


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
imaging ubuntu thedoctor Linux - Software 1 01-05-2010 05:35 AM

All times are GMT -5. The time now is 07:19 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