Linux - NewbieThis 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
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.
There are various ways on doing that, if you have the necessary experience you can do it with the 'dd' command. If you prefer a GUI then have a look at something like CloneZilla.
dd is good but it could create havoc if used incorrectly. CloneZilla should be fine with it. The menu driven process should ease the usage as well as reduce the human errors with all the confirmation messages.
There are various ways on doing that, if you have the necessary experience you can do it with the 'dd' command. If you prefer a GUI then have a look at something like CloneZilla.
Kind regards,
Eric
Ok sir , I'll definately try out clonezilla, it's gr8 to know as the alternative of norton ghost.
is all one needs to clone sda (250) into sdb (500Gb). You don't get anything simpler than that.
The red bit is optionally to accelerate the process as dd default to bs=512 if not specified. 32256 is one complete track of 63 sectors x 512 bytes per sector.
After cloning every binary bit is exactly the same in both disks. The 500Gb disk will have a partition table occupying the first 250Gb space and so the partitions can be resized using Gparted.
I prefer dd as it is a fundamental command of BASH and so you can do it with every Linux.
In cloning if one of the disks is hooked to a USB then the cloning speed can drop to 20 to 12Mb/s. Internal hard disks can be cloned at 80 to 45Mb/s depending on the hard disk model and CPU.
I believe Clonezilla has the advantage of speeding up the process a bit if there is a large empty space in the hard disk as dd copy only knows "1" and "0" and has no concept of data or space. Having said that Clonezilla is based on dd and so are many cloning software.
is all one needs to clone sda (250) into sdb (500Gb). You don't get anything simpler than that.
The red bit is optionally to accelerate the process as dd default to bs=512 if not specified. 32256 is one complete track of 63 sectors x 512 bytes per sector.
After cloning every binary bit is exactly the same in both disks. The 500Gb disk will have a partition table occupying the first 250Gb space and so the partitions can be resized using Gparted.
I prefer dd as it is a fundamental command of BASH and so you can do it with every Linux.
In cloning if one of the disks is hooked to a USB then the cloning speed can drop to 20 to 12Mb/s. Internal hard disks can be cloned at 80 to 45Mb/s depending on the hard disk model and CPU.
I believe Clonezilla has the advantage of speeding up the process a bit if there is a large empty space in the hard disk as dd copy only knows "1" and "0" and has no concept of data or space. Having said that Clonezilla is based on dd and so are many cloning software.
yes dd is good ,but for dd will I have to boot from 250 GB with system connected to 500 GB . And then I have to increase the size of the cvs repository partition , for this will I have to make the 500 GB LVM ,then cloning or what is the procedure ?
The process is read a record, which is the block size defined by the parameter bs, from the input device and write on the output device. The process is repeated until the number of records exhausted in either the source or the target disk.
In your case the cloning will stop after the first 250Gb has been cloned and no more record can be read from the sda. The target 500Gb disk will show first 250Gb identical to the source disk and the second 250Gb being unallocated space.
Since I suggest bs=32256 bytes so the first record will be cloning the first track of 63 sectors. The first sector is the MBR and has the partition table so you do not need to do anything with the 500Gb disk which can be a raw disk directly from a purchase as you are intentionally forcing the 500Gb hard disk to have the same partition table of the source 250Gb disk.
In dd you create in the target disk a 100% mirror image of the source disk. It will be a LVM if you have it in the source. After cloning you can do whatever you like with the target disk. Enlarging the size of a partition should be a fast process with Gparted and even faster if it is a LVM.
Thank you for explaining me a lot.But I have not performed these type of actions by dd before . So I have some doubts to ask :
1) 250 GB hdd is sda, it has a no of partitions(sda1,sda2...), So by dd after copying them to sdb(500 GB), will that sdb be converted into same (sdb1,sdb2,..) ?
2) Is it possible to resize(increase/decrease) the size of a partition(let sda4) can be increased without makiing the sdb LVM ?
Thank you for explaining me a lot.But I have not performed these type of actions by dd before . So I have some doubts to ask :
1) 250 GB hdd is sda, it has a no of partitions(sda1,sda2...), So by dd after copying them to sdb(500 GB), will that sdb be converted into same (sdb1,sdb2,..) ?
2) Is it possible to resize(increase/decrease) the size of a partition(let sda4) can be increased without makiing the sdb LVM ?
1) Yes, dd will create the partitions as well as populating them with data.
2) Yes, partition sizes can be changed as long as there is adjacent space to grow the partition into. After growing he partition you will want to grow the file system. ext2/ext3/ext4 file systems can be resized using the resize2fs command; if it is not given a new size it defaults to using the entire partition.
In this LQ post, japa-fi sugests using conv=sync,noerror on the dd command line in case dd encounters read errors. I'm not convinced; it would be better to fail rather than write an inexact copy but I may be misunderstanding something.
If the source disk is active during the copy, dd will not create an exact "point-in-time" copy. Corruption is possible, for example you might create directory entries pointing at non-existent data blocks. For this reason you should not have any of the file systems on the source disk mounted during the copy. If it is not possible to run the system like that, it requires booting another OS to do the copy, for example Knoppix from DVD.
I will answer the two points differently as follow
(1) dd duplicates the binary pattern of one hard disk to another. So if the source has partitions so the cloned target will be too as the two are exactly the same. dd therefore will not "create" partitions by itself. It copies just the binary bits of "1" and "0" of the hard disk. Technically dd can therefore clone any operating system or any number of them if the whole disk is copied. dd differs from other copying commands because it has no concept of the filing system. The target disk always boots exactly like the source because the boot sectors, MBR and partition table, which aren't parts of the filing systems, are faithfully mirrored.
(2) To resize a partition is a system utility provided by special software like Gparted which deals with a lot more filing systems than resize2fs. dd can successfully copy the disk with which a Linux is running to host dd. dd copies the information from the hardware "device" while the operating Linux occupies mainly in the ram. A user should not actively changing the data of the source disk while it is being cloned. That should be common sense. Thus not mounting the partitions of the source disk is a safe approach but not mandatory. I have cloned the source hard disk while running a Linux on it many times but I do agree a safer approach is to use a Live CD.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.