Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
so I've finished installing ubuntu. I had xp for a while and have installed seven yesterday.
There is a problem with the loader because it automatically logs in with seven.
I'd like to change the loader so that I can choose between xp, seven and ubuntu when it starts.
This is really messy. I have 3 hard drives, and it seems that each one holds a piece of something. I would want only one disk to contain all that is related to the systems, the other 2 are only for data and likely to be removed. From what I saw during the installation process, I have a disk sda that contains data, and maybe grub, a disk sdb that contains the 3 OSes, and a disk sdc that may contain the seven loader. I don't know whether the seven installation, which I did only yesterday, triggered the creation of a windows loader to choose between xp and seven, but I wasn't asked this during the boot.
Please help me to clean this situation so that everything works and is properly lined up.
I used Boot Info Script 0.55 dated February 15th, 2010 to display some more information that you might need. Here is the output:
============================= Boot Info Summary: ==============================
=> Windows is installed in the MBR of /dev/sda
=> Grub 2 is installed in the MBR of /dev/sdb and looks on the same drive in
partition #6 for /boot/grub.
=> Windows is installed in the MBR of /dev/sdc
=> Windows is installed in the MBR of /dev/sdd
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files/dirs: /Windows/System32/winload.exe
File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /ntldr /NTDETECT.COM
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /bootmgr /Boot/BCD
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-28-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
linux /boot/vmlinuz-2.6.32-28-generic root=UUID=e339f209-bb4b-4e57-876a-b2b0d17e2e0b ro quiet splash
initrd /boot/initrd.img-2.6.32-28-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-28-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
echo 'Loading Linux 2.6.32-28-generic ...'
linux /boot/vmlinuz-2.6.32-28-generic root=UUID=e339f209-bb4b-4e57-876a-b2b0d17e2e0b ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-28-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows NT/2000/XP (on /dev/sdb2)" {
insmod ntfs
set root='(hd1,2)'
search --no-floppy --fs-uuid --set 384cd74b4cd70314
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "Windows 7 (loader) (on /dev/sdc1)" {
insmod ntfs
set root='(hd2,1)'
search --no-floppy --fs-uuid --set 9e34497534495207
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sdb6 during installation
UUID=e339f209-bb4b-4e57-876a-b2b0d17e2e0b / ext4 errors=remount-ro 0 1
# /home was on /dev/sdb7 during installation
UUID=069330ae-88c3-41d3-a102-8293f131928f /home ext4 defaults 0 2
# swap was on /dev/sdb5 during installation
UUID=7685b1a8-59ea-4c0a-99b2-d75d54fe99ff none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
=================== sdb6: Location of files loaded by Grub: ===================
I tried sudo mount /dev/sdb6 /mnt since I think sda6 is where / is installed.
Then sudo grub-install --root-directory=/mnt/ /dev/sdb6
The result is:
/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 its use is discouraged..
/usr/sbin/grub-setup: error: if you really want blocklists, use --force.
Right, sorry I'm so dumb.
So I did just that, a line was written saying that it completed successfully.
Then I rebooted the computer, as requested.
It is still booting on 7.
No, what I meant is that grub doesn't appear. It directly loads 7, as if neither ubuntu nor xp were installed.
According to the boot info script of post 3, it would appear that the computer is booting on sdc rather than sdb.
Can I remove (is it dangerous?) the loader of 7 from sdc so that grub is used (it is in sdb) ?
I switched the sata cables of sdb and sdc, and now finally grub launched. The switch I made was at the disk extremities. I think this fact is relevant: the name of the devices (sda,b,c...) depends to the way they're connected to the motherboard, right ? So my switch didn't affect the names, I think.
I am still not satisfied though, because I still think it's quite a mess.
First of all, I find it quite weird that the loader of 7 is in sdc, whereas all the OSes are on sdb. How can I change that ?
Secondly, I would like to change the names so that sda is where the OSes are, it seems more logical to me. I think the first question of this post will help me to achieve that.
Thirdly, I was wondering whether the installation of 7 triggered an installation of a multiboot windows software (something that would allow me to switch between xp and 7). If there is one, I'd like to remove it because grub can do this task.
If you see other things that are messed up, please communicate them to me.
I am at the grub prompt and awaiting for your instructions.
Doesn't my situation have anything to do with the boot flags ? I can see that xp (sdb2 in the text above, now sdc2 after the switch) is the only one who has a boot flag set...
I have made some more wire switches. The devices are now named the way I want (in particular, sda is the device where the OSes are.
I think I'm done moving the wires around, now I just need to configure the computer to make it work the way it is.
As it is, windows 7 launches automatically, (windows7 is in sda1, but its loader is in sdc1...). grub doesn't launch (it is in the sda mbr).
So what I would like to do is to make my computer launch grub when it boots.
Then, I'd like to clean it all to make it less of a mess. In particular, if it is possible, I'd like to remove the windows 7 launcher that is in sdc1 and has nothing to do there (it's just a data drive).
Here it the boot info script output:
Boot Info Script 0.55 dated February 15th, 2010
============================= Boot Info Summary: ==============================
=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #6 for /boot/grub.
=> Windows is installed in the MBR of /dev/sdb
=> Windows is installed in the MBR of /dev/sdc
=> Windows is installed in the MBR of /dev/sdd
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files/dirs: /Windows/System32/winload.exe
File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /ntldr /NTDETECT.COM
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /bootmgr /Boot/BCD
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-28-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
linux /boot/vmlinuz-2.6.32-28-generic root=UUID=e339f209-bb4b-4e57-876a-b2b0d17e2e0b ro quiet splash
initrd /boot/initrd.img-2.6.32-28-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-28-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
echo 'Loading Linux 2.6.32-28-generic ...'
linux /boot/vmlinuz-2.6.32-28-generic root=UUID=e339f209-bb4b-4e57-876a-b2b0d17e2e0b ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-28-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd1,6)'
search --no-floppy --fs-uuid --set e339f209-bb4b-4e57-876a-b2b0d17e2e0b
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows NT/2000/XP (on /dev/sdb2)" {
insmod ntfs
set root='(hd1,2)'
search --no-floppy --fs-uuid --set 384cd74b4cd70314
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "Windows 7 (loader) (on /dev/sdc1)" {
insmod ntfs
set root='(hd2,1)'
search --no-floppy --fs-uuid --set 9e34497534495207
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sdb6 during installation
UUID=e339f209-bb4b-4e57-876a-b2b0d17e2e0b / ext4 errors=remount-ro 0 1
# /home was on /dev/sdb7 during installation
UUID=069330ae-88c3-41d3-a102-8293f131928f /home ext4 defaults 0 2
# swap was on /dev/sdb5 during installation
UUID=7685b1a8-59ea-4c0a-99b2-d75d54fe99ff none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
=================== sda6: Location of files loaded by Grub: ===================
the name of the devices (sda,b,c...) depends to the way they're connected to the motherboard, right
They are labelled in the order they are detected by the kernel. This usually depends on how they are connected to the disk controller.
Ubuntu mounts disks by UUID, so moving them around doesn't matter.
I don't know anything about windows.
Quote:
First of all, I find it quite weird that the loader of 7 is in sdc, whereas all the OSes are on sdb. How can I change that ?
I do not know.
Quote:
Secondly, I would like to change the names so that sda is where the OSes are, it seems more logical to me. I think the first question of this post will help me to achieve that.
Moving windows may cause windows to have a problem.
Quote:
Thirdly, I was wondering whether the installation of 7 triggered an installation of a multiboot windows software (something that would allow me to switch between xp and 7).
I am not aware of any MS "Multiboot" software, but I know nothing about windows.
You are at the grub prompt? No menu?
This is probably because grub can't find the kernel because it is looking in the wrong place, because you have moved your disks around, and I can't tell you what to do as I don't know what is where.
Doesn't my situation have anything to do with the boot flags ? I can see that xp (sdb2 in the text above, now sdc2 after the switch) is the only one who has a boot flag set..
No, grub ignores the boot flag.
Quote:
I have made some more wire switches....
You are posting faster than I can answer.
But it looks like grub is indeed on /dev/sda which is good.
But sda6/boot/grub/grub.cfg is looking for the kernel on sdb6 when it is now on sda6 so that's why it isn't working.
Back to the live distro and follow the instructions in my link at #4
Remember root is now /dev/sda6 not /dev/sdb6
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.