I had some bad sectors on my ext4 partition and using hdparm --write-sector I managed to reallocate them. However, I ended up in state where in one folder I have folder that has no inode assigned.


ls -li /path/

? d?????????? ? ?      ?         ?            ? folder


I am unable to delete this folder now. I tried simply to rm -fr it - no success. I wanted to delete it with debugfs but opening filesystem that contains this folder gives me Bad magic number in super-block while opening filesystem. I don't know whether ext4 in lvm is supported by debugfs and found no info on that.

  • have you tried an fsck ? (File System Consistency Check), it's very purpose is to help you clean problem like yours. Be sure check you backup first however.
    – Archemar
    Commented Jun 6, 2016 at 12:00
  • Well, I wanted to, but that partition is also system partition. If there's no other way, I will try it with some bootable flashdisk.
    – Martin
    Commented Jun 6, 2016 at 12:03
  • Booting with /forcefsck will work, even if the partition to check is the system partition. Commented Jun 6, 2016 at 14:36

1 Answer 1


I'd suggest forcing a fsck: sudo touch /forcefsck and then reboot. But before you do that, make sure you have backups — especially now since you can still access the contents of your filesystem.

debugfs does support LVM-backed filesystems, it simply uses whatever block device you give it (or even a file). Presumably one of the blocks you reallocated was in the superblock; you could always try to run it using a backup superblock with the -s option (which also requires the -b option), but it's probably best not to write to the filesystem like that.

  • Thanks for advice. As it is company computer, the way I am taking is replacement of the disk. If it was my computer I would do backup and disk check as advised. And therefore, this is accepted answer.
    – Martin
    Commented Jun 14, 2016 at 7:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .