A couple of times in the past, I have seen one or two of the partitions on my system running Linux filling up at a rapid pace and during those times I have wondered how best to create more space. And I ended up using third party tools such as partition resizing programs to make more space. It is because of this hassle that many prefer using Logical Volumes to store data instead of directly storing it in the partitions. Using logical volumes, it is quite easy to shrink or grow a volume by adding or removing partitions to/from the volume using the tools available in all Linux distributions without any data loss what so ever and without sheding any tears. In previous posts on this blog, I had explained how to create and resize logical volumes in Linux.
Having said that, it is possible to migrate data from the filled up partition to other partitions on the same disk or an entirely different disk all together but there is a method to the madness. Martin Brown explains how to go about moving data (entire directory structure) from one partition to another. The reasons for doing so could be as diverse as freeing up much needed space in the partition to circumventing an impending fault in the device containing the data. And the process can be done in a system running in single user mode or a live and running system where you need to ensure that the files are available during the move.
And he lists out 8 steps to accomplish the task at hand. They are as follows:
- Choose the data to be copied
- Create a new partition
- Create a new file system on the partition
- Mount the partition on a temporary directory
- Copy the data to the temporary directory
- Rename the original directory
- Create the new mount point. And finally ...
- Mount the file system.
No comments:
Post a Comment