[Dorset] 'Cloning' a Disk when the Partitions are not identical
Hi, As you may have gathered from yesterday's error, I obtained a Dell Optiplex from atechmedia and am now trying to copy my existing software from the old 250Gb hard drive to the 1TB drive in the Optiplex. Here is the setup on the 250GB drive: sda1/ ext438GB sda2/home ext4210GB sda3swapswap4GB Here is what I'd like to end up with on the new drive: sda1/ ext440GB sda2/home ext4250GB sda3swapswap8GB I have both discs connected and the partitioner and disk utility programs can see them OK. (Currently the 250GB drive is mounted at sdb.) I initially thought I could do this with Redo Backup Live! which I have successfully used in the past (On Windows boxes). The problem is that although Redo will let me take an image of individual partitions, it will only restore to a drive not a partition, so it b**s up the partition table and only lets me copy one partition. I then tried booting into Kubuntu Live and copying each disc partition as files (I'm not sure it will work for the / partition, but thought it worth a try). The problem is that the discs are mounted read-only and I'm concerned that is I copy as root, I'll end up with files that are all owned by root in my home partition. So to 'clone' these partitions, what is the best approach? (I'll need to do this all over again when the SSD Drive turns up :-) ) -- Terry Coles -- Next meeting: Bournemouth, Tuesday, 2015-09-01 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread: mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING Reporting bugs well: http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR
Re: [Dorset] 'Cloning' a Disk when the Partitions are not identical
Hi Terry, The tools I have used for this sort of thing are Clonezilla and GParted. Clonezilla to copy from one disk to another, and GParted to resize partitions. There are live CDs for each, although GParted is in most Linux distros. So I would do it in two stages, first clone, then resize/move the partitions. Clonezilla won't work where the target drive is smaller than the source, which is a problem I've had with SSDs. http://www.clonezilla.org/ http://gparted.org/ -- Andrew. On 12/08/2015 13:13, Terry Coles wrote: Hi, As you may have gathered from yesterday's error, I obtained a Dell Optiplex from atechmedia and am now trying to copy my existing software from the old 250Gb hard drive to the 1TB drive in the Optiplex. Here is the setup on the 250GB drive: sda1/ ext438GB sda2/home ext4210GB sda3swapswap4GB Here is what I'd like to end up with on the new drive: sda1/ ext440GB sda2/home ext4250GB sda3swapswap8GB I have both discs connected and the partitioner and disk utility programs can see them OK. (Currently the 250GB drive is mounted at sdb.) I initially thought I could do this with Redo Backup Live! which I have successfully used in the past (On Windows boxes). The problem is that although Redo will let me take an image of individual partitions, it will only restore to a drive not a partition, so it b**s up the partition table and only lets me copy one partition. I then tried booting into Kubuntu Live and copying each disc partition as files (I'm not sure it will work for the / partition, but thought it worth a try). The problem is that the discs are mounted read-only and I'm concerned that is I copy as root, I'll end up with files that are all owned by root in my home partition. So to 'clone' these partitions, what is the best approach? (I'll need to do this all over again when the SSD Drive turns up :-) ) -- Next meeting: Bournemouth, Tuesday, 2015-09-01 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread: mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING Reporting bugs well: http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR
Re: [Dorset] 'Cloning' a Disk when the Partitions are not identical
Hi Terry, Here is what I'd like to end up with on the new drive: sda1/ ext440GB sda2/home ext4250GB sda3swapswap8GB ... I then tried booting into Kubuntu Live and copying each disc partition as files (I'm not sure it will work for the / partition, but thought it worth a try). The problem is that the discs are mounted read-only and I'm concerned that is I copy as root, I'll end up with files that are all owned by root in my home partition. You can copy the contents of a partition from one Linux block device to another, but you wouldn't normally use cp(1) to do it. If you're copying the bytes of a partition then the filesystem is preserved along with the owner, etc., of files since that metadata is just bytes to the copier. So to 'clone' these partitions, what is the best approach? I'd use gparted, as Andrew said, and from a live recent Linux distro. There's two distinct things; the size of the partition, and how much space the filesystem is set up to `own' in the partition. So to copy and enlarge the partition and filesystem is a multi-stage thing. gparted will let you copy the partition from one disk to another, enlarge it, and it will then have the filesystem grow to have that extra space within its remit. You can tell it multiple actions and it starts them all when you say. Whether you give it several small tasks, or one long one and cross your fingers is personal preference. IIRC gparted will also change the UUID of a filesystem so the two copies don't clash. That may cause issues if your /etc/fstab is referring to filesystems by UUID. Cheers, Ralph. -- Next meeting: Bournemouth, Tuesday, 2015-09-01 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread: mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING Reporting bugs well: http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR