Clone Disk to a Smaller Disk using Clonezilla

On and off I need to clone a larger disk to a smaller disk. There are some software to do that but usually it is paid. As I don’t like to spend time to evaluate the quality of those software, I still kept using Clonezilla as my tool to do disk clone.

So back to the topic, how to clone a larger disk to a smaller disk? There are 2 choices. I am not going to the details step, but a high level steps only.

Choice 1: Clone all partitions in the source disk

If the destination disk is big enough to hold all data in the source disk, but smaller than the source disk, probably you want to choose this. The screenshot below is taken using clonezilla-live-20170905-zesty-i386.

  1. Shrink and move the partitions of the source disk, so that the size of sum of all partitions is less than the size of the destination disk. You can do that using Disk Management in Windows, or GParted in Ubuntu live CD. If you need to move partitions, then you will need to use GParted to do that.
  2. Optionally create a disk image from the source disk.
  3. Boot to Clonezilla, choose restoredisk if the source is an image, or choose disk-to-local-disk is the source is a disk.
  4. Follow the instruction on screen. When come to mode selection, choose Expert mode.
  5. Make sure the -icds is selected in the advanced extra parameters screen.
    Clonezilla Skip Destination Disk Size Check
  6. Make sure to use the partition table from the source disk or source image. Although this post suggest to Create partition table proportionally, but during my testing with 3 partitions in a source disk, it generate errors.
    Use Partition Table from Source Image
  7. Follow the rest of the instruction on screen to complete the clone.

Choice 2: Clone selected partitions in the source disk

You may want to use this method when you don’t want all partitions to be cloned to the destination disk. For example, you may want to clone the recovery partition only, and have a blank OS partition for factory restore, or you may want to clone only OS partition but drop the recovery partition because the recovery partition is too big.

  1. Shrink all source partitions which want to clone to the destination disk, so that each destination partition is equal or larger than the source partition. Use Disk Management in Windows, or GParted in Ubuntu live CD to do that.
  2. In the destination disk, create all partitions which you want to clone from the source disk. Each destination partition must be equal or larger than the source partition. Use Disk Management in Windows, or GParted in Ubuntu live CD to do that.
  3. Create any additional partitions which you will need. For example, you want to clone the recovery partition only, but you want to perform a factory restore next, then you may want to create an blank OS partition.
  4. Set the destination partition type same as the source partition type. For well known partition type such as NTFS or FAT32, you can do that by perform file system format. For other partition type such as Dell Utility, you will need to use fdisk command in Linux to set it.
  5. Port all partition flags from each source partition to destination partition. For example, setting the boot flag to OS partition and setting diag flag to recovery partition.
  6. Using Clonezilla, clone the source partition to the destination partition one by one.

vzMediaScan 3.2.0 Published!

vzMediaScan App Icon

Originally I planned to make version 4.0.0 which include scanning progress, but because of the new Monster Hunter game Monster Hunter World on PS4, I got zero time working on the app lol

As the Chinese New Year holiday is coming to the end and I don’t foresee I got a lot of time to work on it again, I got to release my current work which includes fixes and debug logging at this moment.


Anyway you can get the latest version of the app from Google Play below.

vzMediaScan 3.1.3 Published!

vzMediaScan App Icon

After further investigation, finally identified from the log that my app was killed by Android itself because the Android built-in process which my app used was crashed.

To resolve this, just need to request Android to restart my app when it is being killed. This will make the scan longer but at least the scan will at the end finish.

The scan notification which didn’t go away after the app is killed is probably another issue which hopefully can be solved…

Anyway you can get the latest version of the app from Google Play below.

vzMediaScan 3.1.2 Published!

vzMediaScan App Icon

After a few days of trying my own app, I noticed that the timestamp on the notification is gone. Checked the official document and found that they changed the default behavior. So this version only merely to add the timestamp back. Nothing special.

You can get the latest version of the app from Google Play below.

vzMediaScan 3.1.1 Published!

vzMediaScan App Icon

Unfortunately my Nexus 5X was dead because of the infamous bootloop in Nexus 5X, LG G4, LG V10. That’s why I switched to a second hand Sony phone which gave me the chances to discover a bug in the app. Because of the phone switch, I also switched to another music player which uses the system playlist, and I found that after a media scan, all playlists will gone.

Life is so occupied that I got no time to work on it until the Christmas and New Year holiday. Still, there’s a lot area which I wanted to revise on my app but I just don’t have the time.

Another unfortunately is that I published a version 3.1.0 which is broken and there is no way to rollback. So an hour later I released another version 3.1.1. If you installed version 3.1.0, please upgrade it to version 3.1.1.

You can get the latest version of the app from Google Play below.


PS: It was almost a year since my last post, sigh.

sleepbot-to-sleep_as_android is Released!

I was a user of Sleepbot since 2013. However it was abandoned by the developer later on and no more new release for a few years. I tried to check their blog but no reason found behind this.

Anyway I was still using Sleepbot until my Nexus 5X was dead, due to the infamous bootloop (but what the news said, LG did repaired my phone) and I lost a month of data even I have do regular backup. Coincidentally I saw Sleep as Android on the editor choice of Google Play a few days ago before the phone dead, so I decided to switch to something else.

After comparing with Sleep as Android and Sleep Better with Runtastic, I decided to got for Sleep as Android because what I need is just sleep tracking, I don’t need alarm and it seems Sleep Better with Runtastic has no way use sleep tracking without an alarm.

So now I am using Sleep as Android, and then I did a quick search to see if there is any methods to import the data from Sleepbot. In the documentation, it did mention someone made a Ruby script for import data, which convert the exported file from However I didn’t use cloud save so it just doesn’t work for me. So based on that script, I wrote my own version which convert the exported file from the app itself instead to a file that can be imported in Sleep as Android. So that is the why the script is here. The reason why I used Python is just because I have very little knowledge with Ruby.

Enough for the background information. Anyway you can find the script and more technical details at the project page.


PS: I just found that there is no annual report from WordPress in year 2016!

vzMediaScan 3.0.0 Published!

vzMediaScan App Icon

After 2.5 years, finally I am able to finish working on the new version. This is mainly to fix the problem introduced in Android 5.0 Lollipop that empty folder will turn into file after scan.

Others changes include support of runtime permission in Android 6.0 Marshmallow and also IDE change from Eclipse to Android Studio. Well but IDE change doesn’t affect the user anyway.

You can get the latest version of the app from Google Play below.