Interrupted File Move Operation in Linux Can Cause Data Loss

Undoubtedly, hard drives are main repository of your invaluable data, but they too have limited data storage capacity. You face shortage of space after some time; even when you have the largest capacity disk in your computer, because with time it too gets filled. Slow system, sluggish data access speed, and day by day deteriorating performance of your system are some of the symptoms of a filled hard drive. These signs call for a new hard drive with comparatively high data storage capacity and more data access speed. However, you cannot switch to new hard drive this easily; as you have to take the data from your old drive to new in order to prevent data loss.

The Linux Operating System provides you ‘pvmove’ command line utility for moving all the content from an old hard drive to new one. However, before trying this operation, it is suggested to backup all the data of your old hard drive; as there are chances of failure of this process and hence, data loss. By following the below mentioned steps you can perform the operation of data transfer from an old hard drive to new:

# pvmove /dev/hdb
pvmove — moving physical extents in active volume group “dev”
pvmove — WARNING: moving of active logical volumes may cause data loss!pvmove — do you want to continue? [y/n] y
pvmove — 249 extents of physical volume “/dev/hdb” successfully moved

Now distribute the old extents to this newly added disk. However, if the physical extents are not available or free for distributing old physical contents, then you have to add another disk to volume group and after that move the extents to the replacement disk. For this, you have to follow the below mentioned steps:

  • For making and preparing the new disk available for ‘Logical Volume Manager’, you have to use ‘pvcreate’ utility.
  • Add this prepared disk to the volume group.
  • Now move the data from old hard drive to the new one. It is not necessary to unmount the old file system before performing this operation. However, before moving the data, it is recommended to take its complete backup.

Though this process of moving the files is quite safe and largely used by Linux users, at times, it is seen that interrupted file move operation and moving the active logical disk volume results in data loss. Let us take a practical example to understand this situation.

For better data management and fast processing of his Linux based system, Mathew decided to move all the contents of his old hard drive to a new large capacity disk. To accomplish this mission, he started moving a big tree from one disk to another (both disks LINUX based) through above mentioned steps. After copying all the contents from an old drive to new, he found that some of his files were missing. Though some files were copied perfectly, but some were moved away from the source and were not on the destination drive as well. He could not believe that such can happen with him as he just used the standard process for replacing the old disk with the new one.

To rectify this issue, he searched over the Internet and found that such scenarios occur when:

  • The movement of files gets interrupted due to sudden power outage or unexpected system shut down.

  • The process takes place in active logical disk volume.

  • During the move operation from one hard drive to another, the CPU of your Linux OS based computer is involved in some intense tasks.

Further, in his search, he found that the best way to overcome data loss caused due to such reasons is professional Linux data recovery software. Reliable Linux Data Recovery tools have intuitive user interface and hence, do not require any technical knowledge to perform the recovery of your files. With the help of an effective tool you can recover all your lost, deleted, or formatted files from Linux based hard drive volumes. Most of these tools support almost all kinds of files including the directories and hard drive volumes. The support for SCSI, SATA, IDE, and EIDE hard drives makes them usable by all. Therefore, by using an efficient Linux data recovery software, Mathew recovered all the data that he lost during the move.

Further, it is suggested not to do anything while moving the contents of one drive to another. Moreover, for more security, it is suggested to take the backup of your hard drive data prior than performing any move. However, even then if you face any such situation, then use of a professional Linux data recovery software is recommended.