Author Topic: grub for multiple Linuxes  (Read 855 times)

Offline dougmack

  • Hero Member
  • *****
  • Posts: 981
grub for multiple Linuxes
« on: February 07, 2013, 05:30:16 PM »
I have XP and Mint 14-KDE-64 installed, with plenty of disk space. I want to install pclos32 on the disk also.  Will there be a grub
problem?  (I don't know what Mint's boot system uses.)  Later, if I ever find out how to make pclos64 work on that system, I would
like to install that also. (I tried once, and it failed--my post about that is in the RC section of this forum.)

Thanx for advice--doug
Blessed are the peacemakers...for they shall be shot at from both sides.  A. M. Greeley

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: grub for multiple Linuxes
« Reply #1 on: February 07, 2013, 06:23:37 PM »
I have XP and Mint 14-KDE-64 installed, with plenty of disk space. I want to install pclos32 on the disk also.  Will there be a grub
problem?  (I don't know what Mint's boot system uses.)  Later, if I ever find out how to make pclos64 work on that system, I would
like to install that also. (I tried once, and it failed--my post about that is in the RC section of this forum.)

Thanx for advice--doug

Mint uses grub2 while PCLinuxOS uses legacy grub, so yes, you will have problems if you don't make adjustments. Grub2 has been broken since day one, and no one seems interested in fixing it. If you leave it as the primary grub installed to the MBR you will continue to have problems every time a kernel is upgraded, or a new installation added, because it will overwrite any corrections you have made to it, with the same errors you previously corrected.

Legacy grub, if installed to the MBR, is much easier to make corrections to, having only to write a boot stanza in /boot/grub/menu.lst to chainload to grub2 installations. The standard stanza for that is shown below.

title <your choice>
root (hdN,n)
kernel /boot/grub/core.img


Replace the N with the hard drive number and n with the partition number. With legacy grub, counting for both starts with 0. If you only have one hard drive, then N will always be 0.

If you have two hard drives, the one that you boot from will always be (hd0) and the second drive will be (hd1). If you have more than two drives, the boot drive will still be (hd0) and the other two drives (hd1) and (hd2), but which is which can be a bit harder to figure out.

Assuming a single hard drive, the first partition on /dev/sda1 will be seen by both BIOS and grub as (hd0,0). An installation on /dev/sda5 would be seen by BIOS and grub as (hd0,4), always one less than that used with the /dev/sdan designation, because of the counting starting at 0.

If you know which partition is the Mint / partition, that would be the one you would list as the root entry in the stanza given above.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline dougmack

  • Hero Member
  • *****
  • Posts: 981
Re: grub for multiple Linuxes
« Reply #2 on: February 07, 2013, 08:31:00 PM »
Thanx, OP.  I thought there might be something like that. I will find all the partition numbers before I install PCLOS32. (I just
cleaned up the disk structure with GParted.) I was glad to see the explanation of the numbering. I'm sure I puzzled that out
once, quite a while ago, but I'm sure I would have forgotten it!

I am a bit confused by the expression "core image."  If I need to write that, where would I find it?
Do I have to write it?  As I recall, there is an option in pclos "redo MBR."  If I do that from the install disk, will it
automagically find Mint and install it in menu.lst? 

I thank you for the assistance. You have always been an excellent adviser!

--doug
Blessed are the peacemakers...for they shall be shot at from both sides.  A. M. Greeley

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: grub for multiple Linuxes
« Reply #3 on: February 07, 2013, 09:08:19 PM »
Thanx, OP.  I thought there might be something like that. I will find all the partition numbers before I install PCLOS32. (I just
cleaned up the disk structure with GParted.) I was glad to see the explanation of the numbering. I'm sure I puzzled that out
once, quite a while ago, but I'm sure I would have forgotten it!

I am a bit confused by the expression "core image."  If I need to write that, where would I find it?
Do I have to write it?  As I recall, there is an option in pclos "redo MBR."  If I do that from the install disk, will it
automagically find Mint and install it in menu.lst?  

I thank you for the assistance. You have always been an excellent adviser!

--doug

Quite honestly, I've never used the redo MBR application, but I would guess that there is a way to either copy/paste a stanza there, or manually add one, line by line. I usually just add a stanza to /boot/grub/menu.lst manually, using kwrite as root.

If you plan to keep the Mint installation, which I assume you would, just install the PCLinuxOS grub to the MBR. It should pick up the Windows installation and create a boot stanza for it, so you should be able to boot to PCLinuxOS and Windows immediately after the installation. Once you have your PCLinuxOS installation running, and have created the root password and a normal user, you can then edit the menu.lst file to add the stanza for Mint. A reboot will allow you to test the new stanza, and it there are any problems, reboot to the PCLinuxOS installation to make any changes needed.

If the Mint stanza in your menu.lst is created properly, once you select Mint from the initial boot menu, you should see the Mint boot menu next, and you should then be able to get to the Mint installation exactly as you do now. Chainloading adds that extra step to the process, but allows all the options normally available on the grub2 boot menu.

As an alternative, you can write a legacy grub stanza that boots Mint directly, but that gets a bit more complex then using the chainloader stanza. I've been doing this a long time and have no problem writing such a stanza, but I'd personally use the chainloader stanza, just because it's so simple.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline dougmack

  • Hero Member
  • *****
  • Posts: 981
Re: grub for multiple Linuxes
« Reply #4 on: February 07, 2013, 10:15:46 PM »
On another dual-boot machine, the entry for Windows (XP) reads like this:
title windows
root (hd0,0)
makeactive
chainloader +1

Mint is loaded on sda5 and sda6, so would this work:
title mint
root (hd0,4)
make active
chainloader +1

--doug
Blessed are the peacemakers...for they shall be shot at from both sides.  A. M. Greeley

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: grub for multiple Linuxes
« Reply #5 on: February 07, 2013, 10:23:16 PM »
On another dual-boot machine, the entry for Windows (XP) reads like this:
title windows
root (hd0,0)
makeactive
chainloader +1

Mint is loaded on sda5 and sda6, so would this work:
title mint
root (hd0,4)
make active
chainloader +1

--doug

It would, if Mint was using legacy grub, and it was installed to the / partition's boot sector, though the makeactive parameter is not needed with any Linux installation That not being likely, this should work;

title Mint
root (hd0,4)
kernel /boot/grub/core.img

Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline dougmack

  • Hero Member
  • *****
  • Posts: 981
Re: grub for multiple Linuxes
« Reply #6 on: February 08, 2013, 12:18:52 AM »
It turns out I didn't get that far. I tried to install pclos32. When it asked about partitions, I tried to say / and /home for two
free partitions, but the installer said there are already / and /home, so I tried /pclos/  and /pclos/home/ and it didn't like that.
Message came up said it couldn't load files and crashed. Now nothing will boot. I futzed around with a rescue disk, and found
that I could still access XP, but not Mint. I will go to the Mint forum and see if they think it can be salvaged--I hope so, I put
in a lot of work getting Thunderbird files copied and installing a decent font set, and a few other things.

Meantime, assuming I can get Mint back working and booting, how can I install pclos-32? ( I never had any trouble installing
other Linuxes to multi-boot with pclos, but I never tried it the other way, with the other one there first.)

Thanx for your patience!  --doug
Blessed are the peacemakers...for they shall be shot at from both sides.  A. M. Greeley

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: grub for multiple Linuxes
« Reply #7 on: February 08, 2013, 02:32:06 AM »
It turns out I didn't get that far. I tried to install pclos32. When it asked about partitions, I tried to say / and /home for two
free partitions, but the installer said there are already / and /home, so I tried /pclos/  and /pclos/home/ and it didn't like that.
Message came up said it couldn't load files and crashed. Now nothing will boot. I futzed around with a rescue disk, and found
that I could still access XP, but not Mint. I will go to the Mint forum and see if they think it can be salvaged--I hope so, I put
in a lot of work getting Thunderbird files copied and installing a decent font set, and a few other things.

Meantime, assuming I can get Mint back working and booting, how can I install pclos-32? ( I never had any trouble installing
other Linuxes to multi-boot with pclos, but I never tried it the other way, with the other one there first.)

Thanx for your patience!  --doug

Somewhere you took a wrong turn with the installer. On its own, the installer has no idea what is on any partition not directly involved with the installation, doesn't care what's currently on a chosen partition, and will accept any partition designated to be / as just that. Unless ordered not to, it will format the designated partition and install to it. If you wish to use existing partitions, use the Custom partitioning choice, then pick a partition, click the Mount Point button, designate it as /, then pick another partition and do the same, but designate it as /home. Then click the Done button.

If you choose to label the partitions, each partition needs a unique label name. Poor label names would be / and /home if you wish to have more than one installation on a given machine. I have 40+ labeled partitions, 19 on drive installations, and not one uses the label names / or /home. Those designations are mount point designations, so should not be used as partition labels on a multi boot system. That only causes confusion, to both you and the system. I suspect that is where you encountered all the confusion in the above quoted reply.

I label my various / partitions with a label that tells me which specific installation it is. If I have two similar installations, one the clone of the other, I label the cloned / partition with a similar name and add a -2 to that name, thus making it again unique. but readily identifiable. When I cloned a clone that already had a -2 in the name, I added a -c to the label to designate that it was the clone of the -2 installation, on the sdc drive; ie the original installation is labeled kde64, the first clone kde64-2, and the second clone kde64-2-c. I could have just as easily used kde64-3 for the second clone, but that might be mistaken for another clone of kde64, rather than a clone of kde64-2, which has had additional packages added that are not present on the original kde64 installation.

The label on the / partition of the installation I'm typing this from is 64RC. It is a fresh installation from the KDE-64-RC1 image. As it's currently the only image with an RC in the name, that label is sufficient. If we have an RC2 later, a fresh installation from it will be labeled 64RC2. When we have an official 64bit public release, I'll label that KDE64-FINAL, or KDE64-OFFICIAL, probably the former, as it's shorter. Any installation from a later quarterly image would be labeled with the date of the release, ie KDE64-13-06 if the installation was from a pclinuxos-kde-64-2013.06.iso image.

 
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline dougmack

  • Hero Member
  • *****
  • Posts: 981
Re: grub for multiple Linuxes
« Reply #8 on: February 08, 2013, 10:20:11 AM »
Good idea! I never heard of it before. Looked up tune2fs. Can partitions with systems on already be labelled, or would that
destroy the boot procedure? Can a partition formatted NTFS (XP) also be labelled? Also, is there any reason I couldn't run
tune2fs from a live CD/DVD? 

Thanx for the input--I will certainly label my partitions.

--doug
Blessed are the peacemakers...for they shall be shot at from both sides.  A. M. Greeley

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: grub for multiple Linuxes
« Reply #9 on: February 08, 2013, 01:54:29 PM »
Good idea! I never heard of it before. Looked up tune2fs. Can partitions with systems on already be labelled, or would that
destroy the boot procedure? Can a partition formatted NTFS (XP) also be labelled? Also, is there any reason I couldn't run
tune2fs from a live CD/DVD? 

Thanx for the input--I will certainly label my partitions.

--doug

Yes, you can label a partition that was not previously labeled but already has an installation on it. You can also relabel a partition, giving it a new name. If your /etc/fstab uses LABEL=<name> to mount partitions, rather than UUID=<numbers>, the label names must be correctly written, as to being case sensitive, and if changes are made to your /boot/grub/menu.lst and /etc/fstab to use LABEL=<name> in place of UUID=<numbers> you may also need to run mkinitrd, as root, to build a new initrd image that is sure to include the changes, and avoid any unnecessary boot delays.  This is not always necessary, so try to reboot first, before doing so. If everything works properly and there are no unnecessary delays, you're done.

To label an ext* partition;

[root@localhost ~]# tune2fs -L <newlabel> /dev/<partition-designation>

NTFS partitions can also be labeled, but need to be labeled using a different application (ntfsprogs package) and command;

[root@localhost ~]# ntfslabel -f /dev/<partition-designation> <newlabel>

Swap partitions can also be labeled with the command;

[root@localhost ~]# swaplabel -L <newlabel> /dev/<swap-partition-designation>

Using my /etc/fstab as an example;

[root@fatman ~]# cat /etc/fstab
Code: [Select]
# Entry for /dev/sdc15 :
LABEL=64RC              /                       ext4    defaults,noatime                1 1
LABEL=HOME64            /home                   ext4    defaults,noatime                1 2
LABEL=TR5-Documents     /home/polack/Documents  ext3    rw,user,noauto,exec,noatime     0 0
LABEL=Documents2        /home/polack/Documents2 ext3    rw,user,noauto,exec,noatime     0 0
LABEL=DL-1              /home/polack/Downloads  ext4    rw,user,auto,exec,noatime       0 0
LABEL=VDI               /vdi                    ext4    rw,user,auto,exec,noatime       0 0
LABEL=share1            /share1                 ext4    rw,user,auto,exec,noatime       0 0
LABEL=SHARE2            /share2                 ext4    rw,user,auto,exec,noatime       0 0
LABEL=share9            /share9                 ext3    rw,user,auto,exec,noatime       0 0
LABEL=movies            /movies                 ext3    rw,user,auto,exec,noatime       0 0
LABEL=movies2           /movies2                ext3    rw,user,auto,exec,noatime       0 0
LABEL=storage00         /zstorage00             ext3    rw,user,noauto,exec,noatime     0 0
LABEL=120backup         /zbackup                ext3    rw,user,noauto,exec,noatime     0 0
LABEL=boot2000          /mnt/boot               ext3    rw,user,noauto,exec,noatime     0 0
LABEL=REPO              /repo                   ext4    rw,user,auto,exec,noatime       0 0
none                    /proc                   proc    defaults                        0 0
# Entry for /dev/sdc2 :
LABEL=swap2000          swap                    swap    defaults                        0 0
# Entry for /dev/sda2 :
LABEL=swap1000          swap                    swap    defaults                        0 0
# Entry for /dev/sdb2 :
LABEL=swap750           swap                    swap    defaults                        0 0
none                    /dev/pts                devpts  mode=0620                       0 0
/dev/fd0                /mnt/floppy             auto    rw,user,noauto,exec             0 0
/dev/cdrom              /mnt/cdrom              auto    ro,user,noauto                  0 0
/dev/dvd                /mnt/dvd                auto    ro,user,noauto                  0 0
# none                  /dev/shm                tmpfs   defaults                        0 0

For this to work the mount point directories must actually exist, and as most are not in my users $HOME directory, those that aren't must be created by root.. Partitions can be mounted anywhere one chooses, and most documentation says they should be in a sub directory of /mnt. It being my computer, I choose to mount many partitions in directories located directly in the / directory. I use the /mnt directory for mount point sub-directories for temporary mounting of lesser used partitions and devices, for specific tasks.

[root@fatman ~]# ls -l /mnt
Code: [Select]
total 32
drwxr-xr-x  2 root root 4096 Jan 26 14:44 bbackup/
drwxr-xr-x 11 root root 4096 Jan 26 12:58 boot/
drwxr-xr-x  2 root root 4096 Jan 26 14:41 cdrom/
drwxr-xr-x  2 root root 4096 Jan 26 14:41 dvd/
drwxr-xr-x  2 root root 4096 Jan 27 05:26 floppy/
drwxr-xr-x  2 root root 4096 Jan 26 14:41 here/
drwxr-xr-x  2 root root 4096 Jan 26 14:41 there/
drwxr-xr-x  2 root root 4096 Jan 26 14:44 usb/

I don't allow hal/udev to automount anything, so my /media directory is always empty, or in most installations, like this one, non-existent.

[root@fatman ~]# ls -l /media
ls: cannot access /media: No such file or directory

This is pretty old school, and how Unix and Linux were originally designed to mount partitions, before trying to emulate Windows auto-mounting. While must newly arrived Windows refugees seem to like, and expect, partition mounting to be like that in Windows, I prefer to use the original Linux method, and it is very much alive and well and fully functional in all modern Linux systems.

[rant]
We tell new users that Linux is different from Windows, but no longer seem willing to teach those users that this is one of the differences. Instead we try to emulate "the Windows way" rather than demonstrate the logic that actually makes the Linux difference superior. The argument used is that new users "don't want to have to learn" the Linux way of doing things. While true for some, I personally think it's a disservice to them, and a cop out excuse from programmers, to add layers of unnecessary complexity and the additional problems that complexity brings with it. Why are we willing to teach people how to fix their broken auto-mounting udev rules, rather than teach them to properly edit a single /etc/fstab file, and avoid the udev mounting problems altogether? How can we not expect our Linux systems to become overly bloated, when we go out of our way to emulate overly bloated Windows systems?
[/rant]
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10668
  • MLUs Forever!
Re: grub for multiple Linuxes
« Reply #10 on: February 08, 2013, 03:50:17 PM »
The beauty of Linux is that we have choices in how we manage our devices and mount points.

I use a lot of removable devices with multiple partitions.

It is much more convenient for me to manage those mounts through Device Notifier than through other means.

My fstab file contains two mounts ....  / & /home

I have 4 internal partitions which automount on boot .... through Device Notifier.
I have simple, one click access to unmount and mount all those internal partitions.
Suitable mount points are created on the fly, based on Label (first preference).

So for me this scheme is much more convenient and suits the way I use the system.
I can mount a fs when required for a few minutes and unmount it when finished.

I care little for the idea 'it has always been done this way' so we should follow that blindly.

When those schemes were common there was no such thing as flash drives being inserted and unplugged, umpteen times per day.

Not that it matters ........  we have sufficient choices to suit most ways of working.

MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: grub for multiple Linuxes
« Reply #11 on: February 08, 2013, 05:08:33 PM »
The beauty of Linux is that we have choices in how we manage our devices and mount points.

I use a lot of removable devices with multiple partitions.

It is much more convenient for me to manage those mounts through Device Notifier than through other means.

My fstab file contains two mounts ....  / & /home

I have 4 internal partitions which automount on boot .... through Device Notifier.
I have simple, one click access to unmount and mount all those internal partitions.
Suitable mount points are created on the fly, based on Label (first preference).

So for me this scheme is much more convenient and suits the way I use the system.
I can mount a fs when required for a few minutes and unmount it when finished.

I care little for the idea 'it has always been done this way' so we should follow that blindly.

When those schemes were common there was no such thing as flash drives being inserted and unplugged, umpteen times per day.

Not that it matters ........  we have sufficient choices to suit most ways of working.



I totally agree that you have that choice, and should have that choice, but what makes it a choice is that you actually know how to set up an extensive /etc/fstab file, and choose not to. You have the knowledge to make an informed choice that is right for you. Those that never learn, how the system works, and why, because the information that is needed is deliberately withheld, or the advantages of one method over the other, to compare the different methods, don't actually have a choice of a preferred method. They have only the one method that the system defaults to. They don't even know there are choices, until someone tells them they exist.

One goes to school and learns basic math the hard way, through memorization and calculations done on paper. Later one uses a calculator, to speed things up, but it is still the hard learned basics that tells one how to use the calculator properly, and what to enter, in what order, that gets the desired results. If all one knows is what buttons to push, without understanding the basics behind it all, when the batteries go dead, that person is lost. They have nothing to fall back on while waiting for new batteries, and heaven help them if they drop the thing and it breaks.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10668
  • MLUs Forever!
Re: grub for multiple Linuxes
« Reply #12 on: February 08, 2013, 05:38:38 PM »
Yes, I agree O-P .......  but as an example of the other side of things .....  I have spent the last hour or so on the phone with a friend who is installing fresh .....  both 64 & 32 bit versions.

He wanted to know what size partitions to use .....  how best to set up /home and the user accounts etc etc.

I could not answer .....  there are too many choices to be made depending on his personal use.

Yet he does not have the time/interest/capacity to learn the subtle differences and how they might affect his use.

So a default set up, based on my own preferences, is what he will use.

Something must be used in distros as default ......  and the 'simplest to use' default is the best for the target users.

If those users never bother or do not have the opportunity, to learn anything afterwards, that is their own doing ......  no one can influence that.

In the end the released ISO must be close to the lowest common denominator ....  without being stupidly so.
In other words it must be done to attract the target audience .....  which after all has traditionally been defectors from Windows  :D

It is after they begin to use Linux that the learning really begins.

;)
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline dougmack

  • Hero Member
  • *****
  • Posts: 981
Re: grub for multiple Linuxes
« Reply #13 on: February 08, 2013, 10:15:12 PM »
As both of you (OP and J17) I am one of the "onlookers"--altho I am attempting to become just a little more "in the know."
But I have to say that there is a little too much dumbing down in some of the Linux distros.  Perhaps that has not happened
yet in pclos, but it is a bragging point in Ubuntu, and, apparently by extension, Mint.  I have recently been looking at Mint,
to see if its 64-bit version would run in a computer where pclos's 64-bit version wouldn't, when I tried. In one of their
introductory documents they basically say that "everything you need is here, do not try to load anything else."  Looking
just at their choice of fonts, I was appalled. The only thing that looks vaguely like "print" is something they call "Liberation."
Faugh! I imported the entire font directory from pclos into that distro. "Do not try to load anything else!" Talk about dumbing down!
It's too bad.  While I have chosen pclos and like it, I must confess that Mint's version of KDE is not a bad one. But Mint
is definitely not pclos.

I guess we have kind of gotten off topic, but I just wanted to chime in and say, Please, folks, don't make a Mint or an Ubuntu
out of pclinux.

Thanx for all the help you guys have provided.  --doug
Blessed are the peacemakers...for they shall be shot at from both sides.  A. M. Greeley

Offline dougmack

  • Hero Member
  • *****
  • Posts: 981
Re: grub for multiple Linuxes--more
« Reply #14 on: February 09, 2013, 11:12:42 PM »
In reply number 7, it was stated that you can make any partition / and /home.  But I already have / on sda5 and /home on sda6 for Mint.
The partitions are labelled. I want to put pclos on sda9 and sda10, but when I tell the system to make 9 / and 10 /home, it says
error, you already have / and home.  So what do I do to make this work?

--doug
Blessed are the peacemakers...for they shall be shot at from both sides.  A. M. Greeley