Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
With this you'll be copying one partition to another partition on the same disk. Run 'fdisk -l' as root to show you what disks and partitions are available to you. Also if the size of your target partition is smaller than your source partition then you may overwrite more than the target partition if there is another partition behind it instead of free space or the process may halt if it's the last partition on the disk without any free space left after it.
*The command centos123 showed you clones a whole disk. This may be easier if you've got two similarly sized disks and the target disk doesn't hold anything you'd want to keep anyway.
unspan had wrote true...command i given is to clone whole disk.
but one thing you should remember your cloned disk will boot only in those pc whose configuration is same as source pc/server..
means you should have both machine hardware configuration same.else it will not boot or create issue or chance to get .corrupt ....
I wonder but I think it's safer if you just copy the files with 'cp -a' with /dev/sda3 mounted somewhere as well other than root like /mnt/system. It probably defragments your files as well
Also if the size of your target partition is smaller than your source partition then you may overwrite more than the target partition if there is another partition behind it instead of free space or the process may halt if it's the last partition on the disk without any free space left after it.
This I don't observe. If I:
Code:
# dd if=/dev/zero of=/dev/sda1
I will get at one point no space left. And the remaining partitions are still intact.
I wonder but I think it's safer if you just copy the files with 'cp -a' with /dev/sda3 mounted somewhere as well other than root like /mnt/system. It probably defragments your files as well
Well, since the sda3 partition was the root file system, a cp would (try to) copy some (logically) infinite files (/dev/null, /dev/zero, /dev/random, etc.) to the other partition. Unless you have an unlimited partition size, and can wait for the enegery death of the universe, this may not be a wise thing to do. Even a bind mount of an active root partition would, I believe, not help.
For the O.P., consider a Google of clonezilla.
Last edited by PTrenholme; 09-11-2012 at 06:27 PM.
Well, since the sda3 partition was the root file system, a cp would (try to) copy some (logically) infinite files (/dev/null, /dev/zero, /dev/random, etc.) to the other partition. Unless you have an unlimited partition size, and can wait for the enegery death of the universe, this may not be a wise thing to do. Even a bind mount of an active root partition would, I believe, not help.
For the O.P., consider a Google of clonezilla.
The last time I did that (mounted in /mnt/system), I don't think it does. Perhaps if you do it with root where /dev is mounted, but not on /mnt/system.
Or maybe it doesn't always work. I did it a long time ago when I dup'ed my system to try building new packages.
Update: I just tried again and it does work. I tried copying the dev directory from there.
Last edited by konsolebox; 09-12-2012 at 12:42 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.