LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   dual booting, grub, /boot (https://www.linuxquestions.org/questions/linux-newbie-8/dual-booting-grub-boot-676565/)

abolishtheun 10-15-2008 12:41 PM

dual booting, grub, /boot
 
I know this is a basic question but I've never really done it so I'm confused. How exactly do you install a second distribution on your machine? Say my current setup with centos is as follows:

Code:

100 mb  for /dev/sda1 mounted at /boot
2000 mb  for /dev/sda2 as swap
10000 mb for /dev/sda3 mounted at /
10000 mb of free space

When I install a second distribution, say ubuntu, I want to use the free space /dev/sda4 and mount it at root /. But where I mount /boot?

a) Do I somehow reuse the /dev/sda1 partition without reformatting it? (In which case, how do I get the initrd and vmlinuz and other files needed for ubuntu booting onto /dev/sda1?)

b) Or do I let /boot reside on /dev/sda4 with the rest of the file system? (In which case, I assume I manually make an entry for grub.conf in centos for ubuntu, using the appropriate root (hdX,Y)?)

c) something else? am I missing something basic?

lcole 10-15-2008 12:56 PM

I would build a new /boot and / out of the free space.
Then depending on how you install grub either OS can be the main bootloader. If you install new grub in MBR the new OS to manage both and usually link to the old os automatically. Or install grub in /boot2 to have original /boot to manage both requiring your manual update manual update.

jimbo1954 10-15-2008 01:00 PM

You should just use the (in this case) Ubuntu installer as normal, and at the point when the partitioner starts up, tell it to use the largest free space, and it will use the available space and partition it correctly. It will then write the MBR and set up Grub so that you get a screen at boot time when you can select either of the installed OSes. This works OK with a "windows then linux" or a "linux then linux" install, but don't try "linux then windows" because the undisciplined mess that (IMHO) is windows may/will stomp all over the original OS

abolishtheun 10-15-2008 01:21 PM

Quote:

Originally Posted by lcole (Post 3311054)
If you install new grub in MBR the new OS to manage both and usually link to the old os automatically.

My understanding is that the MBR is just 512 bytes of data on the first sector of the harddrive... is grub really installed *on* the MBR? or does it just point to the filesystem with grub installed? this would make sense to me because then you could have as many /boot partition as you wanted, as you two are suggesting...

lcole 10-15-2008 01:27 PM

You are correct about the MBR. The MBR only points to and loads the initial boot loader. The initial bootloader must then know about all other OS on your system and link to their respective loaders.

abolishtheun 10-15-2008 01:40 PM

Quote:

Originally Posted by lcole (Post 3311093)
You are correct about the MBR. The MBR only points to and loads the initial boot loader. The initial bootloader must then know about all other OS on your system and link to their respective loaders.

I'm starting to get a clear picture here... so if I just do a default install of ubuntu with the free space,
a) I'll have an MBR pointing to the ubuntu's bootloader (say at /dev/sda5). (is it alright for the initial bootloader to be installed on a logical partition?)
b) that initial bootloader will point to the vmlinuz's and initrd's and other files for ubuntu on /dev/sda5 (ie, on the same partition as the initial bootloader) and centos on /dev/sda1.

Is this correct?

Also, the final question is: how do I make the MBR point at a different initial bootloader? EDIT: I got this part down-- apparently you run /sbin/grub and run setup on the approrpiate partition...

lcole 10-15-2008 03:04 PM

I think you've got it! Yes you can install /boot on a logical partition.

abolishtheun 10-15-2008 03:30 PM

Thanks for the help icole and jimbo. now if only grub wouldn't use its own nomenclature for partitions (hd0,0, etc....)... :-P


All times are GMT -5. The time now is 04:43 AM.