双盘安装win7和Ubuntu

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
TN801465
帖子: 11
注册时间: 2015-11-21 9:40
系统: 14.04

双盘安装win7和Ubuntu

#1

帖子 TN801465 » 2015-11-21 9:50

请问各位大侠:
本人最新加了一个固态盘分成两个分区,然后将win7安装在固态盘上,再之后在硬盘的另一个分区安装了Ubuntu14.04,可结果是根本没有Ubuntu的引导界面而一直是win7,使用BCD设置添加了Ubuntu也还是无法进入Ubuntu,请问这是什么情况
注: 1. 本人之前笔记本只有一块硬盘的时候也是先安装win7后安装Ubuntu,能直接进入Ubuntu引导界面
2. BIOS界面里面显示第一启动的是固态盘,第二启动的是原本笔记本上的硬盘
上次由 TN801465 在 2015-11-24 23:54,总共编辑 2 次。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 双盘安装win7和Ubuntu

#2

帖子 poloshiao » 2015-11-21 10:47

1. 使用 Ubuntu Live CD/DVD/USB 開機
登入 試用桌面 把下面指令 複製 貼進終端機 執行
1-1. sudo fdisk -l
1-2. sudo parted -l print
1-3. sudo gdisk -l /dev/sda
1-4. sudo gdisk -l /dev/sdb
1-5. sudo /etc/grub.d/30_os-prober
把結果直接 選取/複製/貼上來
2. BIOS界面里面显示第一启动的是固态盘
2. 有沒有 第二啟動盤

3. 目前能否用什麼方法 啟動 Ubuntu 登入 Ubuntu 桌面
TN801465
帖子: 11
注册时间: 2015-11-21 9:40
系统: 14.04

Re: 双盘安装win7和Ubuntu

#3

帖子 TN801465 » 2015-11-21 11:46

1. 一个启动盘是固态盘,第二启动盘是笔记本本身的硬盘
2. 使用的是USB在win7上安装Ubuntu,Ubuntu无法进入任何方式,再使用U盘时候又是提示安装Ubuntu
TN801465
帖子: 11
注册时间: 2015-11-21 9:40
系统: 14.04

Re: 双盘安装win7和Ubuntu

#4

帖子 TN801465 » 2015-11-21 11:49

我有个疑问:
是不是由于主分区跟逻辑分区造成的问题: 目前两块硬盘有3个主分区并且都是WIN7下面的,而Ubuntu下/boot、/usr等全部都是逻辑分区?
头像
qy117121
论坛版主
帖子: 50587
注册时间: 2007-12-14 13:40
系统: Winbuntu
来自: 志虚国乌由市
联系:

Re: 双盘安装win7和Ubuntu

#5

帖子 qy117121 » 2015-11-21 11:52

图片
我只想问一下,图中鼠标这里,你选择了哪里?
渠月 · QY   
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu

邮箱 [email protected]
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 双盘安装win7和Ubuntu

#6

帖子 poloshiao » 2015-11-21 16:29

viewtopic.php?p=3149013#p3149013
1. 使用 Ubuntu Live CD/DVD/USB 開機
登入 試用桌面 把下面指令 複製 貼進終端機 執行
1-1. sudo fdisk -l
1-2. sudo parted -l print
1-3. sudo gdisk -l /dev/sda
1-4. sudo gdisk -l /dev/sdb
1-5. sudo /etc/grub.d/30_os-prober
把結果直接 選取/複製/貼上來
TN801465
帖子: 11
注册时间: 2015-11-21 9:40
系统: 14.04

Re: 双盘安装win7和Ubuntu

#7

帖子 TN801465 » 2015-11-21 20:23

我安装Ubuntu时: Device for boot loader installation: /dev/sda9 即:"/" 请问此处该如何选择?以前我一直是默认选择/dev/sda

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes # /dev/sda: Hard Disk(硬盘)
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x80a5a07f

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 209717247 104857600 7 HPFS/NTFS/exFAT # win7: D盘
/dev/sda2 209717248 419432447 104857600 7 HPFS/NTFS/exFAT # win7: E盘
/dev/sda3 419432448 850939903 215753728 7 HPFS/NTFS/exFAT # win7: F盘
/dev/sda4 850941950 976771071 62914561 5 Extended #这个应该是表示Ubuntu系统所占有的分区?
Partition 4 does not start on physical sector boundary.
/dev/sda5 850941952 851439615 248832 83 Linux # /boot
/dev/sda6 851441664 863438847 5998592 82 Linux swap / Solaris # swap
/dev/sda7 863440896 875438079 5998592 83 Linux # /usr
/dev/sda8 875440128 887437311 5998592 83 Linux # /var
/dev/sda9 887439360 903438335 7999488 83 Linux # /
/dev/sda10 968773632 976771071 3998720 83 Linux # /home
/dev/sda11 903440384 968767487 32663552 83 Linux # /tmp

Partition table entries are not in disk order

Disk /dev/sdb: 128.0 GB, 128032964608 bytes # /dev/sdb: SSD(固态盘)
255 heads, 63 sectors/track, 15565 cylinders, total 250064384 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc6942324

Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 125831167 62914560 7 HPFS/NTFS/exFAT # win7: C盘
/dev/sdb2 125831168 250058751 62113792 7 HPFS/NTFS/exFAT # win7: I盘

Disk /dev/sdc: 7849 MB, 7849115648 bytes
255 heads, 63 sectors/track, 954 cylinders, total 15330304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcad4ebea

Device Boot Start End Blocks Id System
/dev/sdc4 * 256 15330303 7665024 b W95 FAT32 # 此处表示什么?


ubuntu@ubuntu:~$ sudo parted -l print
Model: ATA TOSHIBA MQ01ABF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number Start End Size Type File system Flags
1 1049kB 107GB 107GB primary ntfs boot
2 107GB 215GB 107GB primary ntfs
3 215GB 436GB 221GB primary ntfs
4 436GB 500GB 64.4GB extended
5 436GB 436GB 255MB logical ext4
6 436GB 442GB 6143MB logical linux-swap(v1)
7 442GB 448GB 6143MB logical ext4
8 448GB 454GB 6143MB logical ext4
9 454GB 463GB 8191MB logical ext4
11 463GB 496GB 33.4GB logical ext4
10 496GB 500GB 4095MB logical ext4


Model: ATA KING SHARE 23012 (scsi)
Disk /dev/sdb: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 1049kB 64.4GB 64.4GB primary ntfs boot
2 64.4GB 128GB 63.6GB primary ntfs


Model: SanDisk Cruzer Blade (scsi)
Disk /dev/sdc: 7849MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
4 131kB 7849MB 7849MB primary fat32 boot


ubuntu@ubuntu:~$ sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************

Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 1FC44803-DA7A-4CC2-B470-ECC300E629CD
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 22509 sectors (11.0 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 209717247 100.0 GiB 0700 Microsoft basic data
2 209717248 419432447 100.0 GiB 0700 Microsoft basic data
3 419432448 850939903 205.8 GiB 0700 Microsoft basic data
5 850941952 851439615 243.0 MiB 8300 Linux filesystem
6 851441664 863438847 5.7 GiB 8200 Linux swap
7 863440896 875438079 5.7 GiB 8300 Linux filesystem
8 875440128 887437311 5.7 GiB 8300 Linux filesystem
9 887439360 903438335 7.6 GiB 8300 Linux filesystem
10 968773632 976771071 3.8 GiB 8300 Linux filesystem
11 903440384 968767487 31.2 GiB 8300 Linux filesystem


ubuntu@ubuntu:~$ sudo gdisk -l /dev/sdb
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************

Disk /dev/sdb: 250064384 sectors, 119.2 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): D183A93E-3542-43A6-9FE5-1EF350CF4C3B
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 250064350
Partitions will be aligned on 2048-sector boundaries
Total free space is 7613 sectors (3.7 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 125831167 60.0 GiB 0700 Microsoft basic data
2 125831168 250058751 59.2 GiB 0700 Microsoft basic data


ubuntu@ubuntu:~$ sudo /etc/grub.d/30_os-prober
Found Ubuntu 14.04.1 LTS (14.04) on /dev/sda9
menuentry 'Ubuntu 14.04.1 LTS (14.04) (on /dev/sda9)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-bcc8708f-6c7d-4eb6-a8ac-e3abd4cb5fc8' {
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 42120a80-50c6-4123-85d0-e4a84415c5f4
else
search --no-floppy --fs-uuid --set=root 42120a80-50c6-4123-85d0-e4a84415c5f4
fi
linux /vmlinuz-3.13.0-32-generic root=UUID=bcc8708f-6c7d-4eb6-a8ac-e3abd4cb5fc8 ro quiet splash $vt_handoff
initrd /initrd.img-3.13.0-32-generic
}
submenu 'Advanced options for Ubuntu 14.04.1 LTS (14.04) (on /dev/sda9)' $menuentry_id_option 'osprober-gnulinux-advanced-bcc8708f-6c7d-4eb6-a8ac-e3abd4cb5fc8' {
menuentry 'Ubuntu (on /dev/sda9)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.13.0-32-generic--bcc8708f-6c7d-4eb6-a8ac-e3abd4cb5fc8' {
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 42120a80-50c6-4123-85d0-e4a84415c5f4
else
search --no-floppy --fs-uuid --set=root 42120a80-50c6-4123-85d0-e4a84415c5f4
fi
linux /vmlinuz-3.13.0-32-generic root=UUID=bcc8708f-6c7d-4eb6-a8ac-e3abd4cb5fc8 ro quiet splash $vt_handoff
initrd /initrd.img-3.13.0-32-generic
}
menuentry 'Ubuntu, with Linux 3.13.0-32-generic (on /dev/sda9)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.13.0-32-generic--bcc8708f-6c7d-4eb6-a8ac-e3abd4cb5fc8' {
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 42120a80-50c6-4123-85d0-e4a84415c5f4
else
search --no-floppy --fs-uuid --set=root 42120a80-50c6-4123-85d0-e4a84415c5f4
fi
linux /vmlinuz-3.13.0-32-generic root=UUID=bcc8708f-6c7d-4eb6-a8ac-e3abd4cb5fc8 ro quiet splash $vt_handoff
initrd /initrd.img-3.13.0-32-generic
}
menuentry 'Ubuntu, with Linux 3.13.0-32-generic (recovery mode) (on /dev/sda9)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.13.0-32-generic-root=UUID=bcc8708f-6c7d-4eb6-a8ac-e3abd4cb5fc8 ro recovery nomodeset-bcc8708f-6c7d-4eb6-a8ac-e3abd4cb5fc8' {
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 42120a80-50c6-4123-85d0-e4a84415c5f4
else
search --no-floppy --fs-uuid --set=root 42120a80-50c6-4123-85d0-e4a84415c5f4
fi
linux /vmlinuz-3.13.0-32-generic root=UUID=bcc8708f-6c7d-4eb6-a8ac-e3abd4cb5fc8 ro recovery nomodeset
initrd /initrd.img-3.13.0-32-generic
}
}

Found Windows 7 (loader) on /dev/sdb1
menuentry 'Windows 7 (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-70CC3EF8CC3EB864' {
insmod part_msdos
insmod ntfs
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1 70CC3EF8CC3EB864
else
search --no-floppy --fs-uuid --set=root 70CC3EF8CC3EB864
fi
parttool ${root} hidden-
chainloader +1
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
set timeout=10
fi
上次由 TN801465 在 2015-11-24 15:17,总共编辑 2 次。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 双盘安装win7和Ubuntu

#8

帖子 poloshiao » 2015-11-21 20:52

Disk /dev/sda: 500.1 GB, 500107862016 bytes
1. 這是 固态盘 ?
Disk /dev/sdb: 128.0 GB, 128032964608 bytes
2. 這是 硬盘 ?
sudo /etc/grub.d/30_os-prober
Found Ubuntu 14.04.1 LTS (14.04) on /dev/sda12
... 其它暫省略
Found MS-DOS 5.x/6.x/Win3.1 on /dev/sda7
... 其它暫省略
Found Windows 7 (loader) on /dev/sdb1
... 其它暫省略
3. 表示 在
/dev/sda12 找到 Ubuntu 14.04.1 LTS 可開機檔案
/dev/sda7 找到 MS-DOS 5.x/6.x/Win3.1 可開機檔案
/dev/sdb1 找到 Windows 7 可開機檔案
3-1. 這三個 可以被安排進 grub 2 開機選單內
一个启动盘是固态盘,第二启动盘是笔记本本身的硬盘
使用BSD设置添加了Ubuntu也还是无法进入Ubuntu
3. 你目前要進 BCD 選單前 是設定 /dev/sda 還是 /dev/sdb 為最優先開機裝置 ?
意思是 從 固态盘启动 還是從 硬盘启动
TN801465
帖子: 11
注册时间: 2015-11-21 9:40
系统: 14.04

Re: 双盘安装win7和Ubuntu

#9

帖子 TN801465 » 2015-11-21 23:11

Disk /dev/sdb: 128.0 GB, 128032964608 bytes 这个是固态盘 ----> 默认已经是第一顺序启动此盘
Disk /dev/sda: 500.1 GB, 500107862016 bytes 这个是硬盘

固态盘被分成两个分区,其中win7就安装在固态盘上
Ubuntu被安装在硬盘上

请问我该如何处理
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 双盘安装win7和Ubuntu

#10

帖子 poloshiao » 2015-11-21 23:50

Disk /dev/sdb: 128.0 GB, 128032964608 bytes 这个是固态盘 ----> 默认已经是第一顺序启动此盘
1. 表示 windows 7 的開機導引 安裝在 /dev/sdb 的 MBR

2. 現在 建議你 把 Ubuntu 開機導引 grub 2 安裝在 /dev/sda 的 MBR
2-1. 參閱
http://apexu.com/apexu/tw/modules/publi ... p?itemid=1
使用 ubuntu live CD/DVD/USB 重新安裝 grub 2
特別提醒
grub-install /dev/sda
安裝完畢 重新開機 需要設定 /dev/sda 為最優先開機裝置
2-2. 如果可以開機登入 Ubuntu
表示 Ubuntu 開機檔案沒問題

3. 如果你想試試 把 Ubuntu 開機檔案 加入 BCD
從 /dev/sdb 開機
請再貼文

4. 補充 上面的安排 讓
windows 開機導引 安裝在 /dev/sdb
ubuntu 開機導引 安裝在 /dev/sda
兩者互相獨立

5. 不要急著動手 有疑問 先問清楚
TN801465
帖子: 11
注册时间: 2015-11-21 9:40
系统: 14.04

Re: 双盘安装win7和Ubuntu

#11

帖子 TN801465 » 2015-11-22 17:35

我执行到 "8. sudo chroot /mnt " 这一步的时候就无法继续下去了,提示错误:chroot: failed to run command '/bin/bash': No such file or directory

然后我执行echo $PATH ,结果:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 双盘安装win7和Ubuntu

#12

帖子 poloshiao » 2015-11-22 18:25

我执行到 "8. sudo chroot /mnt " 这一步的时候就无法继续下去了,提示错误:chroot: failed to run command '/bin/bash': No such file or directory
1. 你安裝 Ubuntu 時 是不是 /home 或者 /boot 掛載在獨立分割區
1-1. 如果是 詳細參閱該篇文章
1-2. 如果不是
把下面指令 複製 貼進終端機 執行
1-2-1. sudo ls -al /mnt | grep bin
1-2-2. sudo ls -al /mnt/bin | grep bash
把結果直接 選取/複製 貼上來
TN801465
帖子: 11
注册时间: 2015-11-21 9:40
系统: 14.04

Re: 双盘安装win7和Ubuntu

#13

帖子 TN801465 » 2015-11-22 20:42

我的Ubuntu是安装在硬盘sda原本最后一个逻辑分区当中
/boot , swap , /usr , /var , / , /home , /tmp
sda5 sda6 sda7 sda8 sda9 sda10 sda11


ubuntu@ubuntu:~$ sudo ls -al /mnt | grep bin #没有任何结果
ubuntu@ubuntu:~$ sudo ls -al /mnt/bin | grep bash
ls: cannot access /mnt/bin: No such file or directory
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 双盘安装win7和Ubuntu

#14

帖子 poloshiao » 2015-11-22 21:00

(sda) Ubuntu --> /boot , swap , /usr , /var , / , /home , /tmp
sudo /etc/grub.d/30_os-prober
Found Ubuntu 14.04.1 LTS (14.04) on /dev/sda12
... 其它暫省略
sudo ls -al /mnt | grep bin #没有任何结果
1. 你這裡的 /dev/sda12 是不是 掛載 /boot

2. 如果是
http://apexu.com/apexu/tw/modules/publi ... p?itemid=1
使用 ubuntu live CD/DVD/USB 重新安裝 grub 2
需要
把 /mnt 掛載到 你原來掛載 / 的分割區後
再額外
另創 /mnt/boot
把 /mnt/boot 掛載到 你原來掛載 /boot 的分割區
另創 /mnt/usr
把 /mnt/usr 掛載到 你原來掛載 /usr 的分割區
另創 /mnt/var
把 /mnt/var 掛載到 你原來掛載 /var 的分割區
另創 /mnt/home
把 /mnt/home 掛載到 你原來掛載 /home 的分割區

3. 安裝完 grub 2 離開 chroot 以後
要先 umount 這一些額外掛載的目錄
最後再 umount /mnt
runtowhere
帖子: 4
注册时间: 2010-11-11 22:48

Re: 双盘安装win7和Ubuntu

#15

帖子 runtowhere » 2015-11-23 5:42

qy117121 写了:图片
我只想问一下,图中鼠标这里,你选择了哪里?
你好,请问这个改选哪个啊?
今天想把Ubuntu装到移动硬盘上,开机后显示“ntldr is missing”,启动不了...
我选的是boot分区,是不是上面的问题与选这个有关呢?
谢谢!
回复