お知らせ

  • 利用規約を守って投稿してください。また、よくある質問および投稿の手引きも参照してください。
  • メッセージの投稿にはアカウントが必要です。未登録の方は、ユーザ登録ページからアカウントを作成することができます。

#1 2010-10-28 06:01:46

hey
メンバ
登録日: 2010-10-28

windows7の再インストール後ubuntu10.10が起動できない

過去の質問をずっと見ながらやっているのですがどうしても自分のパソコンからはできないので質問させてください
状況はwindows7とubuntuデュアルブート状態で使っていましたが不具合で7のほうをクリーンインストールしたところubuntuの方が起動できなくなりました
その後過去質問をよんでLIVE CDからGRUBの再設定を試みようとしてGRUBのインストールや sudo grub-install --root-directory=/mnt/sda4 /dev/sda4(←自分のubuntuが入っているデバイス)、ubuntuを別のパーティションにインストール など書いてあるようにやってみたのですが未だに状況は改善していません。エラーの内容はそのデバイスはマウントできませんと表示されます
なにかほかにアドバイスがありましたらよろしくお願いします

オフライン

 

#2 2010-10-28 08:23:29

tista
ゲスト

Re: windows7の再インストール後ubuntu10.10が起動できない

hey様

すでに種々の作業を行なっておりますので、まずは現状のパーティション構成の最新情報を投稿して下さい。
また、LiveCDからGrub2を再度導入したとのことですが、それはMBRに対してでしようか、PBRに対してでしょうか。

念のため確認させて頂きますが、Win7再インストール時にパーティションサイズ(シリンダ位置)等が変更されている可能性はありますでしょうか。
あるいはBootフラグの設定が更新されている可能性も考えられますね。

まずは、現在のHDD内のパーティション構成に関わる詳細な情報を投稿して頂ければReplyがつくと思われます。

 

#3 2010-10-28 09:27:29

hey
メンバ
登録日: 2010-10-28

Re: windows7の再インストール後ubuntu10.10が起動できない

返答ありがとうございます。初心者でどの情報が必要なのかよくわからないのですが、一応ディスクユーティリティでubuntuがもともとあった場所を見てみた結果は
hdd内にはまだ存在しており パーティーション;マスターブートレコード パーティーションタイプ LINUX(0X83) Ext4 ver1.0などと書いてあります
具体的にどこの情報をどうやって出すのかがわからないのでご教授いただければ幸いです

オフライン

 

#4 2010-10-28 11:30:16

tista
ゲスト

Re: windows7の再インストール後ubuntu10.10が起動できない

Linux partition (Ext4)が残っているようですね。
では、このパーティションのブロックデバイス名を知りたいので、LiveCDで起動し、
「ディスク・ユーティリティ」にて該当パーティションを選択後、「デバイス」の欄に表示されるたとえば/dev/sda2等の表記を確認して下さい。

その後の方針としては、そのデバイスを指定してLiveCDから直接HDD内のUbuntuを起動させます。
起動後にGrub-installを走らせ、MBRに格納してみましょう。
Win7はchainloadでbootできます。

 

#5 2010-10-28 12:14:42

hey
メンバ
登録日: 2010-10-28

Re: windows7の再インストール後ubuntu10.10が起動できない

/dev/sda5がそのファイルのようです。live CDから直接そのHDDのUBUNTUを読み込むにはどうしたらいいいのでしょうか?あとよろしかったらその後の対策もよろしければ詳しくお願いします

オフライン

 

#6 2010-10-28 12:38:48

tista
ゲスト

Re: windows7の再インストール後ubuntu10.10が起動できない

/dev/sda5ですね。
では、LiveCDで起動オプションを選択あるいは追加できる機能がありますので、それを利用します。
当方の記憶が正しければF6キーで詳細オプションを出せるかもしれません。
正常にオプションを表示できればそこに下記の記述

コード:

boot=casper

があるでしょう。今回はそれを消し、

コード:

root=/dev/sda5

と記述して起動してみて下さい。HDD内に存在するUbuntuがシステムとして健全であれば/dev/sda5をroot file systemとみなして起動します。もし、この方法で起動しない、あるいは起動途中で不意に停止する場合は追加の調査を行うか、再インストールしたほうが早い場合もあります。

まずは上記作業にて/dev/sda5内のUbuntuが起動するか確認して下さい。

 

#7 2010-10-28 13:50:45

hey
メンバ
登録日: 2010-10-28

Re: windows7の再インストール後ubuntu10.10が起動できない

live CDから直接F6オプションできどうさせようとしたところkerner panic が画面に表示され立ち上げることができませんでした。
この場合どのような対策が望めますか?再インストールが最終手段でしょうか?

オフライン

 

#8 2010-10-28 16:25:23

tista
ゲスト

Re: windows7の再インストール後ubuntu10.10が起動できない

live CDから直接F6オプションできどうさせようとしたところ

というのは、
・LiveCDをドライブに入れPCを起動し、
・LiveCDの起動画面が正常に描画され、
・F6キーで詳細オプションを表示することが出来て、
・ご提案させて頂いたboot=casperの表記が確認できて、
・root=/dev/sda5に書き換えて、
・詳細オプションを抜けてLiveCDを起動したところ、

という意味でしょうか。もしそうだとするとroot file systemをmountできていないのかも知れません(HDD内のExt4でフォーマットされたルートパーティションを認識できないと同義です)。
さらにquiet splashのオプションを消して起動してみるとkernel panic以前のメッセージが見えますが、これ以上調査するならそれなりの覚悟が必要です・・・。仮にUbuntu内に大事なデータがあるようならLiveCDを普通に起動してデータを退避し、再インストールされたほうが楽でしょう。

蛇足ですが、Error Massageはできるだけ正確に書いて頂いたほうが解決が早まる場合もあります。
英語で表記されているなら意訳せずそのままの文面を転写するようにして下さい。

 

#9 2010-10-29 02:52:31

hey
メンバ
登録日: 2010-10-28

Re: windows7の再インストール後ubuntu10.10が起動できない

失礼しました、再度試したところ無事元々入っていたUBUNTUを起動できました。この後はどうすればよいでしょうか?できるだけコマンドなどについては省略しないで書いていただけるとありがたいです。

オフライン

 

#10 2010-10-29 03:06:18

hey
メンバ
登録日: 2010-10-28

Re: windows7の再インストール後ubuntu10.10が起動できない

自分でやってみたところ以下のようなエラーが出ました
hey@hey-PC-LL550LG:~$ sudo grub-install --root-directory=/mnt/sda5 /dev/sda5
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR.  This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-setup: error: if you really want blocklists, use --force.
hey@hey-PC-LL550LG:~$

オフライン

 

#11 2010-10-29 08:13:35

tista
ゲスト

Re: windows7の再インストール後ubuntu10.10が起動できない

自分でやってみたところ以下のようなエラーが出ました
hey@hey-PC-LL550LG:~$ sudo grub-install --root-directory=/mnt/sda5 /dev/sda5
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR.  This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-setup: error: if you really want blocklists, use --force.
hey@hey-PC-LL550LG:~$

すいませんが、このgrub-installの構文はどこかの記載をコピーしてお使いなのでしょうか?
構文的に誤りがあると思われるのですが、差し支えなければ引用元をお教え下さい。

さて、HDD内のUbuntuを無事起動できたということで、これからGrubのインストールを行ないます。
その前に最終確認ですが、もしお使いのPCがHDD内にリカバリ専用パーティションをお持ちの場合、
MBRへGrubをインストールするとそのリカバリツールが利用できなくなります。
また、PBRへGrubをインストールする場合、その他のBoot Loader(例えばWindwosのNT Loaderのようなもの)を使い、
chainloadという形でPBRのGrubを起動します(例えばNT Loader→Grub→Ubuntuという多段式の起動になります)。
どのような方式でGrubをどこに格納したいのかをWeb検索などを利用してお決め頂く必要があります。
よく熟慮された上で方針をお決め頂きますようお願いします。

 

#12 2010-10-29 08:39:04

hey
メンバ
登録日: 2010-10-28

Re: windows7の再インストール後ubuntu10.10が起動できない

先のコマンドは以下のサイトから使用しました http://rogiken.org/iilab/index.php?TechMemo/Linux/grub-install
Grubの格納場所?についてはいろいろな選択があるようですが、自分にはその選択の違いによるメリットが今の時点でいまいちわからないので、
とりあえずもう一度デュアルの環境にちゃんともどせる方法がいいなと考えています。初心者ですみません

オフライン

 

#13 2010-10-29 09:07:58

tista
ゲスト

Re: windows7の再インストール後ubuntu10.10が起動できない

とりあえずもう一度デュアルの環境にちゃんともどせる方法がいいなと考えています。

ひとつご確認ですが、以前正常にデュアルブートを実現していた際には、GrubにてWindowsを起動していましたでしょうか?
もしそうならGrubがMBRにインストールされている可能性が高いでしょう。
それをそのまま実現するなら、#6の方法でLiveCDを経由してHDD内のUbuntuを起動し、
端末より以下のコマンドを走らせます。

コード:

sudo grub-install /dev/sda

もし、Grub以外からWindowsを起動していた場合は上記以外の方法でデュアルブートを実現する必要があるでしょう。

 

#14 2010-10-29 09:54:13

hey
メンバ
登録日: 2010-10-28

Re: windows7の再インストール後ubuntu10.10が起動できない

hey@hey-PC-LL550LG:~$ sudo grub-install /dev/sda
Searching for GRUB installation directory ... found: /boot/grub
Installing GRUB to /dev/sda as (hd0)...
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0)    /dev/fd0
(hd0)    /dev/sda
hey@hey-PC-LL550LG:~$
となりました、これでOKでしょうか?今からこのまま再起動させてみます

オフライン

 

#15 2010-10-29 10:00:42

hey
メンバ
登録日: 2010-10-28

Re: windows7の再インストール後ubuntu10.10が起動できない

再起動するとUBUNTUログイン起動できました!ただOSの選択画面’が表示されず必ずubuntuからの起動になってしまうようです

オフライン

 

#16 2010-10-29 11:12:36

tista
ゲスト

Re: windows7の再インストール後ubuntu10.10が起動できない

再起動するとUBUNTUログイン起動できました!ただOSの選択画面’が表示されず必ずubuntuからの起動になってしまうようです

とのことですので、GrubへLinuxOS以外のOSエントリを追加するため、Ubuntu上で以下のコマンドを実行して下さい。

コード:

sudo os-prober

os-proberによってlocal HDD内のUbuntu以外のOSが利用するシステムパーティションを検出し、適切なラベルを充て、Grubエントリを満足するよう自動で作業が行なえます。もしos-proberでWindowsを検出し、そのブロックデバイス名が間違いない場合、下記コマンドでGrubへ反映させることができます。

コード:

sudo update-grub

仮にos-proberで他のOSを検出できなかった場合、手動でエントリを追加しなくてはなりません(この段階でsudo update-grubは実行しても意味がありません)。

蛇足ですが、当方から今まで多くのご質問をしてきたかとは思いますが、いち回答者としましては、前回のご質問への回答が成されないまま次の当方の投稿をコピー&ペーストして実行し、結果だけ報告されるというのはあまり気持ちの良いものではありません・・・。

 

#17 2010-10-29 11:37:57

hey
メンバ
登録日: 2010-10-28

Re: windows7の再インストール後ubuntu10.10が起動できない

Re:そのようなつもりはまったくなかったです、言葉が足りず申し訳ないです。とても迅速な回答と初心者の私への正確なアドバイスにとても感謝しています。


おっしゃられた通りsudo os-prober を打つと

/dev/sda1:Windows 7 (loader):Windows:chain と表示されました。
そしてsudo update-grubを走らせると以下の表示がされました

Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.35-22-generic
Found GRUB 2: /boot/grub/core.img
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

これでおわりかなと思って再起動させたのですが
依然OS選択画面は出てこず、Escを押して起動オプションからもwindowsのloaderは確認できないという状況です (Ubuntu 10.10, recovery のみ表示) 

オフライン

 

#18 2010-10-29 12:06:14

tista
ゲスト

Re: windows7の再インストール後ubuntu10.10が起動できない

おっしゃられた通りsudo os-prober を打つと

/dev/sda1:Windows 7 (loader):Windows:chain と表示されました。
そしてsudo update-grubを走らせると以下の表示がされました

Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.35-22-generic
Found GRUB 2: /boot/grub/core.img
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

vmlinuzのバージョンからUbuntu 10.10をお使いであろうかと察しますが、Ubuntu 10.10では既に/boot/grub/menu.lstは使用しません。代わりに/boot/grub/grub.cfgを利用します。なぜmenu.lstがあるのか不思議なのですが・・・。

まぁそれはそれとして、では、下記のコマンドでmenu.lstの内容を投稿して下さい。

コード:

cat /boot/grub/menu.lst
 

#19 2010-10-29 12:16:59

hey
メンバ
登録日: 2010-10-28

Re: windows7の再インストール後ubuntu10.10が起動できない

ん~そうなのですか、そこらへんの事情はまったく自分には見当もつかないです。

では、コマンドの結果です、とても長い?ですがお願いします
hey@hey-PC-LL550LG:~$ cat /boot/grub/menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-legacy-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default        0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout        3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title        Windows 95/98/NT/2000
# root        (hd0,0)
# makeactive
# chainloader    +1
#
# title        Linux
# root        (hd0,1)
# kernel    /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=8d8b575b-e620-44f4-8f94-7f87af9ac9c7 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=8d8b575b-e620-44f4-8f94-7f87af9ac9c7

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
##      indomU=true
##      indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title        Ubuntu 10.10, kernel 2.6.35-22-generic
uuid        8d8b575b-e620-44f4-8f94-7f87af9ac9c7
kernel        /boot/vmlinuz-2.6.35-22-generic root=UUID=8d8b575b-e620-44f4-8f94-7f87af9ac9c7 ro quiet splash
initrd        /boot/initrd.img-2.6.35-22-generic
quiet

title        Ubuntu 10.10, kernel 2.6.35-22-generic (recovery mode)
uuid        8d8b575b-e620-44f4-8f94-7f87af9ac9c7
kernel        /boot/vmlinuz-2.6.35-22-generic root=UUID=8d8b575b-e620-44f4-8f94-7f87af9ac9c7 ro  single
initrd        /boot/initrd.img-2.6.35-22-generic

title        Chainload into GRUB 2
root        8d8b575b-e620-44f4-8f94-7f87af9ac9c7
kernel        /boot/grub/core.img

title        Ubuntu 10.10, memtest86+
uuid        8d8b575b-e620-44f4-8f94-7f87af9ac9c7
kernel        /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST
hey@hey-PC-LL550LG:~$

以上がコマンドの結果になります、よろしくおねがいします

オフライン

 

#20 2010-10-29 12:48:21

tista
ゲスト

Re: windows7の再インストール後ubuntu10.10が起動できない

ご投稿ありがとう御座います。
なんとなくですが、理解できました。
どうも、今回新たにインストールしたGrubとは別に、以前からhey様がgrub-installにてインストールされていたgrubが両方存在するようです(今回のインストール先はMBRで、以前のものは/dev/sda5のパーティション内、つまりはPBRにいる可能性です)。
そのため、grubからgrubへのchainloadを指すエントリが生成されているのでしょう(下記のエントリ)。

コード:

title        Chainload into GRUB 2
root        8d8b575b-e620-44f4-8f94-7f87af9ac9c7
kernel        /boot/grub/core.img

では、実際にmenu.lstへ手動でWindows7をbootするエントリを追加してみます。
まずは、テキストエディタにてmenu.lstを編集可能な状態で開きます(例えばgedit)。rootパスワードが必要です。

コード:

gksu gedit /boot/grub/menu.lst

以前ご投稿頂いたos-proberの結果から、Windows7は/dev/sda1に存在すると思われるので、最終行

コード:

### END DEBIAN AUTOMAGIC KERNELS LIST

の上に以下のように追記します。

コード:

title        Windows 7 (loader) (on /dev/sda1)
root        (hd0,0)
savedefault
makeactive
chainloader    +1

追記したらsaveして、ちょっと危険なのですがそのまま再起動してみて下さい。

 

#21 2010-10-29 13:10:44

hey
メンバ
登録日: 2010-10-28

Re: windows7の再インストール後ubuntu10.10が起動できない

おおお!!、無事windows7も起動できました、ありがとうございます!!!
ただひっかかるのはlaptopの電源を入れたときにそのままubutu or windows7OS選択画面が出るのではなく、
Grubの準備中?3秒以内にEscを押して選択オプションを開くとwindows7が選択可能になるのですが、これはこういう仕様なのでしょうか?
とりあえず今はデュアルブートに戻すことができてとてもうれしいです、迅速な回答にとても感謝しております。私も日本に帰ったらまず本買って勉強します。

オフライン

 

#22 2010-10-29 13:16:25

tista
ゲスト

Re: windows7の再インストール後ubuntu10.10が起動できない

無事にWin7も起動できたようでおめでとう御座います。

さて、下記の問題

ただひっかかるのはlaptopの電源を入れたときにそのままubutu or windows7OS選択画面が出るのではなく、
Grubの準備中?3秒以内にEscを押して選択オプションを開くとwindows7が選択可能になるのですが、これはこういう仕様なのでしょうか?

ですが、これもmenu.lstを編集することで回避可能です。
下記のような記述がmenu.lst内にあるでしょう。

コード:

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

これを以下のように編集します(行頭に#を付加し、コメント扱いにします。

コード:

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
# hiddenmenu

これでgrub画面でEscを押下することなくOS選択メニューが表示されるはずです。

 

Board footer

Powered by FluxBB