About Me

header ads

How to get Ubuntu 10.10 and Windows 7 in 1 PC with 2 Hard Disks (HD)

Hello friendly people, I want to comment on a particular case I had, and as I found the solution I will share with you.

My case is this, my computer has two hard drives, one sata and one ide is my primary OS is Ubuntu 10.10, the HD IDE used as data, a workplace issue with a very specific software had to install the Windows 7 on the HD IDE.

Precautions taken:
1 - Before you install the win7 remove the HD SATA (500 GB), which is where the Ubuntu for the win do not ever touch that HD.
2 - Then install the HD IDE win7 in (80 GB), when completed, connect the two HD's.
3 - I choose the Bios to boot the HD is the HD SATA, which is where the Ubuntu 10.10

Once in Ubuntu, I have to do is modify the grub.cfg, which in my case is:
/boot/grub/grub.cfg
1 - Enter in the terminal
Applications/Accessories/Terminal

2 - It is always advisable to do a backup before modifying it, I pass the command
sudo cp -r /boot/grub/grub.cfg /boot/grub/grub.cfg.backup
3 - Now we will see these hard disk and formatting architecture.
sudo fdisk -l
this is the outcome in my particular case (SATA 500 GB - IDE 80 GB)

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads ,.....

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads .....

4 - To understand a little of how to manage the group the following table I show
# DEVICE NAME CONVERSIONS
#
# Linux Grub
# -------------------------
# /dev/fd0 (fd0)
# /dev/sda (hd0)
# /dev/sdb (hd1)
# /dev/sdb2 (hd1,2)
# /dev/sda3 (hd0,3)
4 - then edit the file, we can use the text editor you want, I pass two options
4.1 Commands -> sudo nano /boot/grub/grub.cfg (Not very difficult, if unattended, showing options apply ctrl+, example, to save the changes is ctrl+O)
4.2 graphic -> sudo gedit /boot/grub/grub.cfg (Graphical)

5 - Add the following codes

## Windows
menuentry "Windows 7 en /dev/sdb" {
set root=(hd1)
chainloader +1
}
6 - This should be added between:
### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
PASTE CODE HERE
## END /etc/grub.d/30_os-prober ###
7 - In this way, the entry of Windows 7 will be the end of the list if you want to add the entry for Windows 7 as the default, it is simple, move the code to the first part of the list of
### BEGIN /etc/grub.d/10_linux ###
ADD HERE FOR THE WIN 7-default
menuentry 'Ubuntu, con Linux 2.6.32-33-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 53cc37bb-8b6f-4748-9c30-1dd1923b62b7
linux /boot/vmlinuz-2.6.32-33-generic root=UUID=53cc37bb-8b6f-4748-9c30-1dd1923b62b7 ro quiet splash
initrd /boot/initrd.img-2.6.32-33-generic
}
ADD IT TO APPEAR ON HERE FOR 2nd place in the list of Bute

menuentry 'Ubuntu, con Linux 2.6.32-33-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail......
5 - save the file, accept the amendment changes.
6 - Reboot the computer
7 - We have to ask the group to give us the option to choose, that's what we do:
Passing the BIOS boot, press leave ESC or SHIFT.

AND READY!

To understand a little more, I will explain the details of the code
## Windows
This is a comment within code
menuentry "Windows 7 en /dev/sdb" {
This is the title that appears in the list, I put it on dev/ ... to find out which hard drive is
set root=(hd1)
chainloader +1
}
Many do not understand this command, but it is important to indicate the hard drive and what is its partition, it is stating "(hd1, 0)", but in this case, I only tells the hard drive and no partition "(hd1)"
I put the format above.

hug and I hope will serve.

Post a Comment

0 Comments