Migrate Veracrypt system boot partition to a different, smaller drive?

postcd

Weaksauce
Joined
Nov 24, 2016
Messages
96
Hello, i am having 120GB Windows 7 system partition on a 1TB drive. This partition is encrypted using Veracrypt system encryption.
I need to put this 120GB partition on a different smaller (160GB) drive.
According to this tutorial, i have booted live system and ran Linux disk cloning for a few minutes: dd if=/dev/sdb of=/dev/sda (i know sdx was right)
Trying to achieve boot record be copied. And it was.
Then i have copied the system partition using gparted and set a boot flag to it inside gparted.
On new drive boot i am able to see Veracrypt pre-boot authentication, password is OK, but it says unable to find boot partition. I do not know why since the gparted partition copy was ok.

Update: i ended up installing new Windows, but if you have idea what may worked, i would like to know. Thank you
 
Last edited:
Hello, i am having 120GB Windows 7 system partition on a 1TB drive. This partition is encrypted using Veracrypt system encryption.
I need to put this 120GB partition on a different smaller (160GB) drive.
According to this tutorial, i have booted live system and ran Linux disk cloning for a few minutes: dd if=/dev/sdb of=/dev/sda (i know sdx was right)
Trying to achieve boot record be copied. And it was.
Then i have copied the system partition using gparted and set a boot flag to it inside gparted.
On new drive boot i am able to see Veracrypt pre-boot authentication, password is OK, but it says unable to find boot partition. I do not know why since the gparted partition copy was ok.

Update: i ended up installing new Windows, but if you have idea what may worked, i would like to know. Thank you
use somthing that can clone inside windows while the disk is unencrypted (unlocked) like acronis true image it can usually clone while inside windows you need to re encrypt after

or un-encrypt the disk and then clone using boot usb (still recommend acronis true image) once cloned then re-encrypt if needed

trying to clone a encrypted software disk doesn't always work
 
I needed similar thing, except that the Windows 7 was not encrypted.
1) FAILED: Windows computer manager / Disk manager / right click source disk main partition to shrink it - it somehow not allowed to shrink enough even the disk space used was low.
2) FAILED: Linux dd - booting started, but failed to start Windows: autochk program not found
3) FAILED: RedoRescue 4, then found here that it can NOT restore to smaller drive than the source drive
4) SUCCESS: suggested Acronis True Image WD Edition https://www.westerndigital.com/en-us/support/software/acronis (Works only if you have WD drive in computer) otherwise use http://dl2.acronis.com/s/AcronisTrueImage2021.iso i put the image to Ventoy created USB disk and after booting it, selected Tools & Utilities / Clone Disk and carefully read all questions in Manual cloning mode. Then disk was cloned ok and is bootable.
5) SUCCESS: if one need just restorable backup file (not drive cloning) skipping empty space, then Redo Rescue placed on mentioned Ventoy was good for this.

------------

Now i will be cloning encrypted Linux drive so i bet this case there will be no disk space savings and also "unused" space will have to be backed up, so i am thinking to used Linux dd or ddrescue command line utility from within Gparted Live USB system to put the data into an .img or directly to different (larger) disk and then use gparted to luksOpen the destination disk encrypted partition and grow its site (again using gparted) https://jotbe.io/blog/2019/03/how-to-clone-a-luks-encrypted-hhd-to-a-larger-ssd/
So i proceed like i said, made an .img file on larger external drive. Then after some time repeat the process, only reverse/restoring the image:
Boot mentioned Live system, launch command prompt double clicking the shell icon on desktop.
lsblk
disk to which i want to restore image is /dev/sda and the disk on which is image is in my case /dev/sdc, more specificaly sdc1 partition, so i have mounted sdc1 and listed its contents:
sudo mkdir /mnt/a && sudo mount /dev/sdc1 /mnt/a;ls /mnt/a
It listed my diskbackup.img which i have restored on /dev/sda: sudo ddrescue -r3 /mnt/a/diskbackup.img /dev/sda
Then opened gparted clicking the desktop icon, reloaded devices, selected /dev/sda, it shows: unallocated
"Error: Can't have a partition outside the disk!", yet disk booting. Question is how to resize encrypted partitions now when gparted shows unallocated.
 
Last edited:
Back
Top