It is necessary to transfer all data from the old HDD ( sdX ) to the new SSD ( sdY ).

GPT is used. Space on the new disk is greater than or equal to the old one. There are several sections: boot, several windows, several Linux. It is necessary to transfer them all in their original form, one of them, if necessary, be enlarged.

  1. Is it possible to first copy the entire disk as is, byte to byte, and then GParted to increase one of the partitions to occupy the unallocated area?

  2. Which command is better to use for copying?

    dd if=/dev/sdX of=/dev/sdY cp /dev/sdX /dev/sdY cat /dev/sdX > /dev/sdY

Or some other? I know they usually use dd , but it seems to be slow.

  • one
    dd or cat. And dd is not slow if bs is done with a few megabytes. but besides increasing the parted section, you may need to further expand the file system itself in the section with separate utilities that depend on the file system - Mike
  • What utilities to extend ext4? - havon
  • try gparted - a graphical interface and everything you need. - KoVadim
  • Does he know how? - havon
  • one
    google for "resize ext4" issued articles that said that after expanding the partition, resize2fs /dev/sdX is resize2fs /dev/sdX - Mike

1 answer 1

I always transfer using dd if=/dev/sda of=/dev/sdb bs=20M , and extend the file system to gparted in the graphical interface.

You can also use the "online" file system extension for the entire partition - resize2fs /dev/sdbX .

First you need to stretch the section.

I go into gdisk /dev/sdb and execute p - view the partition table. Then I delete the section that needs to be stretched. And I create it again only to coincide with the beginning of the section, and the end was further than marked in the file system. Then do resize2fs /dev/sdbX