Answer the question
In order to leave comments, you need to log in
How to write a file to a specific location in hdd?
Is it possible to specify an indent in bytes when creating a file?
I want to try to write the file directly to badblock, the list was given by the badblocks command in Ubuntu, there are not many of them, but the necessary program crashes.
Answer the question
In order to leave comments, you need to log in
Under Windows, this unusual trick can be done in your own code using FSCTL_MOVE_FILE . Those. not creating a file, but moving an existing one.
Either by throwing a bunch of files on the disk, and then using nfi.exe (NTFS File Sector Information Utility) , or DiskView , or fsutil querycluster to see what exactly lies in the sectors you are interested in.
The same can be done in a hex editor, but this requires some understanding of file systems.
Under Linux, take a look at the sources dd
(as a potential source of ideas) and look --write-sector
at hdparm .
You can also use debugfs
:
debugfs: testb 100500
Block 100500 marked in use
debugfs: icheck 100500
Block Inode number
100500 1488
debugfs: ncheck 1488
Inode Pathname
1488 /home/psiklop/hentai.mkv
the required program crashes
Is it possible to specify an indent in bytes when creating a file?
I want to try to write the file directly to badblock, the list was given by the badblocks command in Ubuntu, there are not many of them, but the necessary program crashes.
sudo fsck -vck /dev/sda1
where sda1 is the partition with the file system where you need to check and mark bad blocks
-c This option causes e2fsck to use badblocks(8) program to do a read-only scan of the device in order to find any bad blocks. If any bad blocks are found, they are added to the bad block inode to prevent them from
being allocated to a file or directory. If this option is specified twice, then the bad block scan will be done using a non-destructive read-write test.
I forgot to write that this is a SAS disk.
The bad block did not want to remap, but the badblocks team always found them in the same place.
The team helped sg_format --format /dev/sdb
, all 8 bads were repaired and the team smartctl -a /dev/sdb
confirmed this.
Later I launched badblocks and it did not find bads, let's see how long the disk will live.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question