LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Is it possible to use one boot partition for multiple installations? (http://www.linuxquestions.org/questions/linux-general-1/is-it-possible-to-use-one-boot-partition-for-multiple-installations-4175451664/)

EStyles 02-25-2013 03:32 PM

Is it possible to use one boot partition for multiple installations?
 
I have the boot partition of my laptop linux installation on a USB, I am wanting to use that same boot partition for an install on my desktop.

So far I have linux (minus the boot partition) installed on my desktop. My desktop will boot from the USB but when it comes time to boot into the install, it is waiting for the uuid of my laptop.

I am thinking that I can get the boot partition on my USB to recognize the uuid of my desktop as well by editing the grub.cfg but I have never attempted anything of this nature. Would this be the correct way to do this? Is this possible? And if so, can anyone give me any pointers?

yancek 02-25-2013 04:09 PM

You should be able to chainload to the partition which has the boot files on the laptop by putting the correct drive/partition numbers in the menuentry for it in the grub.cfg file. If you did not create a separate boot partition on the Desktop, it should be whichever partition you installed Linux to. Which distribution of Linux is it? The entry below boots a Linux distro on sda12. You should be able to use it by simply changing the drive/partition numbers:

Quote:

menuentry 'CHAINLOAD LINUX' {
insmod ext2
set root=(hd0,12)
chainloader +1
}
If you are able to boot whichever Linux distro you have on the Desktop machine, just run the 'blkid' command to get the uuid although you don't need it.

EStyles 02-25-2013 09:01 PM

Sorry I should have done a better job of clarifying. My laptop installation works perfect. The boot partition on my USB is for my laptop installation. I have 64 bit BackTrack 5 R3 with Gnome installed with a "full" encryption. I followed thisguide with a few modifications to get the boot partition onto my USB.

I followed the same guide/modifications for installing to my desktop, but left out the boot partition installation. There is a part in the guide where you obtain the uuid of the partition on the hard disk and you edit /etc/crypttab to contain the uuid so that after boot it will find the correct encrypted disk to ask you for your password.

However, when using the boot partition from my USB to boot my desktop, it is only looking for the hard drive with the uuid that is on my laptop.

(I use uuid so that even if the hard drives move from where they were initially installed it won't confuse my system on boot.)

So am I correct in that I need to edit my grub.cfg in my USB boot to contain the uuid of the desktop installation?

and is:


Quote:

menuentry 'CHAINLOAD LINUX' {
insmod ext2
set root=(hd0,12)
chainloader +1
}
the correct way to do this?

yancek 02-25-2013 09:48 PM

If you do not have a separate /boot partition on your Desktop computer and your boot files are on the / partition, you could use the method I posted to chainload whichever partition your / partition on the Desktop. I don't know about encrypted partitions. I think it would be a problem for Grub to boot an encrypted partition which is one reason for a separate /boot partition not encrypted. You can get the uuid of your / or /boot partition on the Desktop with the command: blkid

EStyles 02-25-2013 10:04 PM

Another thing I forgot to add: the boot partition is not encrypted but everything else is. That's why i put full in quotations, but i forgot to explain that part.

What i am trying to do is find where in the boot partition does it tell boot to look for a particular hard drive/ slash "consecutive" partition and edit that to look for an alternative if it fails to find the first one

yancek 02-26-2013 09:25 AM

Which Linux distribution do you have on your Desktop? Is it also Backtrack?
Does the Desktop installation have only a / partition, no /boot partition?
The Grub scripts are in /etc/grub.d directory so that won't help as all you have on the usb is the /boot partition. It's not clear to me whether your Desktop installation is encrypted with one partition?

Grub doesn't loop through possible boot options, that's what the menu is for. You put different entries in the menu identified in the menuentry so you know which is which. You could use the chainload option and put different drive/partition entries (set root=(hd0,1); set root=(hd0,2) to see which one works.

If you can't boot your Desktop, use a Live CD and boot it on the Desktop to get your partition and uuid with blkid. You could also use the Live CD and mount the partition(s) on your Desktop and go to the /boot/grub folder, find the grub.cfg file there and copy the entry to the /boot/grub/grub.cfg file on your usb /boot partition. The drive/partition numbers may change when you are booting from the flash so if your Desktop grub.cfg entry shows (hd0,1) you might put one entry for that and another for (hd1,1).

I don't use separate /boot partitions and I've never done what your are attempting.


All times are GMT -5. The time now is 11:56 PM.