加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

EXT3-fs:xxxn: couldn't mount because of unsupported optional features (240)的解决办法

(2010-10-21 09:16:21)
简介:
EXT3-fs:xxxn: couldn't mount because of unsupported optional features (240)的解决办法


Linux 启动的时候发现了这个提示:

 EXT3-fs:xxxn: couldn't mount because of unsupported optional features (240) 
因为根目录所在的分区是 ext4 ,/etc/fstab 里面的内容也很正常,很奇怪系统启动的时候为什么会首先尝试用 ext3 去挂在根目录 呢?

后来查了一下,发现是 klibc 的一个 bug ,据说已经修改好了,但是处于测试阶段,没有正是发布。
但现在可以他过在 grub 中提供额外参数来解决这个问题:向其中添加 rootfstype=ext4 即可。

下面是我的 grub.cfg (用的 grub2) 的配置文件中添加这个参数的地方:
menuentry "Gentoo GNU/Linux, with Linux 2.6.35.7" --class gentoo --class gnu-linux --class gnu --class os {
        insmod ext2
        set root='(hd0,3)'
        search --no-floppy --fs-uuid --set eaffe5af-76f1-4beb-abd3-5e7994c8d606
        echo    Loading Linux 2.6.35.7 ...
        linux   /vmlinuz-2.6.35.7 root=/dev/sda1 ro   quiet   rootfstype=ext4
}


为了防止用 grub-mkconfig 时候覆盖掉自己添加的参数,可以修改一下 /etc/grub.d/10_linux 这个文件,修改其中的 linux_entry 函数:


#! /bin/sh -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.

prefix=/usr
exec_prefix=${prefix}
bindir=/bin
libdir=/lib
. ${libdir}/grub/grub-mkconfig_lib

export TEXTDOMAIN=grub
export TEXTDOMAINDIR=@LOCALEDIR@

CLASS="--class gnu-linux --class gnu --class os"

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
  OS=GNU/Linux
else
  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') ${CLASS}"
fi

# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
  /dev/loop\1/"`
  ;;
esac

if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
    || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then
  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi

linux_entry ()
{
  os="$1"
  version="$2"
  recovery="$3"
  args="$4"
  if ${recovery} ; then
    title="$(gettext "%s, with Linux %s (recovery mode)")"
  else
    title="$(gettext "%s, with Linux %s")"
  fi
  printf "menuentry \"${title}\" ${CLASS} {\n" "${os}" "${version}"
  save_default_entry | sed -e "s/^/\t/"

  # Use ELILO's generic "efifb" when it's known to be available.
  # FIXME: We need an interface to select vesafb in case efifb can't be used.
  if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then
      if grep -qx "CONFIG_FB_EFI=y" /boot/config-${version} 2> /dev/null \
      && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" /boot/config-${version} 2> /dev/null; then
      cat << EOF
    set gfxpayload=keep
EOF
      fi
  else
      cat << EOF
    set gfxpayload=$GRUB_GFXPAYLOAD_LINUX
EOF
  fi

  if [ -z "${prepare_boot_cache}" ]; then
    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
  fi
  printf '%s\n' "${prepare_boot_cache}"
  cat << EOF
    echo    $(printf "$(gettext "Loading Linux %s ...")" ${version})
    linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} quiet rootfstype=ext4
EOF
  if test -n "${initrd}" ; then
    cat << EOF
    echo    $(gettext "Loading initial ramdisk ...")
    initrd  ${rel_dirname}/${initrd}
EOF
  fi
  cat << EOF
}
EOF
}

list=`for i in /boot/kernel-* /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
        if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
      done`
prepare_boot_cache=

while [ "x$list" != "x" ] ; do
  linux=`version_find_latest $list`
  echo "Found linux image: $linux" >&2
  basename=`basename $linux`
  dirname=`dirname $linux`
  rel_dirname=`make_system_path_relative_to_its_root $dirname`
  version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
  alt_version=`echo $version | sed -e "s,\.old$,,g"`
  linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"

  initrd=
  for i in "initrd.img-${version}" "initrd-${version}.img" \
       "initrd-${version}" "initrd.img-${alt_version}" \
       "initramfs-genkernel-${version}" "initramfs-genkernel-${alt_version}" \
       "initrd-${alt_version}.img" "initrd-${alt_version}"; do
    if test -e "${dirname}/${i}" ; then
      initrd="$i"
      break
    fi
  done
  if test -n "${initrd}" ; then
    echo "Found initrd image: ${dirname}/${initrd}" >&2
  else
    # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
    linux_root_device_thisversion=${GRUB_DEVICE}
  fi

  linux_entry "${OS}" "${version}" false \
      "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
  if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
    linux_entry "${OS}" "${version}" true \
    "single ${GRUB_CMDLINE_LINUX}"
  fi

  list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
done     



Author:yangyingchao, 2010-10-21

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有