Page 1 of 5 123 ... LastLast
Results 1 to 10 of 45

Thread: Installing GRUB on a separate partition?

  1. #1
    Join Date
    Jun 2008
    Location
    UK
    Beans
    369
    Distro
    Ubuntu 12.04 Precise Pangolin

    Installing GRUB on a separate partition?

    I would like to install Ubuntu 9.10 for a friend.

    They already have Windose. I would like to create a new partition for all of the Ubuntu files, with the mount-point as '/', and then for GRUB to be installed within its own separate 50MB partition.

    Would this be possible?

    How would I request this within the standard installation steps?

    What should be the stated mount-point for the GRUB files within the GRUB partition?

    Thank you.

  2. #2
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,096
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Installing GRUB on a separate partition?

    You could make yourself a 'Separate Boot' partition, or at least that's what I call it.
    A 'Separate Boot' partition means you have /boot in it's own partition, which will be part of the operating system and will house your Linux kernel and iitrd.img files as well as GRUB files. A 'Separate Boot' partition will be listed in your /etc/fstab file as /boot.

    The other kind of GRUB partition is called a 'Dedicated GRUB' Partition, a term coined (as far as I know) by a Mr. Steve Litt, who wrote a website titled Making a Dedicated Grub Partition. ('Legacy' GRUB).
    A 'Dedicated GRUB' Partition contains only GRUB files and not the Linux kernel and is not mentioned in /etc/fstab and is 'operating system independant', (GRUB will still function the same even after the operating system has been deleted, so you can add or remove hard disks and operating systems as you please).

    Since you're saying you want to make it during installation I think you mean a 'Separate Boot' partition.
    You need to select 'manual partitioning', when you get the the partitioning phase of the installation.
    I usually make mine about 250 to 500 MiB to be on the safe side, in case it ends up with quite a few Linux kernels and their matching initrd.img files in it.
    It should be mounted as /boot.
    Your /boot partition may be formatted with any file system supported by GRUB. Many people suggest using ext2 without knowing why, I'm only guessing but I think maybe the reason was to minimize file system overhead to save disk space in very small hard disks or USB flash memory sticks, (a habit from the old days when hard disks were very small and expensive). If you're using a normal sized modern hard drive or even a USB flash memory stick of a decent size then you can probably afford to use ext4. ReiserFS is also good for GRUB, with even smaller file system overhead than ext2 if you're squeezed for disk space. Ext4 would be my favorite all purpose file system now though.
    Your main Ubuntu partition will be mounted as /, and again I now prefer ext4.
    Most people also make a Linux 'Swap area', of around 500 MiB to 1 GiB.
    Some people like a 'separate /home' partition too, where all their personal files and settings will be stored. It's then possible to re-install the operating system if that ever becomes necessary, (it shouldn't), however, you should always have a backup of your personal files on some other media anyway. Ext4 for that too, unless you need to share files with an older Ubuntu or some other Linux that doesn't support ext4 yet. Personally, I don't like having a 'Separate /home', but that's a matter for personal preference.
    Ubuntu user since 2004 (Warty Warthog)

  3. #3
    Join Date
    Jun 2008
    Location
    UK
    Beans
    369
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Installing GRUB on a separate partition?

    Herman!

    If you are the same esteemed expert that I am thinking of, then allow me to say that I have spent many hours studying your exemplary GRUB guide. It is a marvel! It helped me install my own Dedicated GRUB Partition on my own desktop machine a long time ago.

    Your advice on the Separate Boot Partition protocol is extremely useful. Though it is definitely the Dedicated Grub Partition that I would ideally wish to achieve if possible. That is, a Grub partition which is entirely separate and independent of all other local operating systems files.

    However, am I correct in my understanding that the implication of your comments in this respect is that it would be necessary to prepare and create the a Grub partition with Gparted and the necessary GRUB files prior to installing Ubuntu, if a Dedicated Grub Partition is to be achieved?

    I agree with you on the separate '/home' partition point. It is surely best practice, but for the purposes of installing machines for friends, surely not necessary, and probably liable to make life slightly less convenient at certain times.

    I look forward to your next reply.

    Best wishes

    Pipps

  4. #4
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,096
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Installing GRUB on a separate partition?

    Hello Pipps, thanks for the compliments on my GRUB (Legacy) Page.

    You're using Ubuntu 9.10 Karmic Koala so you're using GRUB 1.97. (GRUB 2).
    It's very simple and quick to make yourself a 'Dedicated GRUB 2 Partition' when you already have Ubuntu installed.
    If that's what you want you can just install Ubuntu in the normal way first.
    After that you may create a new partition or use one that's already there which doesn't have any directory named /boot in it, (or it will be overwritten).

    How To Make a Dedicated GRUB 2 Partition - use grub-install

    1. Choose an existing partition or create a new one and format it with a file system, you will need at least about 60 MiB of space in the partition for grub 2 files, but a little more room than that might be advisable.
    2. Format the partition with a file system and optionally give the file system a LABEL, (from the right-click menu in GParted).
    3. Mount the partition - Usually 'Places'-->'Removable Media'-->'FS_LABEL',
    4. Run a grub-install command similar to the one shown below,

    Code:
    sudo grub-install --root-directory=/media/grub2 /dev/sda
    Where: '/media/grub2 is the name of the mount point for the partition where I want to make a new /boot/grub directory and fill it with GRUB files.
    Where: '/dev/sda' is the hard disk in which I want to write the stage1 code to MBR in.

    You can relax the file permissions for easier editing now that it's not part of an operating system,
    Code:
    sudo chmod 777 -R /media/grub2
    Next, let GRUB in Ubuntu make your new grub.cfg file automatically for you in your Dedicated GRUB Partition,
    Code:
    sudo grub-mkconfig -o /media/grub2/boot/grub/grub.cfg
    After that command has run, you can use your Dedicated GRUB as it is if it suits you or you can customize it in any way you like. In an installed GRUB you're not supposed to edit /boot/grub/grub.cfg, but in an 'operating independant Dedicated GRUB Partition you can edit the grub.cfg in any way you like.

    Thanks for the compliments about my web site's GRUB pages.
    Regards, Herman
    Last edited by Herman; November 10th, 2009 at 12:54 PM.
    Ubuntu user since 2004 (Warty Warthog)

  5. #5
    Join Date
    Jun 2008
    Location
    UK
    Beans
    369
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Installing GRUB on a separate partition?

    Herman

    It is a pleasure to make your acquaintance!

    I agree with your earlier comments about the use of a separate '/home' directory. It is probably logically best practice, but in reality unlikely to ever be necessary. For an installation on a semi-casual user's laptop, I think I will avoid the urge to make the task any more difficult than I am already.

    Thank you so much for your incredibly kind instructions on setting-up a Dedicated GRUB2 partition. I am going to memorise your prescribed commands and then bust them out in front of my friend during installation next week. I may earn some extra nerd points! I will of course be indebted to you!

    I have only one further question regarding the GRUB install: Would it be advisable to perform it before installing Ubuntu 9.10 in a separate adjacent partition?

    My reason for asking, is that doing the two tasks in this order would allow me to then install Ubuntu using the 'Advanced' option of not installing 'a bootloader', as it describes it, during the Live CD installation procedure.

    If this would indeed be the best approach, then would it be possible to perform the GRUB installation using GRUB files contained on a LIVE CD, whilst booted in Live CD mode, in the first instance, and then performing the separate Ubuntu install from the same Live CD subsequently?

    Best wishes

    Pipps

  6. #6
    Join Date
    Dec 2007
    Beans
    197
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Installing GRUB on a separate partition?

    When running the last command, I get
    grub-mkconfig grub probe error cannot find device for /

    http://www.google.ca/search?hl=en&cl...meta=&aq=f&oq=

    Cannot find working solution.

  7. #7
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,096
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Installing GRUB on a separate partition?

    grub-mkconfig grub probe error cannot find device for /
    Are you trying to do it from a Live CD or something?

    Try mounting the file system that contains the GRUB you're trying to install somewhere, and then do,
    Code:
    sudo grub-install --root-directory=/media/KARMIC/boot/grub /dev/sda
    Where: 'media/KARMIC' is the name of the mount point.
    Usually the mount point will be named after the file system label if you have set one (recommended).
    If you haven't set a file system label you may do so with GParted in the Ubuntu Live CD anytime you like. Just right-click on the partition and select 'Label', and type in a name of your choice. Mine is 'KARMIC', but you may call yours something else.
    Ubuntu user since 2004 (Warty Warthog)

  8. #8
    Join Date
    Jun 2008
    Location
    UK
    Beans
    369
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Installing GRUB on a separate partition?

    Hi Herman
    Quote Originally Posted by Pipps View Post
    I have only one further question regarding the GRUB install: Would it be advisable to perform it before installing Ubuntu 9.10 in a separate adjacent partition?
    ...
    Sorry to hassle you for an answer(!), but what do you think?

    Pipps

  9. #9
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,096
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Installing GRUB on a separate partition?

    Would it be advisable to perform it before installing Ubuntu 9.10 in a separate adjacent partition?
    It shouldn't matter very much, one of the advantages of having GRUB in a 'Dedicated GRUB Partition' is that it is 'operating system independant', so GRUB will still work regardless of whether there's a GRUB-freindly operating system around or not.
    Another nice thing about it is you can make up your own user freindly operating system titles and just have a short list of them. You can use various commands to boot with.

    The non-good thing is if you want your grub.cfg to be up to date and booting the latest Linux kernels, you'll need to keep running grub-mkconfig fairly often manually, as Ubuntu won't automatically update the file as it would if the file was inside Ubuntu.
    If you have a customized grub.cfg, it wouldn't be a good idea to run grub-mkconfig unless you get the command to make you a grub.cfg with some other filename so as not to overwrite your present grub.cfg. You could set a configfile command in your customized grub.cfg to have it look at the next configfile. You can have a lot of fun with GRUB in a 'Dedicated GRUB Partition'.

    I like to have time to try things out myself before I give advice to others about what's the best thing to do. I have tried setting up a 'Dedicated GRUB2 Partition' with the commands I gave you in the earlier post. The commands worked perfectly for me.
    I haven't had time to try running 'sudo grub-install ... ' from a Ubuntu Live CD yet, I'm not sure if it will work. You can try it if you like, but I'm not sure, most people chroot into a hard disk installed OS before running grub-install, so I think you'll find that you'll need to install Ubuntu first.
    I found I had to run 'chmod 777' for a second time, on the grub.cfg file in addition to the whole disk as grub.cfg was still un-editable until I ran that command.
    My computer has four hard disks, two IDE and two SATA and I had a few problems getting the 'Dedicated GRUB' working properly, to be perfectly honest with you. I ran out of time and rather than persisting with monkeying around with mt new 'Dedicated GRUB I have re-installed my Karmic operating system's GRUB to MBR for the time being as I have some work to do that I need to get on with.
    Maybe sometime soon I'll get back to it though, and find out what I'm doing wrong. I was getting a boot error message when trying to boot Ubuntu with it; 'sparse file not allowed', whatever that means. Since GRUB2 is new I haven't had time to find out about what the error messages mean yet or what to do about them. ... Interesting ... I'll be back with some news later sometime, I'm not sure when, but I'll be back.
    Ubuntu user since 2004 (Warty Warthog)

  10. #10
    Join Date
    Jul 2005
    Location
    Hughenden, Australia
    Beans
    5,096
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Installing GRUB on a separate partition?

    I haven't had time to try running 'sudo grub-install ... ' from a Ubuntu Live CD yet, I'm not sure if it will work.
    Actually, I think I do remember trying it and it didn't work, at least not with the options I was trying to use.
    I know grub-setup works from a LiveCD, but I don't think grub-install will, maybe I'm wrong. I'd like it if you can prove me wrong about that.
    Ubuntu user since 2004 (Warty Warthog)

Page 1 of 5 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •