LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   a question on cloning using clonezilla or similar (https://www.linuxquestions.org/questions/linux-general-1/a-question-on-cloning-using-clonezilla-or-similar-4175507223/)

beopen 06-06-2014 04:00 AM

a question on cloning using clonezilla or similar
 
hi,
i have a 160gb hdd on which is installed windows and ubuntu. Ubuntu is divided in 3 partitions [boot,root,home].
I have another hdd of 500gb on which a debian is installed. and about 200gb free space is there right now.
I want to ask is it possible to clone the ubuntu of the first drive into the free space of the second drive without destroying debian.
I have not done before any imaging or cloning.

So is the transfer of the existing system possible for the facts given ?
pls suggest

maples 06-06-2014 07:37 AM

That should pe possible. Are you just cloning as a backup, and only need an image, or do you need an actual clone of the partitions?

If you only need an image, then you want to format the free space (NOT fat32, you need to have BIG files). For the puropses of this example, I will assume that /dev/sda3 is the /boot partition, /dev/sda5 is the / partition, and /dev/sda6 is the /home partition. You will most likely need to do this from a live cd. Mount the newly formatted partition to /mnt. Then, to backup the boot partition, run (as root)
Code:

dd if=/dev/sda3 of=/mnt/boot-image.img
BE VERY CAREFUL NOT TO MIX UP THE "OF" AND "IF"
The other 2 are fairly simple:
Code:

dd if=/dev/sda5 of=/mnt/fs-root-image.img
dd if=/dev/sda6 of=/mnt/home-image.img

There is probably a way that you could pipe it through gzip or something to compress it and save space, but that's beyond my knowledge.

99% of this is just an application of http://www.linuxquestions.org/questi...ommand-362506/ It's a really good (and interesting) read, even if you don't think you'll use it much.

jefro 06-06-2014 03:35 PM

I might be tempted to resize the deb then use partimage or gparted to move the other linux. Then fix grub.

maples 06-06-2014 03:43 PM

Quote:

Originally Posted by jefro (Post 5183740)
I might be tempted to resize the deb then use partimage or gparted to move the other linux. Then fix grub.

I thought Gparted only resized partitions? Or are you referring to the LiveCD?

beopen 06-07-2014 08:11 AM

Quote:

Originally Posted by maples (Post 5183505)
That should pe possible. Are you just cloning as a backup, and only need an image, or do you need an actual clone of the partitions?

i did not get the difference between the two questions which you asked. The first one is understandable the latter i did not get what you are meaning.
Nevertheless from my side let me clarify what i am intending.
I was looking at a mix of both. That is the first part of your query cloning as a backup and keep an image.
And the 2nd is to really clone one system now to see if it works and thus my first objective of keeping image backup is fulfilled.

So taking the image backup as you mentioned using the dd command is the way to go?

maples 06-07-2014 01:56 PM

Quote:

Originally Posted by beopen (Post 5184038)
i did not get the difference between the two questions which you asked. The first one is understandable the latter i did not get what you are meaning.
Nevertheless from my side let me clarify what i am intending.
I was looking at a mix of both. That is the first part of your query cloning as a backup and keep an image.
And the 2nd is to really clone one system now to see if it works and thus my first objective of keeping image backup is fulfilled.

So taking the image backup as you mentioned using the dd command is the way to go?

Sorry, I could have wrtiien that better...let me rephrase it.
Do you need something just to back it up in case something bad happened to your hard drive? Or are you trying to duplicate the partitions, so that your second hard drive can be botable?

The suggestion that I posted would give you three backup files. The second hard drive would NOT be able to boot. So it looks like the suggestion I posted will not be completely adequate.

jefro 06-07-2014 03:22 PM

http://gparted.org/display-doc.php?n...aste-partition

Almost every live disto either has gparted or can easily add it. You shouldn't normally do clones and copies on systems that are booted from.


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