Error: Superblock could not be read

Tras instalar una máquina virtual y compilar el kernel, me decido a reiniciar la máquina y me arroja el siguiente error:

ext2fs_check_if_mount: Can't check if filesystem is mounted due to missing mtab file while determining where /dev/sda2 is mounted. 
fsck.ext3: No such file or directory while trying to open /dev/sda2 
/dev/sda2: 
The superblock could not be read or does not describe a correct ext2 
filesystem. If the device is valid and it really contains an ext2 
filesystem (and not swap or ufs or something else), the the superblock 
is corrupt, and you might try running e2fsck with an alternate superblock: 
e2fsck -b 8193  

* Filesystem couldn't be fixed :(


Tal y como vimos en Aprende conceptos: superbloques, bloques e inodos, el superbloque contiene información vital sobre el sistema de ficheros. Y es lo primero que busca el kernel al montar un sistema de ficheros de tipo extX.

Por el error que da, en principio pensé que el sistema de archivos contenía errores. Inicie la máquina virtual desde una imagen de recuperación y use fsck, tal y como recomienda el propio kernel, para intentar recuperar el superbloque a partir de una de sus copias de seguridad. Puesto que el sistema de archivos tiene un tamaño de bloque de 4KB, el respaldo del superbloque se localiza en el bloque 32768 así que ejecute: fsck.ext4 -b 32768. Sin embargo tras reiniciar, el problema persistía.

El problema resultó ser que había activado por error enable deprecated sysfs features to support old userspace tools, y de acuerdo al propio man del kernel no debe ser usada en distribuciones modernas.
 .config - Linux Kernel v2.6.36-gentoo-r5 ConfigurationCONFIG_SYSFS_DEPRECATED_V2:

 This option switches the layout of sysfs to the deprecated version. Do not use it on recent distributions.

 The current sysfs layout features a unified device tree at /sys/devices/, which is able to express a hierarchy between class devices. If the deprecated option is set to Y, the unified device tree is split into a bus device tree /sys/devices/ and several individual class device trees at /sys/class/. The class and bus devices will be connected by "<subsystem>:<name>" and the "device" links. The "block" class devices, will not show up in /sys/class/block/. Some subsystems will suppress the creation of some devices which depend on the unified device tree.

 This option is not a pure compatibility option that can be safely enabled on newer distributions. It will change the layout of sysfs to the non-extensible deprecated version, and disable some features, which can not be exported without confusing older userspace tools. Since 2007/2008 all major distributions do not enable this option, and ship no tools which depend on the deprecated layout or this option.

 If you are using a new kernel on an older distribution, or use older userspace tools, you might need to say Y here. Do not say Y, if the original kernel, that came with your distribution, has this option set to N.

Symbol: SYSFS_DEPRECATED_V2 [=n]
Type: boolean
Prompt: enable deprecated sysfs features to support old userspace tools
Defined at init/Kconfig:661
Depends on: SYSFS [=y]
 Location:
  -> General setup
Selects: SYSFS_DEPRECATED [=n]

Por tanto tan solo tuve que recompilar el kernel y desmarcar enable deprecated sysfs features to support old userspace tools.
- [*] enable deprecated sysfs features to support old userspace tools
+ [ ] enable deprecated sysfs features to support old userspace tools

0 comentarios:

Publicar un comentario

Recuerde que puede utilizar algunos códigos HTML como <b>para negrita</b>, <i>para cursiva</i> y <a href="URL">para enlaces</a>.