Answer the question
In order to leave comments, you need to log in
How to corrupt a file in Linux?
I want to test the operation of the gddrescue utility. But, in order not to copy the entire partition, I want to test only on part of the file system.
I'm trying to write a few zeros to the middle of the file using dd
dd if=/dev/zero of=/backup/version_project_2_20_11_20.zip bs=1 count=1 seek=7 conv=notrunc
Answer the question
In order to leave comments, you need to log in
I want to test the operation of the gddrescue utilityIt doesn't work like that.
archive index intact - when opening an archive, an intact index is read and displayed.
while everything is ok.
but when unpacking the archive, the program will stumble upon "wrong" blocks and start throwing errors or turn off altogether.
run a test of this archive - you'll see.
1) You do not need to damage the insides of the file, but the file system .
2) It is not necessary to do this on a real file system, you can use a small file of 500 megabytes and connect it as a disk device through loopback
And already damage it as you please.
truncate -s 500M my-file-system.img
- create a file
mkfs.ext4 my-file-system.img
- create a file system on it
mount -o loop my-file-system.img /mnt
- mount
df -h /mnt
- check size
umount /mnt
- unmount
[email protected] /h/leah# truncate -s 500M my-file-system.img
[email protected] /h/leah# mkfs.ext4 my-file-system.img
mke2fs 1.45.5 (07-Jan-2020)
Discarding device blocks: done
Creating filesystem with 128000 4k blocks and 128000 inodes
Filesystem UUID: ada9f825-92d5-4410-b186-eda1ef2edfeb
Superblock backups stored on blocks:
32768, 98304
Allocating group tables: done
Сохранение таблицы inod'ов: done
Создание журнала (4096 блоков): готово
Writing superblocks and filesystem accounting information: готово
[email protected] /h/leah# mount -o loop /home/leah/my-file-system.img /mnt
[email protected] /h/leah# df -h /mnt
Файл.система Размер Использовано Дост Использовано% Cмонтировано в
/dev/loop26 469M 768K 433M 1% /mnt
[email protected] /h/leah# umount /mnt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question