Solved fsck segmentation fault

Hi everyone,

I have a disk which has probably gone bad. I can mount it read only, but I can't mount it writable.

Code:
# mount /dev/ada2 /mnt/stuff
mount: /dev/ada2: R/W mount of /mnt/stuff denied. Filesystem is not clean - run fsck. Forced mount will invalidate journal contents: Operation not permitted

fsck_ffs(8) however coredumps:

Code:
# fsck_ffs -y /dev/ada2
** /dev/ada2

USE JOURNAL? yes

** SU+J Recovering /dev/ada2
** Reading 33554432 byte journal from inode 4.

RECOVER? yes

** Building recovery table.
** Resolving unreferenced inode list.
** Processing journal entries.
Segmentation fault (core dumped)

Now I understand that the disk is probably bad, however, shouldn't fsck(8) say if it couldn't for example write to it, instead of crapping out?

Thanks.
 
Try with answering "no" the "USER JOURNAL?" question. If that doesn't help the disk is probably too badly damaged and even fsck(8) can not repair the damage. Fsck is only a filesystem metadata repair tool and it can not recover from errors that have messed up data structures on the filesystem it is not designed to fix. The segfault you are seeing is not because it can not write to the disk‚ it's clear that the disk is writable but obviously something on the disk is corrupted badly, hence the segfault.
 
  • Thanks
Reactions: G4
Ok, not using the journal and then fixing what problems it found enabled me to mount the disk.
Thanks for the help.
 
I would disable the journal by booting into single user mode and issuing a tunefs -j disable on the filesystem(s), the journalling is hardly worth it since it doesn't actually protect your data in any better way than without the journal. There are also some long standing bugs in the journal implementation that for example prevents creating UFS snapshots with mksnap_ffs(8).
 
Ok, good to know.
I will be replacing the disk soon, and format the new one without journaling.
 
Back
Top