Clone encrypted HDD to smaller drive
So this is what I did in the end:
While logged in with access to unencrypted data, I copied all the data to a external HDD using rsync.
ATTENTION: the first attempt copied all the data, but when I checked the data 70% was in binary form (even pictures, text files etc ...) and not useful, so I erased the external HDD and start over, the second time it worked (I have no clue what was wrong the first time), but it is very very important toDOUBLE CHECK the copied files if you plan to tamper with the original data
.Make a list with all the programs installed.
I did it manually from "Software Center", because I wanted to have the installed history available, you can usedpkg -l > textfile
or other commands to give youALL
packages installed and then reinstall them viaaptitude install $(cat <textfile>)
. Of course you need to move thetextfile
to the new installation.Install the same OS version in onto the new HDD, using the same name for your user account.
Mount the external drive and copy everything to the new HDD
ATENTION: If you do this from GUI, do not overwrite your home dir, just put it with a different name for example /home/YOURNAME.orig, and after all files are copied, go to ctrl+alt+F2, log in the machins, stop the gui (for normal ubuntu 12.04 the command isservice lightdm stop
, mv your old home on top of the new onemv /home/YOURNAME.orig /home/YOURNAME
, and start X againservice lightdm start
.
Here you can see the power of Linux's /home dir, everything was back in place, icons, settings, applications specific settings, even cached data :), and I only had a downtime of about 4 hours (because the first copy failed).
Hope this helps, I still consider this a faster and safer approach compared to resizing the encrypted HDD.