Welcome to the most active Linux Forum on the web.
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 05-15-2008, 08:36 AM   #1
Registered: Mar 2008
Posts: 43

Rep: Reputation: 15
NewB need help with partimage


I have a problem with cloning my debian box,

I did install debian on a computer,every thing is on one partition when I run cfdisk I see hda1 as boot and primery and hda5 as logical linux swap. now I want to clon this box to othere box with the same hardware.

I did add secound drive to my debian box then format then create a partition on it and formate it with ext3 file system.

I did these steps:
hdc1 is the new drive

with cfdisk
1. mkdosfs -F 32 /dev/hdc1
2. mkdir /mnt/hdc1
3. mount /dev/hdc1 /mnt/hdc1

hda is the oregianl drive with debian installed on it

dd if=/dev/hda of=/mnt/hdc1/my-hda.mbr count=1 bs=512

sfdisk -d /dev/hda > /mnt/hdc1/my-hda.sf

then use partimage and create a image of hda1 to hdc when I run
ls -l /mnt/hdc1

i can see


I did remove the hdc disk the one with image to the new box and in stall it as a primery dirve in this box I have othere empty drive so I did create a partition on the new drive and format it with ext3 file system.

then did these

dd if=/mnt/hdc1/my-hda.mbr of=/dev/hda
sfdisk /dev/hda < /mnt/hdc1/my-hda.sf
mkswap /dev/hda3

and with partimag

I put the sda1-image.000 to the new drive.

but when I reboot the box I get the error there is not boot device in the box (removed the drive with image).

Any idea what I do wrong here=


Old 05-15-2008, 10:30 AM   #2
Registered: Jul 2003
Location: NC
Distribution: Fedora,Mepis,Debian
Posts: 84

Rep: Reputation: 15
I have been experimenting along the same lines using the following tutorial:

I have seen the same result as you in some instances. Not sure the causes, once saw that the newly partition table was FAT (not ext3) and the swap was undefined. In another case, the grub menu.lst iel had to be changed from sda to hda (or vice versa). I don't have a handle on exactly how to do it reliably although I need to figure it out to clone a system multiple times.

K Scott
Old 05-15-2008, 10:46 AM   #3
Senior Member
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Originally Posted by shahin123 View Post
Any idea what I do wrong here?
Yes. It looks like you did a lot of things wrong. Instead of nit-picking every little thing, I will tell you what you need to do.

Use fdisk to partition your second drive (hdc). Start fdisk like this

# fdisk /dev/hdc

Use the 'n' command to create a new partition. Press 'p' to create a primary partition. Select '1' for the first partition. Make the size at least as big as your current partition. Leave enough room for a swap partition. Use the 't' command to change the type to ext3 (83) and make it bootable using the 'a' command.

Use the 'n' command to create your swap partition. Press 'p' to create a primary partition. Select '2' for the second partition. Make the size at least twice the size of your system RAM. Use the 't' command to change the type to swap (82).

Use the 'w' command to save your changes and exit fdisk.

Use partimage to restore your saved image. You can do this from the command line using

# partimage -b restore /dev/hdc1 /path-to-image/sda1-image.000

Mount your restored partition using these commands

# mkdir /mnt/system
# mount -text3 /dev/hdc1 /mnt/system

Install grub on your boot record using this command

# grub-install --recheck --root-directory=/mnt/system /dev/hdc

Unmount the restored partition using this command

# unmount /mnt/system

You should now be able to put the hard drive in the new system. You might have to modify "/boot/grub/menu.lst" to get the hard drive mapping correctly, but this is not usually the case.
Old 05-19-2008, 06:05 AM   #4
Registered: Mar 2008
Posts: 43

Original Poster
Rep: Reputation: 15
I did solve this issue in 2 ways,

After finishing putting the image on the new H.D :

1. Run fdisk /mbr

2. Install the grub from my debian install disk, by starting in rescue mode.

So thanks for all your info on this subject,



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
Partimage Earthling2 Linux - Newbie 9 05-27-2008 02:51 AM
partimage linuxmandrake Linux - Software 7 12-21-2005 08:59 AM
Suse Newb: Not Linux Newb rodericj SUSE / openSUSE 9 03-25-2005 10:03 AM
The first step to ascending newb status, acknowledging you're a newb :P LordRaven Member Intro 1 08-24-2004 05:05 PM
Help with Partimage?? maestro52 Linux - Software 6 01-17-2004 06:03 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:38 PM.

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