-2

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.

  1. dd the entire current system drive and all partitions therein into the new drive.
  2. 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 that dd makes 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.
  3. Without mounting, use gparted on the new systems drive to extend and format partitions to use the 4TB as dd would have a 2TB image with 2TB "blank".
  4. 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.
  5. 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.
  6. Assuming that the system boots, shutdown the system again, remove the existing 2TB harddrive and install the 4TB harddrive.
  7. Reboot.
Yasha Karant
  • 461
  • 2
  • 12
  • 2
    What's your actual question here? All I see here is you stating what you plan to do, not any real question. – Thomas Ward Sep 07 '22 at 21:48
  • Is 2TB drive gpt partitioned? UEFI or BIOS system? 4TB drive requires gpt. Otherwise you cannot expand MBR(msdos) beyond 2TB. You cannot keep both drives on reboot if imaged. You cannot have duplicate UUID or GUID with gpt or you get major issues. Often easier to just do new install and restore from your normal backup. But if installing to external drive, work arounds required. https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1396379 & https://askubuntu.com/questions/16988/how-do-i-install-ubuntu-to-a-usb-key-without-using-startup-disk-creator – oldfred Sep 07 '22 at 22:09
  • 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"). A fresh install appears to the only option: https://developer.ibm.com/tutorials/l-gpt/ – Yasha Karant Sep 09 '22 at 14:16
  • @YashaKarant you seem to be missing that you can resize partitions to take up all the blank space after the fact... assuming it's gpt partitioned. – Esther Sep 22 '22 at 16:50

0 Answers0