In general, defragmenting will not lead to data loss. Defragmentation is much related to file systems on electromechanical disk drives, and it is the process of picking up all pieces of data which spread across a partition (it is also called volume) and then putting these pieces together.