Fix command only trying to fix one block
lamarios opened this issue · 13 comments
I have a not very healthy disk with a lot of bad blocks (22616) but when i run the fix command it only seems to be fixing the first block of my bad block file:
sudo bbf -i 3t.WMC4N0J3YP10 -c my-captcha fix /dev/sdc
Reading block 5694484064 succeeded (1 attempts)
Writing block 5694484064 succeeded (1 attempts)
and then it mounts the drive. Is it expected behavior ?
Sounds like something is automatically mounting the device. bbf is definitely not doing that. Try removing it from fstab and trying again.
Weird, I removed the drive from fstab and also the fstab entry for the mergerfs pool it belongs to but it's still mounting on its own.
What distro? Is it mounting to /media/${USER}/ ? If so then it could be the desktop's filemanager trying to mount it. Might reset when bbf is trying to write to it and it sees it again. Would need to turn that off (or wipe the beginning of the drive so it can't mount it.
https://dominicm.com/mount-filesystem-partitions-in-arch-linux/
via systemd maybe?
Well, I edited the fstab and rebooted to make sure and when i run the bbf command it will stop at the same state as before but the disk won't be automatically mounted this time.
Could it be because my drive is in a really bad shape ? I actually noticed bad sectors on this drive before so what i did is try to read every blocks using dd if=/dev/sdc of=/dev/null to see what is the first failing block and create a partition from beginning to before that particular block so that there are no actual partition on the bad blocks.
Does BBF needs to have a partition on the blocks to be working ? If yes then that might be why.
No, bbf works with the block device. It doesn't care at all.
What do you mean it stops? It exits? How did you create the block list? Does scanning work?
It's a bug. Fix incoming.
Grab the latest. Should work. Sorry about that. Clearly didn't test it after changing things last time.
Works great, thanks !
Cool. Let me know if you have any more issues, questions, or suggestions.