2014-06-22

[筆記] 解決Ubuntu 14.04 使用SoftRAID或LVM開機出現diskfilter writes are not supported

Ubuntu Server出了新版14.04,剛好最近公司Mail Server掛點,乾脆就重灌成這版吧,比起不熟悉的OpenSUSE,我還是更習慣Ubuntu

使用SoftRAID安裝好後,重開機,但這時畫面卻出現這個:


雖然不理她,五秒鐘之後也會繼續開機,功能也都正常,但心裡總是不舒坦,覺得哪裡怪怪的....

搜尋了一下,這個的確是14.04的Bug。還好,在Bug回報討論串有人提出已經解決了。
底下就是解法:
Fix from #28 extended to support LVM (so, I think, it is universal clean fix of this bug). Change recordfail section in /etc/grub.d/00_header to:
  1. if [ "$quick_boot" = 1 ]; then
  2. cat <<EOF
  3. function recordfail {
  4. set recordfail=1
  5. EOF
  6. GRUBMDDEVICE="$(grub-probe --target=disk "${grubdir}")"
  7. GRUBLVMDEVICE="$(grub-probe --target=disk "${grubdir}")"
  8. if echo "$GRUBMDDEVICE" | grep "/dev/md" > /dev/null; then
  9. cat <<EOF
  10. # GRUB lacks write support for $GRUBMDDEVICE, so recordfail support is disabled.
  11. EOF
  12. elif echo "$GRUBLVMDEVICE" | grep "/dev/mapper" > /dev/null; then
  13. cat <<EOF
  14. # GRUB lacks write support for $GRUBLVMDEVICE, so recordfail support is disabled.
  15. EOF
  16. else
  17. FS="$(grub-probe --target=fs "${grubdir}")"
  18. case "$FS" in
  19. btrfs | cpiofs | newc | odc | romfs | squash4 | tarfs | zfs)
  20. cat <<EOF
  21. # GRUB lacks write support for $FS, so recordfail support is disabled.
  22. EOF
  23. ;;
  24. *)
  25. cat <<EOF
  26. if [ -n "\${have_grubenv}" ]; then if [ -z "\${boot_once}" ]; then save_env recordfail; fi; fi
  27. EOF
  28. esac
  29. fi
  30. cat <<EOF
  31. }

接著執行update-grub,然後重新開機即可。

沒有留言:

張貼留言