LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Now ready to go from 5.04 to 6.06 (https://www.linuxquestions.org/questions/linux-newbie-8/now-ready-to-go-from-5-04-to-6-06-a-485770/)

Odyssey1942 09-21-2006 03:57 PM

Now ready to go from 5.04 to 6.06
 
Since I started the earlier thread on this topic and it ran it's course, I decided to do a fresh 6.06 install on a Windoze computer and see what happened and get some first hand experience. I used the Live CD (is there a text based 6.06 version?) which when run, sets up a virtual Ubunutu session with a desktop that has an "Install" icon on it. Clicked on this and the install went through a partitioning session, then the usual questions about language, keyboard, etc.

It went very well indeed except for one thing. What I did not notice was that it did not ask me anything about a boot loader, and after the install, which went swimmingly, I was left without a way to boot under Windows (W2k if it matters).

So the same thing is going to apply to this computer (which has 5.04 running well). So my first question is how to install a boot loader when I install 6.06 onto this machine (I want to leave the 5.04 in place as a fall-back).

Should I use gparted (or another package) before the Ubunutu install to partition and install a boot loader, and if so, any guidance as to ther best way to do this (as I have never used gparted, or any other Linux partitioning software)?

TIA

pda_h4x0r 09-21-2006 04:14 PM

$ sudo dpkg-reconfigure grub || sudo apt-get install grub

This is very strange--Ubuntu should install GRUB (the GRand Unified Bootloader) upon installation. Are you able to boot into Ubuntu? If so, then its already there and you may need to tweak your /boot/grub/menu.lst file and run "sudo grub-install /my/root/partition" to be able to boot into W2K. It's possible--I do it with XP when absolutely needed. Adding this to /boot/grub/menu.lst should allow you to boot into W2K:

Code:

title        Windows 2000
root          (hd0,0)
makeactive
chainloader  +1

Note that (hd0,0) refers to the first partition (0) on the first hardrive (hd0); you may have to change this if W2K is not in that particular location.

Odyssey1942 09-21-2006 06:59 PM

I am now at a different location which has the same situation in my second attempt to install on a Windoze (XP Home) computer (which went well, BTW, but same result as to boot loader). Will try your suggestion here.

Just to confirm procedure:

run: "sudo grub-install /my/root/partition"

(where "my/root/partition" is exactly the wording, or should it be
"odyssey/root/partition" in my case? Sorry for these questions but I still am very much a beginner and want to be sure of doing it right.)

then edit menu.lst, adding:

title Windows Home XP
root (hd0,0)
makeactive
chainloader +1

I assume that since WXP was already installed that it is hd0, but is there a way to tell for sure?

Many thanks.

pda_h4x0r 09-21-2006 09:50 PM

"/my/root/partiton" refers to the device in /dev that refers to your root partition (i.e. /dev/hda1, /dev/sda1, etc).

When you install GRUB for the first time, it will determine where your OS's are (i.e. the "root" entry in /boot/grub/menu.lst will be determined automatically). Running "sudo dpkg-reconfigure grub /my/root/partition" will cause the /boot/grub/menu.lst file to be rewritten correctly for you (but you must also run "sudo grub-install /my/root/partition" to make the changes in /boot/grub/menu.lst perminent). Just to be safe, show me the output of "sudo mount".

dogged28 09-21-2006 10:00 PM

you know what odyssey1942, i've put ubuntu on several machines and never paid attention to that. i just hit enter and let it lead the way. i'll have to check into this. i stopped dual booting xp when i found ubuntu. but now i'm curious about that. put that on my learner list i've made for myself. thanks for the eye opener.

Odyssey1942 09-21-2006 10:30 PM

pda, here it is:

/dev/hda2 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
varrun on /var/run type tmpfs (rw)
varlock on /var/lock type tmpfs (rw)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
devshm on /dev/shm type tmpfs (rw)
lrm on /lib/modules/2.6.15-26-386/volatile type tmpfs (rw)

also from fdisk -l

Disk /dev/hda: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 3570 28675993+ 7 HPFS/NTFS
/dev/hda2 3571 4711 9165082+ 83 Linux
/dev/hda3 4712 4998 2305327+ 82 Linux swap / Solaris

I surmise that my windows is on hda, partition 1?
-----------

dogged, what a great name for a Linux user! One needs to be.

are you using the install CD or the live CD to install with?

I have every hope that I can stop using Windoze just as soon as I can get my feet on the ground with Ubuntu and can get all my files over. The former is taking lots of time.

dogged28 09-22-2006 08:15 AM

i've been using the live cd. dogged also fits with 2yr old boy, 5yr old girl, and 6yr boy with a wife 10yrs younger than me. lol!!!! i'm no guru but it does look like hda1 is your windows
title Windows Home XP
root (hd1,0)
makeactive
chainloader +1

you may try to edit that. fedora and redhat i know show hd0 as the first drive/partition and ubuntu will show hd1 as the first drive/partition.
gurus tell me if i'm wrong please.

Odyssey1942 09-22-2006 09:04 AM

I hear that. All the same here except two girls (each of which equals one boy in complications! lol)

root (hd1,0)

or root (hd1,1)?

Thanks.

pda_h4x0r 09-22-2006 02:24 PM

Your Windows partition is on /dev/hda1. In GRUB, this is (hd0,0). Ubuntu is installed on /dev/hda2 (for GRUB: (hd0,1)).

You may wish, in the future, to create another linux partition on which to mount your /home directory. In case of a hardware failure, your user data will be separate enough to recover in most cases. I have had personal experiences with users who have put everything into one partition and lost everything when a power surge corrupted the partition.

Odyssey1942 09-22-2006 02:46 PM

pda, thanks for the clarification.

You mentioned "You may wish, in the future, to create another linux partition on which to mount your /home directory." This raises two questions:

Is all of my user data in my /home directory? I am thinking also of backup, so what else (other than installed programs) might need to be backed up that might not be in that directory?

Secondly, How does one mount one's /home directory in a separate partition (assume partition already created)?

Thanks again.

Odyssey1942 09-22-2006 05:13 PM

Upon rereading the entire thread, I am now 'fused. You mentioned:

"Your Windows partition is on /dev/hda1. In GRUB, this is (hd0,0). Ubuntu is installed on /dev/hda2 (for GRUB: (hd0,1))."

I am not sure what "In GRUB" and "for GRUB" means? Your kindness in clarification would be very helpful.

Please confirm my understanding that these are the correct steps (especially the /hda1 in the grub commands, but hd0,0 in menu.lst part):

run: sudo dpkg-reconfigure grub /dev/hda1 , then
sudo grub-install /dev/hda1

then make these changes to menu.lst, adding them to the end:

title Windows 2000
root (hd0,0)
makeactive
chainloader +1

(or should it be:

title Windows 2000
root (hda,1)
makeactive
chainloader +1

??

I assume that if these commands are given incorrectly that the consequences might be dire, so your guidance will be much appreciated. TIA

Edit: an Aha! moment. If my hdd is hda1, when the bootloader shows the choice screen, it will refer to the hdd as hd0 with the Windoze partition being 0. Is this it? (If not, still a mystery. If it is, please don't forget the code question above. Thanks)

pda_h4x0r 09-23-2006 12:46 AM

Sorry for my lack of clarity; I shall try to be more thorough.

-------------------------------------------------------
------The Easy Way (if you have internet access)-------
-------------------------------------------------------

Here's EXACTLY what you should do:

$ sudo apt-get --reinstall install grub || sudo apt-get install grub

This will reinstall grub, or if its missing, this command will install it. Because you are using APT, you will obviously need an internet connection. GRUB should automatically regenerate your /boot/grub/menu.lst and will detect Windows and add a menu entry for it (i.e. it will ask you to confirm that it detected Windows).

After GRUB is installed, run this:

$ sudo grub-install /dev/hda1

GRUB should be working now.

----------------------------------------------------------------------
-------The Not-So-Easy Way (if you have no internet connection)-------
----------------------------------------------------------------------

If you choose to configure GRUB manually (i.e. avoid reinstalling it or if you are offline), you should have these entries in /boot/grub/menu.lst:

Code:

title Windows
root (hd0,0)
makeactive
chainloader +1

title Ubuntu
root (hd0,1)
kernel=<your_kernel> root=/dev/hda2 ro vga=791
initrd=<your_initrd>
savedefault

Here, <your_kernel> is the path to your kernel image. This is usually /boot/vmlinuz-xxxxxxx, where xxxxxxx is the version (for example, /boot/vmlinuz-2.6.17-8-686). The kernel parameters "root=/dev/hda2 ro vga=791" tell the Linux kernel that your root partition is on /dev/hda2, and that it should be mounted at first as read only (ro), and that it should set your VGA mode to 791 (meaning it should set your resolution to 1024x768), enabling the bootsplash. In dual-boot systems, passing the "root=" option is CRITICAL. Also, <your_initrd> is the path to your kernel's initrd. This is usually /boot/initrd.img-xxxxxxxx, where xxxxxxxx is your kernel version. Repeat: YOUR INITRD VERSION AND YOUR KERNEL VERSION MUST MATCH. In the example, this should be /boot/initrd.img-2.6.17-8-686.

Here's my Linux configuration, for example:

Code:

title          Debian GNU/Linux, kernel 2.6.17
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.17 root=/dev/sda1 ro vga=791
initrd          /boot/initrd.img-2.6.17
savedefault

(Because I have a SATA hardrive, I have /dev/sda1 as my root partition. Because you have an IDE or ATA drive, and because Linux is installed on the second partition, your root partition should be /dev/hda2. Because Linux is on my first partition, I have "root (hd0,0)." But because you have Linux on your second partition, you should have "root (hd0,1)")

In your case, if you wish to manually configure GRUB, you MUST run "sudo grub-install /dev/hda1" to make your changes in /boot/grub/menu.lst effective. The device file you pass to grub-install, in your case, MUST be /dev/hda1 because that partition contains the boot sector.

Quote:

"Your Windows partition is on /dev/hda1. In GRUB, this is (hd0,0). Ubuntu is installed on /dev/hda2 (for GRUB: (hd0,1))."

I am not sure what "In GRUB" and "for GRUB" means? Your kindness in clarification would be very helpful.
GRUB has a different naming convention than Linux. In Linux, as you already know, your hardrive is /dev/hda, and your hardrive partitions are /dev/hda1, /dev/hda2, /dev/hda3, etc. Windows is installed on /dev/hda1, Linux is installed on /dev/hda2, and your swap partition is /dev/hda3. In GRUB, /dev/hda, in your case, is hd0. It's first partition is the 0th partition (GRUB starts counting with 0). (hd0,0) and /dev/hda1 are the same device. (hd0,1) and /dev/hda2 are the same device. (hd0,2) and /dev/hda3 are the same device.

Quote:

You mentioned "You may wish, in the future, to create another linux partition on which to mount your /home directory." This raises two questions:

Is all of my user data in my /home directory? I am thinking also of backup, so what else (other than installed programs) might need to be backed up that might not be in that directory?
In Linux, the /home directory contains your user-specific data. This is kind of like C:\Documents and Settings\<your_user_name> in Windoze. It should contain the contents of your desktop, your documents, your pictures, your configuration files, and anything you created while using Linux. If you have to back up anything, this would be a good place to start. Anything else can just be reinstalled, and reinstalled software will automatically be reconfigured if you have its configuration files intact (they are conveniently located in your user's home folder).

There are many ways (with varying levels of difficulty) to create a partition. I recommend something like gparted, which is both easy to use and very powerful. However, to create a new partition on a hardrive with no empty or unformated partitions (probably your case) usually requires a LiveCD (i.e. so you can modify your partitions while they are not mounted) and a backup of anything you really can't afford to lose or reinstall. Once you create it, you should format it with the ext3 filesystem. This can be done with this command:

$ sudo mkfs.ext3 /dev/hdaX

where /dev/hdaX is the device file for the new partition. After that, edit your /etc/fstab as root and add this line:

/dev/hdaX /home ext3 defaults 0 2

so you can mount /home (again, /dev/hdaX refers to your new partition). Once you do that, do this:

$ sudo mv /home /home-temp && sudo mkdir /home && sudo mount /dev/hdaX && sudo mv /home-temp/* /home/

This command will (1) move /home to /home-temp, (2) make a new directory called /home, (3) mount your new partition (/dev/hdaX) on /home, and finally (4) move the contents of /home-temp (i.e. all your user files) into your new partition, mounted on /home. After that, you can just remove the empty /home-tmp directory. This command may take a while if you have a lot of files in your home directory. Once you reboot, your new partition will automatically be mounted on /home, and your user data will be separate from your OS.

I hope this helps you :)

Odyssey1942 09-23-2006 08:10 AM

Wow! That is truly a 5 star answer. I think I have learned more about linux from this post than all the threads I have participated in put together. :study: Thank you for the time and thoughtfulness you have put into this reply. :cool:

I shall set about working through the instructions and report back later (after the mowing is done.)

Odyssey1942 09-23-2006 03:30 PM

OK, tried the easy way and all seemed to go ok. There were a couple of warnings about possible errors, as follows:
------
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 13 not upgraded.
Need to get 362kB of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com dapper/main grub 0.97-1ubuntu9 [362kB]
Fetched 362kB in 2s (139kB/s)
(Reading database ... 72708 files and directories currently installed.)
Preparing to replace grub 0.97-1ubuntu9 (using .../grub_0.97-1ubuntu9_i386.deb) ...
Unpacking replacement grub ...
Setting up grub (0.97-1ubuntu9) ...
odyssey@Ubuntu606:/mnt$ sudo grub-install /dev/hda1
Due to a bug in xfs_freeze, the following command might produce a segmentation
fault when /boot/grub is not in an XFS filesystem. This error is harmless and
can be ignored.
xfs_freeze: specified file ["/boot/grub"] is not on an XFS filesystem
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'.

(hd0) /dev/hda
-----
They didn't sound too ominous, so rebooted and got a new option to boot into Windows which I tried. Text appeared as follows:

Booting 'Microsoft Windows XP Home Edition' (BTW, this is correct
for this computer)
root (hdo,0)
Filesystem type unknown, partition type 0x7
savedefault
makeactive
chainloader +1

Grub loading stage 2

Then returns to the boot loader option screen. Tried to select Windoze a couple of more times (my Windows experience is showing here) but same result each time (as of course it would be under Linux).

Have let it timeout and boot into Ubuntu.

We seem 98% of the way to the bank, but something is not yet entirely correct. Does the above tell you, or what should I do now (before doing it the hard way)?

BTW, checked menu.lst and the final lines are now:

title Ubuntu, kernel 2.6.15-26-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.15-26-386
boot

title Ubuntu, kernel 2.6.15-23-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda2 ro quiet splash
initrd /boot/initrd.img-2.6.15-23-386
savedefault
boot

title Ubuntu, kernel 2.6.15-23-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.15-23-386
boot

title Ubuntu, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
boot
140,1 87%

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1

pda_h4x0r 09-24-2006 12:22 AM

Okay, I searched the web, and this type of boot error is common if your Windoze installation is on an NTFS partition. There are two ways to fix this:

1.) Change "root (hd0,0)" to "rootnoverify (hd0,0)" in /boot/grub/menu.lst, and run "sudo grub-install /dev/hda1". GRUB doesn't recognize NTFS, so you have to specify "rootnoverify" to force it to boot anyway.

2.) Enter your BIOS setup, and change your hardrive type to "LBA" instead of "AUTO". This may work of (1) doesn't.

Your installation is correct so far--completing either of these should get you 100% to the bank.


All times are GMT -5. The time now is 12:32 AM.