want to install ubuntu on existing gpt partition

Asked by dan hitt

I have a computer with a gpt-partitioned disk that has several partitions (6 or so), with several unused and unformatted partitions.

The computer boots to a non-ubuntu linux, which i do not want to disturb.

I would like to install ubuntu 11.04 on one of the unused and unformatted partitions.

I do not want to install grub or modify the mbr in any way, or to alter in any way any other partition besides the one i end up installing ubuntu on. (I do not want to install grub or modify the mbr in any way because burg is already installed on the computer, to boot the other linux.)

It would be most satisfying if i could do this without a live CD or DVD, using nothing more than some series of commands issued to the existing linux (which i want to keep) --- after all, the process should be only little more than formatting one of the unused partitions, and copying some files to it (???).

But maybe this is not possible, so i'm willing to use a live CD or DVD if i have to, as long as the process will not touch the mbr or change in any way any of the other partitions.

Thanks in advance for any suggestions on how to do this.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ubiquity Edit question
Assignee:
No assignee Edit question
Solved by:
José Antonio Rey
Solved:
Last query:
Last reply:
Revision history for this message
Rohith Kumar (rohithkumar-av) said :
#1

Check this out, http://lubi.sourceforge.net/

Unfortunately I haven't tried this. And as you expected I doubt it is not possible to touch the MBR or not allowing to go to GRUB, Since grub is another boot loader just like what you're using BRUG. So, I was just trying to check some and found this link, May be you can try to check this and see if it works for you

Revision history for this message
delance (olivier-delance) said :
#2

I never used UEFI/GPT partition mechanism, so I will let question "Open".
1) I would like to install ubuntu 11.04 on one of the unused and unformatted partitions. => If you don"t use hibernation, you can share swap partition between Lunices, else you will have to dedicate a partition for Ubuntu swap. The swap partition receive, when you hibernate, a copy of RAM.
2) I do not want to install grub or modify the mbr in any way
I don't master burg. You have two solutions:
a) Add an entry in Burg menu
b) Chain-load to a Grub2 installed inside Ubuntu partition (the nasties solution). As I don't know GPT partition scheme, I don't know if it is possible. In DOS scheme, it's only possible with logical partitions.
3) It would be most satisfying if i could do this without a live CD or DVD => the system has to configure some data (user name, PC name, time area, language, keyboard, ...) so I presume you will need CD.

An idea: you could define a useless partition, and at end of installation ask to installer to copy MBR in this partition. So you will be sure MBR will not be written elsewhere. Keep the /boot in default /root. Then finally edit Burg configuration file to add an entry for Ubuntu. You could do this from reading /boot/grub/grub.cfg which will provide you the right atomic data.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#3

You can do this--just tell the installer not to install the boot loader to the MBR during installation (while installing from the CD). This option is highly visible during installation.

You could probably install to a separate partition while booted into your pre-existing Linux-based system using debootstrap (http://manpages.ubuntu.com/manpages/natty/en/man8/debootstrap.8.html; see also https://wiki.ubuntu.com/DebootstrapChroot), but that would give you a base system only, and you'd have to then use the package manager to install all the packages you wanted (you'd get reasonably close to a standard desktop system by installing the ubuntu-desktop metapackage). If you do create a system with debootstrap, and you install "big" metapackages like ubuntu-desktop, you should be aware that they may install a boot loader (the grub-pc package). Ideally you should be prompted to configure the boot loader, and you can tell it not to install to the MBR. If you perform the installation of such packages inside a chroot on your pre-existing Linux-based system, then if you accidentally install Ubuntu's boot loader to the MBR, you're still booted into your original OS, and you can reinstall its boot loader to the MBR.

I recommend that you install Ubuntu the usual way (not by manually debootstrapping), by booting from the CD/DVD or a USB stick. It will be simpler and faster than manually debootstrapping, and there will be fewer opportunities (just one) to accidentally overwrite your MBR. You'll probably want to select manual partitioning, and just tell it to use the partition (or partitions) you've already created. Normally an Ubuntu system will use a swap partition created specifically for it, but you could have it use the same swap partition that your pre-existing Linux-based system uses. (Like with other Linux-based OSes, Ubuntu can use a swap file as well, but that is less common and there is usually no major advantage to doing so, though usually also no major disadvantages either, except that hibernation requires a dedicated swap partition. Also you want to be able to boot into one Linux-based system while the other one is hibernated, then they do need to have separate swaps, and they--or at least the one used by the hibernating system--must be dedicated swap partitions rather than swap files. See https://help.ubuntu.com/community/SwapFaq.)

It might be possible to safely and successfully run Ubiquity (the graphical installer) or debian-installer (the text-based installer) from a different Linux-based OS, but I don't know how to do that (or if it's possible), except by creating a dedicated debootstrapped system for the installer to run inside and chrooting into it (and if you're going to do that, then you might as well just debootstrap the system you're installing).

There are a couple of additional important points, no matter how you proceed with this:

(1) It is not safe to edit a physical drive's partition table while you are booted into an operating system installed on the same physical drive. Therefore, if you have not yet created the partition(s) for the new system, then since (from your description) it/they will be on the same physical drive as your existing system, you will need to boot from a live CD (not necessarily an Ubuntu live CD) or OS installed on a different physical drive, in order to create them properly.

(2) As you probably know, you will have to edit your BURG configuration (either by booting into your pre-existing Linux-based system after installing Ubuntu, or manually using some other method) in order to make your new Ubuntu system bootable. This might happen automatically when you regenerate BURG's boot list in the non-Ubuntu system.

Revision history for this message
dan hitt (dan-hitt) said :
#4

Thanks Eliah, delance, and Rohith.

Writing all this down in case somebody else runs across this thread
and needs to know how it worked out:

What i actually did was use the live cd for 11.04.

It offered an option to install ubuntu "along side" of the other linux.

What it proposed to do (which i accepted) was to divide the existing
partition into two pieces (and i was given a slider to determine how
much space for each).

It also carved out a swap area for ubuntu. It did not tell me about
the swap area, or ask for permission to create it, but it looks like
it chose the size to be the same as the amount of ram on the machine,
so that's probably reasonable.

The only input i had to provide was a time zone, an account name and pw,
and a machine name. (It did not let me use the same name as the
other linux, because it found it on the network somehow. That's a little
bit of a mystery to me, as there is no dns or dhcp or anything like that
running on the network that it could have gotten the hostname from,
and the other linux, of course, was not running.)

I also was not given any option, as far as i know, to leave the mbr intact.

(I did not press the advanced partitioning button, which perhaps would
have offered that opportunity.)

And my hunch is that the mbr was certainly modified, but i have no proof yet.

I'm guessing this because i didn't alter any grub or burg menu, but now
the machine is willing to boot into either linux (and both work, for
the record).
So i think the mbr must point elsewhere for booting (????). [What
would be useful would be to have a program that found and copied
out the mbr into a file, and maybe emitted also some info about it,
and what it would set in motion on reboot.]

However, i think that's probably ok.

The gpt partitions seem to be ok: parted now shows 12 (and on both
linux versions i see 12 partitions): the 10 (including a small
grub_bios partition)
plus 2 more (the ubuntu and the ubuntu swap, so i now have 2 swaps).

And given my poor understanding of the boot process, it probably made
all the right choices for me, especially since i think it left everything alone
that was living in a partition (except for resizing the partition the
other linux
was in).

So: this outcome might not be satisfactory for some, but for me it was
very good.

I now have an ubuntu on my machine, and i think i'm much more familiar with
ubuntu than with the other linux. (I have to say "think" here because 11.04
certainly has a very different gui. But i'm hoping that the shell, the package
structure, etc, work the way 9.10 and 10.10 do.)

Thanks again for all the advice, the pointers to lubi, the hibernation
info (which
i hadn't given a thought to), etc.

Each word is valuable, no matter which path i ended up taking.

dan

Revision history for this message
Best José Antonio Rey (jose) said :
#5

If the answer has been given, please mark the question as solved.

Revision history for this message
dan hitt (dan-hitt) said :
#6

Thanks José Antonio Rey, that solved my question.