LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 04-26-2010, 04:27 AM   #1
kahlil88
Member
 
Registered: May 2005
Location: Mendocino, CA
Distribution: Arch Linux
Posts: 170

Rep: Reputation: 30
Partition type/size quirks after dd clone


I decided to clone my OS partition to another hard drive using dd (without any special options). I created the target partition before cloning (25GB) but it shows up as 21GB (source/original partition's size) in df, as well as ext2 instead of ext4.
 
Old 04-26-2010, 05:02 AM   #2
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 595

Rep: Reputation: 115Reputation: 115
  1. You would be better off using rsync to do the job as you don't need identical data structures, you just need identical data.
  2. If you are going to use dd and only on an individual parition, you would be better off using sfdisk to clone the parition structure and then increase it after.
  3. You have cloned a filesystem that is 21GB in size. It doesn't matter how big the new partition is, the filesystem is still only 21GB. You will need to use resize2fs to increase the size of the filesystem to match the surrounding partition.
  4. Check your fstab or manual mounting options to ensure you are mounting the new partition's filesystem as ext4.

Last edited by zordrak; 04-26-2010 at 05:03 AM. Reason: OL
 
Old 04-26-2010, 05:09 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
If you also cloned the first 512 bytes of the disk, you copied the partition table as well as cloning the partition. Maybe you should look up the definition of the word clone in a dictionary. Your result wasn't a quirk. Copying the filesystem exactly results in the same filesystem.

There is a example of piping files from one drive to another in the tar info pages. See section 4.6 for the details. Make sure you don't include /sys, /proc, /lost&found, /media, or /mnt in the directories to copy. It would be a waste of time to copy /tmp. It would also be better to use a live distro disk so the original filesystem is off line.
 
  


Reply

Tags
clone, harddrive, partition


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advice on whether to clone/re-partition/re-install OR wipe disk/re-partition/use VM linus72 Linux - Newbie 6 04-16-2009 03:41 AM
Clone root to = or > partition on diff type hd quickly! suguru Linux - Software 13 08-09-2004 01:53 PM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 01:55 PM
Size and type of linux partition? brumela Linux - General 9 05-12-2004 02:18 PM
fdisk partition size differs from mounted partition size jimieee Linux - General 3 10-15-2003 04:10 AM


All times are GMT -5. The time now is 09:40 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration