如何重裝 Ubuntu ? [論壇 - Ubuntu安裝問題]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



如何重裝 Ubuntu ?
會員三級
註冊日期:
2009/3/12 22:37
所屬群組:
已註冊使用者
等級: 13
HP : 0 / 323
MP : 74 / 13454
EXP: 94
離線
原本Ubuntu 10.04 LTS 硬碟裝上新底板 (GIGABYTE GA41M- Combo)後無法使用
用usb boot機則連不到線
我是否要用新版本

2014/12/30 9:08
應用擴展 工具箱
回覆: 如何重裝 Ubuntu ?
會員五級
註冊日期:
2009/10/16 8:57
所屬群組:
已註冊使用者
等級: 22
HP : 0 / 541
MP : 204 / 21575
EXP: 67
離線
w1w 寫到:
原本Ubuntu 10.04 LTS 硬碟裝上新底板 (GIGABYTE GA41M- Combo)後無法使用
用usb boot機則連不到線
我是否要用新版本


你所謂的無法使用是指?
是否是無法使用網路? 還是其它問題?

2014/12/30 10:35
同源一体、感同身受、樂於分享、教學相長!
寬廣的心, 世界不會小 ^_^
CreMaker 的生活網誌
應用擴展 工具箱
回覆: 如何重裝 Ubuntu ?
會員三級
註冊日期:
2009/3/12 22:37
所屬群組:
已註冊使用者
等級: 13
HP : 0 / 323
MP : 74 / 13454
EXP: 94
離線
不用USB便無法BOOT機
用USB入到UBUNTU但是無法使用網路

2014/12/30 11:41
應用擴展 工具箱
回覆: 如何重裝 Ubuntu ?
會員五級
註冊日期:
2009/10/29 4:50
所屬群組:
已註冊使用者
等級: 41
HP : 204 / 1021
MP : 928 / 40584
EXP: 87
離線
w1w 寫到:
不用USB便無法BOOT機
用USB入到UBUNTU但是無法使用網路


先重裝GRUB看看,
掛載硬碟後,執行以下指令:

sudo grub-install --root-directory=目標硬碟根目錄的掛載位置 /dev/目標硬碟代號

例如:

sudo grub-install --root-directory=/ /dev/sda
sudo grub-install --root-directory=/media/user/d82aa9c9-2a9c-46f3-af9a-912ed2346479 /dev/sdb

2014/12/30 12:32
應用擴展 工具箱
回覆: 如何重裝 Ubuntu ?
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29274
EXP: 6
離線
xenomorph0525 寫到:
w1w 寫到:
不用USB便無法BOOT機
用USB入到UBUNTU但是無法使用網路


先重裝GRUB看看,
掛載硬碟後,執行以下指令:

sudo grub-install --root-directory=目標硬碟根目錄的掛載位置 /dev/目標硬碟代號

例如:

sudo grub-install --root-directory=/ /dev/sda
sudo grub-install --root-directory=/media/user/d82aa9c9-2a9c-46f3-af9a-912ed2346479 /dev/sdb


因為我只會「sudo grub-install /dev/sda」,這個用法,其他的我就沒深究了。

剛看到「--root-directory」這個選項,蠻好奇他的用法。

我的測試環境是「Xubuntu 14.04 - 64位元」。

查了一下

$ man grub-install

只有看到

--boot-directory=DIR
install GRUB images under the directory DIR/grub instead of the boot/grub directory



後來看到下面的「 SEE ALSO」


SEE ALSO
grub-mkconfig(8), grub-mkimage(1), grub-mkrescue(1)

The full documentation for grub-install is maintained as a Texinfo manual. If the info and grub-install programs are properly
installed at your site, the command

info grub-install

should give you access to the complete manual.



所以執行

$ info grub-install

看到這一段


'--boot-directory=DIR'
Install GRUB images under the directory 'DIR/grub/' This option is
useful when you want to install GRUB into a separate partition or a
removable disk. If this option is not specified then it defaults
to '/boot', so

grub-install /dev/sda

is equivalent to

grub-install --boot-directory=/boot/ /dev/sda

Here is an example in which you have a separate "boot" partition
which is mounted on '/mnt/boot':

grub-install --boot-directory=/mnt/boot /dev/sdb



後來用「grub-install」查詢。

發現了「Ubuntu Community Help Wiki / Grub2/Installing 」這一篇有提到


grub-install will restore missing files in the grub folder but will not restore intentionally deleted or corrupted files. To accomplish these tasks GRUB 2 must be completely removed and reinstalled.

sudo mount /dev/sdXY /mnt # Example: sudo mount /dev/sda5 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sdX # Example: sudo grub-install --boot-directory=/mnt/boot /dev/sda

If Ubuntu is installed on B-tree file system i.e. btrfs then /boot changes to /@/boot in above commands such that :

sudo grub-install --boot-directory=/mnt/@/boot /dev/sdX # Example: sudo grub-install --boot-directory=/mnt/@/boot /dev/sda

For GRUB 2 version 1.98 and earlier (Ubuntu 10.04), the installation command is slightly different. Rather than designating the --boot-directory, the switch is --root-directory. In this case, the location changes to /mnt

sudo grub-install --root-directory=/mnt /dev/sdX



剛好樓主使用的版本是「Ubuntu 10.04 LTS」。

然後從「這篇」也有提到「--root-directory」相關的教學。

在「Arch Wiki / GRUB」也有一個地方有提到「--root-directory」。


所以查詢「Ubuntu 10.04」的 manual,就有「 --root-directory」這個選項了。

$ man grub-install


## 查詢版本

$ grub-install --version

或是

$ grub-install -V


## 查詢 grub-install 屬於哪個套件

$ dpkg -S grub-install

## 相關討論

* 請教重新安裝GRUB的指令


以上,初步探索的紀錄,其他的還沒有深究...


2014/12/30 14:14
應用擴展 工具箱
回覆: 如何重裝 Ubuntu ?
會員五級
註冊日期:
2009/10/29 4:50
所屬群組:
已註冊使用者
等級: 41
HP : 204 / 1021
MP : 928 / 40584
EXP: 87
離線
samwhelp 寫到:
xenomorph0525 寫到:
w1w 寫到:
不用USB便無法BOOT機
用USB入到UBUNTU但是無法使用網路


先重裝GRUB看看,
掛載硬碟後,執行以下指令:

sudo grub-install --root-directory=目標硬碟根目錄的掛載位置 /dev/目標硬碟代號

例如:

sudo grub-install --root-directory=/ /dev/sda
sudo grub-install --root-directory=/media/user/d82aa9c9-2a9c-46f3-af9a-912ed2346479 /dev/sdb


另外我有個疑問,這個狀況下,是否需要「chroot」,才執行「grub-install」。
還是說不需要「chroot」,就可以直接執行「grub-install」。



不需要「chroot」,
掛載目標硬碟的「/分割區」,然後用「--root-directory=」指定便可。

另外根據samwhelp大大的補充,
如果目標硬碟的/boot有專屬分割區的話,也需要先掛載在目標硬碟的「/boot」目錄下。

2014/12/30 14:26
應用擴展 工具箱
回覆: 如何重裝 Ubuntu ?
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29274
EXP: 6
離線
xenomorph0525 寫到:
samwhelp 寫到:
xenomorph0525 寫到:
w1w 寫到:
不用USB便無法BOOT機
用USB入到UBUNTU但是無法使用網路


先重裝GRUB看看,
掛載硬碟後,執行以下指令:

sudo grub-install --root-directory=目標硬碟根目錄的掛載位置 /dev/目標硬碟代號

例如:

sudo grub-install --root-directory=/ /dev/sda
sudo grub-install --root-directory=/media/user/d82aa9c9-2a9c-46f3-af9a-912ed2346479 /dev/sdb


另外我有個疑問,這個狀況下,是否需要「chroot」,才執行「grub-install」。
還是說不需要「chroot」,就可以直接執行「grub-install」。



不需要「chroot」,
掛載目標硬碟的「/分割區」,然後用「--root-directory=」指定便可。

另外根據samwhelp大大的補充,
如果目標硬碟的/boot有專屬分割區的話,也需要先掛載在目標硬碟的「/boot」目錄下。



剛發問完後,又再仔細看「這篇」和「這篇」,發現有不同方式。

所以先刪除剛剛的發問,沒想到你已經看到,回覆了。

這部份的概念,我還需要消化研究。

感恩!


2014/12/30 14:36
應用擴展 工具箱
回覆: 如何重裝 Ubuntu ?
會員三級
註冊日期:
2009/3/12 22:37
所屬群組:
已註冊使用者
等級: 13
HP : 0 / 323
MP : 74 / 13454
EXP: 94
離線
不能安裝
usr/sbin/grub-probe error: cannot find a device for //boot/grub
No path or device is specified

2015/1/3 11:50
應用擴展 工具箱
回覆: 如何重裝 Ubuntu ?
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29274
EXP: 6
離線
w1w 寫到:
不能安裝
usr/sbin/grub-probe error: cannot find a device for //boot/grub
No path or device is specified


w1w 寫到:
原本Ubuntu 10.04 LTS 硬碟裝上新底板 (GIGABYTE GA41M- Combo)後無法使用
用usb boot機則連不到線
我是否要用新版本


先收集一下資訊,來釐清您目前的狀況。這樣其他人比較容易推敲,才好回答你的問題。

1.現在已經確定您硬碟的作業系統是「Ubuntu 10.04 LTS 」。
2.哪「USB」使用的作業系統是?
3.您執行的「grub-install」版本?
請執行下面的指令來獲得


$ grub-install --version


4.把您執行「重裝Grub」的指令貼出來。
5.您使用「USB」開機後,使用什麼指令或是步驟來掛載你的硬碟分割區。
6.請執行下面的使令,然後提供執行後看到的訊息,來了解你目前掛載硬碟的情形。


$ mount



$ sudo blkid



7. 您原來硬碟的「/boot」,有額外獨立一個分割區,還是你原來硬碟的系統只有「單一個分割區」?


2015/1/3 14:47
應用擴展 工具箱
回覆: 如何重裝 Ubuntu ?
會員三級
註冊日期:
2009/3/12 22:37
所屬群組:
已註冊使用者
等級: 13
HP : 0 / 323
MP : 74 / 13454
EXP: 94
離線
hd可正常用
但仍不能連線上網
network manager 出了x號

2015/1/8 11:43
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.