Go to ...

Techpository

A Better Technical Repository

RSS Feed

Linux: Moving directories and files that have softlinks to another drive


In general softlinks cannot be moved as it will break the link.

Softlinked files and directories can be moved as long as their links are all within sub directories of the main folder.
The one caveat is that you need to move them to a file system that supports links.

As an example I wanted to make a quick copy of ubuntu-builder.
My source drive was EXT4.  I then created a sufficient sized EXT2 partiotion on a USB drive.

I copied the main ubuntu-builder folder and all of it’s subordinate directories and files to the  to the targeted USB drive’s EXT2 partition.
All links were maintained.