Replacing a Disk with a Smaller One Using Clonezilla Live

Replacing a Disk with a Smaller One Using Clonezilla Live

A Clonezilla Live Tutorial Replacing A Disk With A Smaller One Using Clonezilla Live version 0.2 – 2012-02-25 This document is currently a draft in test mode! Feel free to report any error or to suggest enhancements to the author. Replacing A Disk With A Smaller One Using Clonezilla Live Summary 1. Presentation ...................................................................................................................... 4 1.1. Prerequisites .............................................................................................................. 4 1.2. Process Overview ..................................................................................................... 4 1.3. Estimated Duration ................................................................................................... 5 2. Preparing The System ...................................................................................................... 7 2.1. Source Disk Processing ............................................................................................ 7 2.2. Preparing The Target Disk ........................................................................................ 9 3. Replicating To The Target Disk ........................................................................................ 9 3.1. First Method: Direct Cloning (Disk To Disk) ........................................................... 9 3.2. Second Method: Using A Temporary Image ........................................................... 10 4. Windows FAQ ................................................................................................................ 11 5. References ...................................................................................................................... 11 6. Credits ............................................................................................................................ 12 7. License ............................................................................................................................ 12 2/12 Replacing A Disk With A Smaller One Using Clonezilla Live We sometimes change a PC disk, just because it is failing or because SSD replacements are smaller than standard mechanical ones or for whatever reason. When it comes to disk cloning or imaging, Clonezilla is usually the Libre software tool of choice: it’s efficient, fast and very well supported. There’s a drawback, though: Clonezilla can’t directly clone or restore to a smaller target than the source device. The Devil is in details, too! It happens that, within the same series of disks (same commercial reference), two of them are not strictly of the same capacity 1. Yet, a very small difference can make the cloning impossible. We all know that often, for optimisation sake, vendors are adjusting their own hardware providers, so this situation is certainly not uncommon. Then, how can we deal with these situations with our tool of choice? This is what we’re going to show here with a solution that works, at least for the author. Backup Your Data! Any action that touches disk structure, partitions and filesystems is a potential source of failure. You should never test on living data but on dedicated material and hardware. A backup of the data before any other action is highly advised! What This Document Is Not This document supposes that disk geometry is a topic known by the reader and that such tools like Clonezilla Live and GParted are well known. In other words, this document is in no way a manual explaining the uses of these tools. Its goal is just to introduce a solution to a common problem. 1 To ensure that two disks from the same vendor and type are from the same batch, check the model codes that are printed onto the drives. 3/12 Replacing A Disk With A Smaller One Using Clonezilla Live 1. Presentation Clonezilla Live is a Free software live CD that can clone or backup disks or partitions. Using Clonezilla makes it is easy to restore a disk to a previous state that had been saved at that time. In corporate environments, Clonezilla allows to create identical machines from one unique model configuration, whatever the underlying operating system. 1.1. Prerequisites Hardware • The target (replacement) disk. • (not mandatory but highly recommended) A spare device for temporary storage. Software • Clonezilla Live (version used here: v.1.2.12-10) ; • PartedMagic (or GParted or any similar tool) (version used here: v.6.7). 1.2. Process Overview Our starting point is shown at figure 1: we’ve got a running PC with a 30 GiB hard drive that we’d like to replace for a new 25 GiB disk. The source disk holds a Windows XP sp3 system on two partitions. The size of the first one is 19.58 GiB, the second is 10.42 GiB. Figure 1: Our starting point The process is a three-step one: first we set our source disk so that it can be cloned, second we partition the target disk according to the source disk partitioning and, third, we copy the data from the source to the target. Figure 2 shows how we are going to deal with the disk cloning. We ran our experiments in a virtual machine (VirtualBox v. 4.1.8) set up with three disks: a source disk (disk 1), with a Windows XP system on two partitions, a target disk (disk 2) and a temporary disk for backup (disk 3). Table 1 gives details about our three test disks. The following chapters give more details about the process which is not complicated. Somewhat lengthy if the source disk is big and holds much data, but not complicated at all. 4/12 Replacing A Disk With A Smaller One Using Clonezilla Live Figure 2: Overview of the disks cloning scheme disk capacity partitions disk 1 source 30 GiB Partition 1: 19.58 GiB, primary, NTFS, boot Partition 2: 10.42 GiB, primary, NTFS disk 2 target 25 GiB Partition 1: 14.65 GiB, primary, NTFS, boot Partition 2: 9.77 GiB, primary, NTFS disk 3 temporary At least One single partition, any Clonezilla supported file 5 GiB system (FAT, ext, NTFS, etc.) Table 1: Disks description 1.3. Estimated Duration What about the duration of the process? Of course, many parameters will interfere, the first of all being the size of data on the partitions to move. Our test system is, admittedly, quite “empty”. On the other hand, virtual machines are slower than actual ones. Anyway, we found the durations shown at table 2 below (your mileage may vary greatly...). 5/12 Replacing A Disk With A Smaller One Using Clonezilla Live Preparing source disk 50 minutes Defragmenting (MS Windows) 15 minutes Partition shrinking (GParted) 2 minutes Second partition moving (GParted) 25 minutes System checks (MS Windows) 5 minutes Preparing target disk 5 minutes Partitioning (GParted) 5 minutes Direct cloning (Clonezilla) minutes Cloning sda1 minutes Cloning sda2 minutes Imaging (Clonezilla) minutes Image creation minutes Image restoration minutes Overall, in case of direct cloning minutes Overall, using a temporary storage minutes Table 2: Process duration on the Windows test system Please note that: • The delays noted here are highly dependant on the actual data on disk. • Processing non-Windows systems will skip some operations and will be shorter. • The partition move is certainly the longest operation. The actual amount of data on sda2 implies the length of that process. 6/12 Replacing A Disk With A Smaller One Using Clonezilla Live 2. Preparing The System Before we can backup or clone our source disk, we must prepare it for geometry compatibility with the target device. We’ll have to shrink the partitions so that the sum of their sizes is equal or less than the target disk space. The target disk geometry must be the same as the source disk one. Moreover, NTFS file systems need some supplemental steps. 2.1. Source Disk Processing A. Source NTFS File System NTFS filesystems (MS Windows) are in need of a defragmentation before any further action. This can be done either through the usual Windows GUI tool or by issuing the following command: defrag <disk:> -f (eg: defrag c: -f). When the defragmentation is over, we may process the partitions. B. Source Partition Processing Using some dedicated tool we’ll now process the source disk partitions without destroying the data they carry. GNU/Linux distributions most often come with such a tool. GParted is very well known but our distro might offer some alternative. Windows systems never propose that kind of tool. In this situation, we’ll resort to using GParted that comes on the PartedMagic live CD. Figure 3 shows the source disk geometry before the cloning, as displayed by GParted. Figure 3: Source disk geometry, before shrinking partitions Partitions Shrinking We can see that the free space remaining in each partition allows shrinking them without hassle. We’ll shrink successively: • sda1 from 19.58 to 14.65 GiB (15,000 MiB), • sda2 from 10.42 to 9.77 GiB (10,000 MiB), 7/12 Replacing A Disk With A Smaller One Using Clonezilla Live which gives a total new size of 24.42 GiB. We get the new geometry displayed at figure 4. Figure 4: The new geometry after partition shrinking Partition Moving We notice that some new unallocated areas have appeared because of the shrinking. We now have to adjust both partitions in order to suppress the unallocated interval between them. Figure 5: The source disk partitions are now ready for cloning For that, using the same tool, we move sda2 to the left so that the interval becomes null. Figure 5 shows the final state. Be Patient! The move operation is, by far, the longest one in the overall process. Depending upon the amount

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    12 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us