Does moving a file/folder causes fragmentation in Disk on Ubuntu 20.04?
2 Answers
In this article on Quora 'Does disk fragmentation occur in Linux? If not, why?' it explains that Linux (EXT4) does not fragment any disk. Windows however will (FAT 32/NTFS).
Fragmentation only happens on HDDs (the ones with platters and readheads in them).So you can defrag them once in a while for better performance.
Fragmentation does not happen on SSDs. Don't perform a defragmentation on these kind of disks. It is useless and the read/writes shorten its lifespan.
So it really depends on what kind of disk(s) you have in your system and what filesystem you use.
moving a file with the mv command on the same disk does not move data. It changes only the directory entries relating to this data. Hence, it cannot fragment a disk.