Moving a Linux Server to a larger drive

Recently I had a 512GB NVME drive that was getting too small. The operating system was Ubuntu 22.04 and Ubuntu server uses an LVM file system by default.

My goal was to image the 512GB drive so that I could have an image backup and also so that I could restore the image to a new 2TB NVMe drive.

  1. Image the drive (Drive inserted into USB 3.1 Gen 2 external adapter on another machine). We don’t want the OS to be running. So, imaging is taking place on another machine. The image is done to a file rather than disk to disk because I wanted a backup and also I had only one USB 3.1 Gen2 external NVMe adapter.
    image 1

  2. Restore the backup to the new drive (Insert new 2TB into the USB 2.1 Gen 2 external adapter)
    image 2

  3. Extend the LVM volume size from 474GB to use all the free space on the new 2TB drive.
    image 3

  4. Although the volume is resized, we need to resize the file system inside of the LVM volume to use the extra space. First find out the name of the LVM Path.
    image

  5. Resize the file system inside of the LVM Volume to use all the space in the volume.
    image 4

You can see that all of the drive space is used on the logical volume.
dd -vgdisplay