LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-30-2013, 02:39 AM   #1
Knightron
Senior Member
 
Registered: Jan 2011
Location: Australia
Distribution: OpenSUSE
Posts: 1,390
Blog Entries: 7

Rep: Reputation: 164Reputation: 164
How can i clone my partion?


Hello, so i've just finished setting up my main partition. I would like to do some experimental things that have the potential to make my main partition unbootable. Instead of risking that, i would prefer to clone the partition onto my second partition and tamper with the clone instead.
My problem is, that my main partition is about 65 gb, while my secondary partition is only about 60 gb. I tried using clonezilla but it wouldn't work because the source is larger than the target. Only about 18 gb of the 65 have been used, so theoretically i'd think it's possible to do what i desire, but i just don't know how.
Any suggestions?

thanks.
 
Old 11-30-2013, 02:46 AM   #2
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 505

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by Knightron View Post
My problem is, that my main partition is about 65 gb, while my secondary partition is only about 60 gb. I tried using clonezilla but it wouldn't work because the source is larger than the target.
Did you choose compression option while cloning with CloneZilla?
 
Old 11-30-2013, 03:02 AM   #3
Knightron
Senior Member
 
Registered: Jan 2011
Location: Australia
Distribution: OpenSUSE
Posts: 1,390
Blog Entries: 7

Original Poster
Rep: Reputation: 164Reputation: 164
no i didn't, does that exclude the unused space?
 
Old 11-30-2013, 03:10 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,838

Rep: Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822
Did you read the very first bullet point under "Limitations:" on the Clonezilla home page ?.

In situations like this I prefer to use a filesystem aware tool - say "cp" or "rsync" - from a liveCD. You'll have to probably update the bootloader, but you were probably going to need to do that anyway.
 
1 members found this post helpful.
Old 11-30-2013, 03:11 AM   #5
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 505

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by Knightron View Post
no i didn't, does that exclude the unused space?
I've cloned using CloneZilla around 7-8 times, it uses occupied space only. I have never used without compression... but, i think, even used uncompressed, it should not take unused space.
 
Old 11-30-2013, 04:36 AM   #6
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 505

Rep: Reputation: 137Reputation: 137
Quote:
Limitations:
  • The destination partition must be equal or larger than the source one.
I think its only applicable for device-to-device cloning. In the event destination partition is less than source partition, then the option 'Device-to-Image', and then subsequently under 'SaveParts' selecting the required partition(s) to backup can be done.

Note: I have never restored root (/) partition, so i cant confirm it will work (device-image). Please try in Virtual Machine before applying to live machine.

Last edited by mddnix; 11-30-2013 at 04:39 AM.
 
Old 11-30-2013, 06:04 PM   #7
Knightron
Senior Member
 
Registered: Jan 2011
Location: Australia
Distribution: OpenSUSE
Posts: 1,390
Blog Entries: 7

Original Poster
Rep: Reputation: 164Reputation: 164
Well, i booted up gparted and used cp, re-set up lilo from the Slackware install media and it booted. Great. thank you.
To anyone else whom might read this with the same intention, don't forget to edit your fstab before booting, i didn't and it corrupted my main partition; luckily i had made a backup earlier that day with Clonezilla.
 
Old 11-30-2013, 07:44 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,838

Rep: Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822Reputation: 1822
Another thing I meant to mention is fsarchiver - good if you want a verified backup for "long-term" storage. Not that useful as a day-to-day backup, but might be a good fit here. I use it when screwing with partition setups, and may need to rebuild a system back to where it was on a different partition/filesystem type.
 
Old 11-30-2013, 09:04 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
Most partitions don't need to be copied bit by bit. Rsync, tar, cpio and other simple file by file copy tools may be best choice.

If you want you can use dd if=/dev/sdx of=some mount on the second partion. but pipe it to gzip.

Example from a very old kernel.

dd if=/dev/hdx | gzip > /path/to/image.gz

# dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c > /mnt/sda1/hda.img.gz


You'd most likely use sdx instead of hdx.

Gparted can be used also.


Partimage might do fine also but I haven't used it in a long time.

Last edited by jefro; 11-30-2013 at 09:05 PM.
 
  


Reply


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
ext3 partion add in 8eLVM partion jitenderana Red Hat 4 10-12-2011 07:47 AM
I need to Clone a Red Hat drive and install clone in HP server drummer54 Linux - Newbie 14 03-07-2009 05:15 PM
problem mounting a linux partion from another ext3 partion fkeith Linux - Hardware 1 10-14-2007 08:33 PM
How to clone partion structure which includes LVM pembo13 Linux - General 1 05-24-2005 01:08 PM
how do i move files from my windows partion to my linux partion awesome_man Linux - Newbie 2 01-30-2004 01:51 PM


All times are GMT -5. The time now is 04:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration