Help Center/ Server Migration Service/ User Guide (Kuala Lumpur Region)/ FAQs/ Disk Management/ Why Is There Less Data on the Target Server After the Migration Than There Was on the Source Server?
Updated on 2024-03-15 GMT+08:00

Why Is There Less Data on the Target Server After the Migration Than There Was on the Source Server?

Symptom

After the migration was complete, the amount of migrated data was less than the total amount of data scanned on the source server.

Possible Causes

The total amount of data to be migrated on the source server is collected by the Agent through the df-Th command. The amount of migrated data is the total combined size of all the migrated files.

If these two amounts are different, the possible causes are as follows:

  • Possible cause 1: Some files were deleted from the source server, but the processes using these file still exist.
    The rm command or other software is often used to delete files. If a file is used by a running process when it is deleted, it will still be accessible to this process and will continue to occupy disk space.
    1. On the source server, run df -Th to check whether the used disk space is the same as the total amount of migrated data.

    2. In the root directory of the source server, run du -sh * to check the disk usage of directories.

      In the above figures, df reports a larger data volume than du.

    3. Run the following command on the source server:
      lsof -n / |grep deleted

      If information similar to the following is displayed, some files were deleted but are still in use by some running processes.

      • If the migration task can be finished and the target server can be launched, the data unmigrated has no effects on the target server, and this problem can be ignored.
      • (Optional) On the source server, run lsof -n / |grep deleted and stop all the processes returned.
      • (Optional) Restart the source server at an appropriate time to stop the processes.
  • Possible cause 2: Some directories were excluded from migration.

    In Linux, the Agent does not migrate files in the following directories by default:

    /proc/*

    /sys/*

    /lost+found/*

    /var/lib/ntp/proc/*

    But these directories are counted in the total volume of source data scanned by the Agent.

    In the root directory of the source server, run du -sh * to check how much space is occupied by directories that were not migrated, such as /proc/*, /sys/*, /lost+found/*, and /var/lib/ntp/proc/*.

    If the total size of these excluded directories equals to the size of unmigrated data, the migration is successful, and this problem can be ignored.

  • Possible cause 3: There were data changes on the source server during the migration.

    When a migration starts, the Agent runs the df -Th command to obtain information about directories where each partition is mounted and traverses these directories to calculate the amount of data to be migrated.

    Data that has already been migrated is not affected by changes to the source data. However, if data that has not been migrated changes, the most current version is what migrated.

    The amount of data displayed on the SMS console reflects information collected from the source server during the first scan. During the migration, if a large amount of data is changed on the source server, for example, a large amount of data is deleted before being migrated, the amount of data migrated may be less than the total amount of data scanned for the first time.

    You can run df -Th on the source and target servers for comparison.

  • Possible cause 4: A large number of sparse files existed on the source server.

    Sparse files are scanned but ignored during the migration. This may lead to the amount of migrated data less than the total amount of data calculated during the first scan.

    There are many ways to generate sparse files in Linux, such as running the dd command.