I have a 2 TByte (TB) spinning harddrive in my 22.04LTS laptop in which all of the hardware is fully supported under 22.04LTS. I plan to install a 4TB SSD to replace the 2TB drive. I have an adapter that will allow the 4TB SSD to be available to the system through a USB port and I can mount drives through a USB port. I am considering using the same technique as I have done in previous "swaps" of a main bootable drive, all done as root. The question is this: will the above work or not? If Linux dd truly makes an exact image of what is on a disk drive, then however the boot sector, etc., "works" will not matter -- the new drive is an identical copy of the old drive plus whatever spare capacity the new drive may have (e.g., a 4 TB copy of a 2 TB drive will have a 2 TB "copy" plus 2 TB "blank space"). HOWEVER, due to the underlying limitations of a scheme derived for machines designed for obsoleted Microsoft end-user environments, a fresh install appears to the only option: https://developer.ibm.com/tutorials/l-gpt/ Does Ubuntu have any utilities/scripts to do what I want? Are there other (possibly proprietary) such utilities/applications? Evidently the following method that I have used in the past no longer will work.
ddthe entire current system drive and all partitions therein into the new drive.- do a
tar(gz) of the full mount point file system of each partition (other than swap) putting the .tgz files onto a separate USB mounted drive -- not the target drive. 2.1 It is my understanding thatddmakes an exact image of a filesystem, and does not defrag (neither internal nor external fragmentation). However, a restore from a tar file effectively does defrag as logical files are stored into a tar, not the actual "physical" layout on a drive. - Without mounting, use
gpartedon the new systems drive to extend and format partitions to use the 4TB as dd would have a 2TB image with 2TB "blank". - With both the new target SSD and the external USB drive upon which the tgz files were stored, restore ("untar") each partition from the tgz files and thus "defrag" the new drive. Linux would be running from the 2TB internal systems hard drive.
- Shutdown the system and attempt to USB boot from the new SSD drive using the USB port adapter. As this in a physical X86-64 system, this may require going to the "BIOS" setup and specify a one time boot from USB.
- Assuming that the system boots, shutdown the system again, remove the existing 2TB harddrive and install the 4TB harddrive.
- Reboot.