bug-ddrescue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to clone to a smaller HDD without messing up partitions?


From: Dr. Anonymous
Subject: Re: How to clone to a smaller HDD without messing up partitions?
Date: Sat, 26 Oct 2019 11:54:10 +0300

Hello! The most simple is to limit the source copy size using -s to just cover 
the partitions. For example, having source as /dev/sdc with 2 partitions using 
less ythen 70 Gib and destination as /dev/sdb:
sudo ddrescue /dev/sdc /dev/sdb ~/log.log -s70Gi
So the program will copy only the first 70 Gib of the source to destination.
It is better to know the exact size of the space used by partitions, in 
sectors, can be done with fdisk -l
Then use ddrescue -s140000000s (for 140 mln sectors).

----- Original Message ----- 
From: "Ketil Froyn" <address@hidden>
To: "Shahrukh Merchant" <address@hidden>
Cc: "dd-rescue" <address@hidden>
Sent: Saturday, October 26, 2019 10:30 AM
Subject: Re: How to clone to a smaller HDD without messing up partitions?


>I have a different suggestion. Set up your target device with some sort of
> deduplication and/or compression. For example btrfs or zfs or vdo. Then you
> can clone to a file on the target, and hopefully you'll have space for the
> whole thing.
> 
> On Sat, Oct 26, 2019, 04:03 Shahrukh Merchant <address@hidden>
> wrote:
> 
>> I have a 500 GB HDD (source) that I want to clone to a 320 GB HDD
>> (destination). Both are MBR. Only about 60 GB of the source drive is
>> actually in use (in 2 partitions), the rest (400+ GB) is in unallocated
>> space.
>>
>> I will ask more specifically in two different ways:
>>
>> 1. I would like to tell ddrescue to clone the entire drive, i.e.,
>>
>> ddrescue -f -n /dev/sda /dev/sdb
>>
>> BUT with options that effectively say "and don't worry if you run out of
>> space on the destination drive--just stop copying since the important
>> stuff is at the start anyway." Can I do that, and how? (And other than
>> relying on the Windows Disk Management visual to believe that the
>> unallocated space is all at the end, which it seems to be, is there some
>> other tool I can use to let me confirm that explicitly?)
>>
>> 2. If the answer to the above is "No" or "Not recommended," then I would
>> have to do the clone partition by partition. There are two partitions on
>> the source disk as follows:
>>
>> lsblk version
>> -------------
>> sda             465.8G
>>   -sda1 RECOVERY   9.8G ntfs
>>   -sda1 OS        54.9G ntfs
>>
>> Windows 7 Disk Management version
>> ---------------------------------
>> Disk0 Basic/465.76 GB/Online
>> --------
>> 9.77 GB
>> Healthy (Active, Recovery Partition)
>> --------
>> OS (C:)
>> 54.93 GB (NTFS)
>> Healthy (Boot, Page File, Crash Dump, Primary Partition)
>> --------
>> 401.07 GB
>> Unallocated
>> --------
>>
>> So if I do the clone partition by partition, two things are not clear:
>>
>> (a) What is the sequence of commands I need to use (and how to I prepare
>> the destination drive in advance). Can I do, for example:
>>      ddrescue -f -n /dev/sda1 /dev/sdb
>>      ddrescue -f -n /dev/sda2 /dev/sdb
>> and have ddrescue figure out that I mean "put them in their
>> corresponding places on the destination drive based on how it was on the
>> source drive and fix the MFT so it does the right thing" (seems a lot to
>> ask for, but maybe it does!)?
>>
>> (b) How do I maintain the integrity of the destination drive w.r.t. the
>> MFT of that drive being properly configured (since it is not part of the
>> ddrescue copy, as I understand it, if I do a partition at a time), and
>> in terms of the destination drive booting fine in exactly the same way?
>>
>> Basically, the unallocated space at the end is the only part that I want
>> to be different, owing to the different in drive sizes.
>>
>> Thanks!
>>
>> Shahrukh
>>
>>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]