1
1
1nt3rp0l2021-11-17 17:58:20
linux
1nt3rp0l, 2021-11-17 17:58:20

LUKS. After updating the files in a folder, the updated files break. How to fix?

Hello.
I have a 16 GB flash drive. Formatted to FAT32.
I often update files there, but they break. It looks like they are encrypted but not decrypted.

I open and replace files like this:

cryptsetup open /dev/sdb vault
mount /dev/mapper/vault flash/
cd flash
ls
file file file Folder file
file file
ls Folder
file file file file

Now I replace the files with new ones:
cp -rf /home/user/Folder ./
I go into the folder, and I see that everything is fine, all the files have been copied and are in a normal state.
Now I do the following:
umount flash
mount /dev/mapper/vault flash

That is, unmounting, and mounting again.
And I see the following: all updated files are damaged. Files that have been uploaded since the moment of formatting are not corrupted.
It looks like this:
ls in the corrupted folder with updated files
ls: cannot access ''$'\a''╧¡r'$'\b''7{┌.╠├y': Input/output error
ls: cannot access ')'$'\017''_═u¡VP.═pk': Input/output error
ls: cannot access ''$'\002''|¬3┤╖k▐.'$'\022\n\v': Input/output error
ls: cannot access 'τ√ië┤ä∙┤.u∩╗': Input/output error
ls: cannot access '▐░0B≥ΘAc.<┴σ': Input/output error
ls: reading directory '.': Input/output error
'▐░0B≥ΘAc.<┴σ'                  '█'$'\021''ey≥¡∙÷.╒LÑ'
''$'\002''|¬3┤╖k▐.'$'\022\n\v'  ''$'\a''╧¡r'$'\b''7{┌.╠├y'
''$'\f''∩'$'\b''`┐ ┌╙.5µΦ'      ')'$'\017''_═u¡VP.═pk'
',╖'$'\030''\cnö=.╥x≈'           τ√ië┤ä∙┤.u∩╗


Once launched fsck, it finds all errors, but eventually deletes a completely corrupted folder with files. Again, files that have been uploaded since formatting are not damaged.
Do I really now every time I need to update the files on the flash drive - format the entire flash drive, and upload all the files in a new way?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question