If I rename a file with mv command like:
mv original_file_name new_file_name
Is this possible to recover the original filename on Linux Ext4 file system and if so how that can be done?
If I rename a file with mv command like:
mv original_file_name new_file_name
Is this possible to recover the original filename on Linux Ext4 file system and if so how that can be done?
At the filesystem level, this operation can not be undone: you changed the name assigned to a specific inode, without preserving its previous name.
That said, a very small chance exists to retrieve the original name by reading backward the filesystem journal. However, as the journal is a circular buffer (ie: it is continuously overwritten), you need to immediately remount the filesystem readonly and use specialized tools to analyze the journal.
It is way simpler and effective to search the previous name in system logs and the likes: for your example, an extremely simple history
command would reveal the mv
command in its entirely, showing both old and new filename.