Author Topic: Has grub changed?  (Read 2099 times)

Offline Andy Axnot

  • Hero Member
  • *****
  • Posts: 694
Re: Has grub changed?
« Reply #15 on: April 18, 2010, 07:59:41 PM »
I see, thanks.  I suppose the default permissions are a bit different in 2010.  I'll check tomorrow.

Andy
Greetings from beautiful downtown Brooklyn, NY   USA
  Still searching for a replacement for KDE3; E17 is looking good; LXDE, too

"all will be fine soon, once kde3 is back on the main repos" - Titus T6us    :o

Offline MCP

  • Sr. Member
  • ****
  • Posts: 371
Re: Has grub changed?
« Reply #16 on: April 18, 2010, 09:08:27 PM »
OP,

Thanks for that information.  That clears up my thinking. Guess I'll have to learn a few things over.

Now onto the problem that started my looking for the menu.lst file in the first place.  While I customize my new install I want to have my old install (2009.2) to bootup by default so that my wife won't complain that she can't access her email. I know it's easy to configure I just have a lot of other changes to make so need the old install to be available anyway.

Background:  I just built a new box, so now I have a total of 5 harddrives installed (one will be going to another machine).  Because the drive I intend to remove also has my old mbr, I changed the boot order of the drives in  bios so that when I installed 2010 the mbr would be written to my new sata drive.  O.K you still with me?  I have a total of 3 sata drives and 2 ide drives.

The sata drives are arranged so that my older sata drive is sda, my new sata drives are sdb and sdc.  I set the bios to boot from sdb (that is where 2010 wrote the mbr).  My old install of pclos is on sda (sda1 to be exact).

Now the problem: PCLOS found the older install and put it in grub as the following:

title PCLinuxOS (PCLinuxOS)
root (hd1,0)
configfile /boot/grub/menu.lst

But each time I select it, I get a black screen saying that it can't recognize the disk.  I've checked and the device.map in grub correctly says that sda is the second drive (that's because the bios boot's to sdb first)

So what am I missing?  Is there an easy fix? ???

MCP

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Has grub changed?
« Reply #17 on: April 18, 2010, 09:42:33 PM »
MCP:

Open a root terminal, at the prompt:

[root@littleboy ~]# fdisk -l

Post the complete results. Include the prompt and command.
Old-Polack

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



Lest we forget...

Offline MCP

  • Sr. Member
  • ****
  • Posts: 371
Re: Has grub changed?
« Reply #18 on: April 18, 2010, 09:55:46 PM »
MCP:

Open a root terminal, at the prompt:

[root@littleboy ~]# fdisk -l

Post the complete results. Include the prompt and command.

Disk /dev/sda: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x623f1c4e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1879    15093036   83  Linux
/dev/sda2            1880       30515   230018670    f  W95 Ext'd (LBA)
/dev/sda5            1881        2389     4088542+  82  Linux swap / Solaris
/dev/sda6            3434        3824     3140676   83  Linux
/dev/sda7            3825        5737    15360376+   b  W95 FAT32
/dev/sda8            5737       18486   102400168+   b  W95 FAT32
/dev/sda9           18486       26288    62668945+  83  Linux
/dev/sda10          30267       30515     2000061   82  Linux swap / Solaris
/dev/sda11          26289       30266    31953253+  83  Linux
/dev/sda12           2390        3433     8385898+  83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x27a9be4d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        6374    51199123+   7  HPFS/NTFS
/dev/sdb2            6375       13296    55600965    5  Extended
/dev/sdb5            6375        9541    25438896   83  Linux
/dev/sdb6            9542       10050     4088511   82  Linux swap / Solaris
/dev/sdb7           10051       13296    26073463+  83  Linux

Disk /dev/sdc: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9e52c71d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        6629    53247411   83  Linux
/dev/sdc2            6630       13258    53247442+  83  Linux
/dev/sdc3           13259       91201   626077147+   5  Extended
/dev/sdc5           13259       26389   105474726   83  Linux
/dev/sdc6           26390       39520   105474726   83  Linux
/dev/sdc7           39521       52651   105474726   83  Linux
/dev/sdc8           52652       65782   105474726   83  Linux
/dev/sdc9           65783       91201   204178086   83  Linux

Disk /dev/sdd: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7dbe7dbe

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *           1         262     2104483+   b  W95 FAT32
/dev/sdd2             263        9729    76043677+   f  W95 Ext'd (LBA)
/dev/sdd5             263        1959    13631121    7  HPFS/NTFS
/dev/sdd6            1960        3918    15735636    b  W95 FAT32
/dev/sdd7            3919        9729    46676826    b  W95 FAT32

Disk /dev/sde: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9350b296

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               2       11099    89144685    f  W95 Ext'd (LBA)
/dev/sde2           11107       11171      522112+  82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sde3   *       11172       13081    15339535   83  Linux
/dev/sde4           13082       14947    14987448   83  Linux
Partition 4 does not end on cylinder boundary.
/dev/sde5               2       11099    89136936    b  W95 FAT32
[root@localhost ~]#

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Has grub changed?
« Reply #19 on: April 18, 2010, 11:32:26 PM »
MCP:

OK. By looking at the sizes of the drives, you can see the actual way the system sees them. The first on the list should be (hd0) the second on the list (hd1) third (hd2) and so on. The device.map is put there at installation time, and is a guess as to the order. (The grub manual states this clearly) When you change the boot drive, it becomes (hd0) and the others get reshuffled, so even if the device.map was correct then, it is not now. I can't remember the last time I even looked at a device.map, but it's been years. They are just too inaccurate to depend on.

Because of this drive shuffling, and the uncertainty of which drive is other than (hd0), I have boot partitions on each of my hard drives, and a copy of the /boot directory from each installation, renamed for that installation, in each boot partition. In the case of this installation, that directory is named minime2010 and because it's on the boot drive it can be found on (hd0,0). I also label each partition, so the menu.lst stanza to boot this installation looks like this;

title MiniMe 2010
kernel (hd0,0)/minime2010/vmlinuz BOOT_IMAGE=MiniMe_2010 root=LABEL=minime2010 resume=LABEL=swap1000 vga=791
initrd (hd0,0)/minime2010/initrd.img


In this case the advantage of this is doubled, because this OS is installed on a USB connected external drive, and this BIOS is too old to allow booting from any USB device; it doesn't even know they exist. The Linux kernel, however, does know all about USB hard drives and can see them just fine, so once the kernel is loaded, it looks for a partition also labeled minime2010, mounts it as / and I'm here typing this.

It no longer matters, to me, which hard drive is the boot drive, That one stanza will always work.
Old-Polack

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



Lest we forget...

Offline MCP

  • Sr. Member
  • ****
  • Posts: 371
Re: Has grub changed?
« Reply #20 on: April 19, 2010, 09:53:29 AM »
Can you clarify what you mean by "boot partitions"?  Are you refering to the mbr of each disk?  Your method sounds great, can you elaborate how you did this or point to some other instructions?

Thanks,
MCP

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Has grub changed?
« Reply #21 on: April 19, 2010, 01:46:41 PM »
Can you clarify what you mean by "boot partitions"?  Are you refering to the mbr of each disk?  Your method sounds great, can you elaborate how you did this or point to some other instructions?

Thanks,
MCP

A boot partition is just that; a separate partition dedicated to holding kernels and initrd images for easy access. It is the first primary partition of a drive, followed by a swap partition on the second primary partition. There is a reason for this particular set up; if the boot partition needs to be made larger, a swap partition is the easiest to delete and recreate, as it can be turned off, (unmounted) from the running system, and contains no permanent data that might be lost, as with other partitions.

The process to enlarge the boot partition goes like this;

1. Use the command swapoff /dev/sda2 to unmount the swap partition.

2. If the boot partition is mounted; as root; umount /dev/sda1

3. Use fdisk to delete the swap partition, then the boot partition.

4. Create a new larger sized boot partition, starting at cylinder 1 and of the size desired, still using fdisk.

5. Create a new swap partition from the remaining space where the old swap partition was.

6. Use the mkswap /dev.sda2 command to format the new swap partition.

7. Use the command resize2fs /dev/sda1 to expand the existing file system to fill the new larger partition.

8. Use the command swapon /dev/sda2 to mount the new swap partition.

9. If one wants the boot partition mounted, (I usually don't mount it); as root; mount /dev/sda1 /boot

It took longer to type those instructions than it takes to actually do the job. The file system of the boot partition is in no way harmed during the process; all the data contained remains intact.

My boot partitions started out being 100 MB, as they only contained the kernels and initrd images for the OS installed on that individual drive. Now they are up to 300 MB, as they contain the kernels and initrd images for the other drives as well. If I need more space, for other added OS, I can repeat the above procedure.

The partition table of /dev/sdc as an example:

Code: [Select]
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1          39      313236   83  Linux                    <-- Boot partition
/dev/sdc2              40        1047     8096760   82  Linux swap / Solaris     <-- Swap partition
/dev/sdc3            1048        7127    48837600   83  Linux                    <-- First / partition  
/dev/sdc4            7128      121601   919512405    5  Extended
/dev/sdc5            7128       20500   107418591   83  Linux
/dev/sdc6           20501       33267   102550896   83  Linux
/dev/sdc7           33268       37158    31254426   83  Linux
/dev/sdc8           37159       41049    31254426   83  Linux
/dev/sdc9           41050       44940    31254426   83  Linux
/dev/sdc10          44941       48831    31254426   83  Linux
/dev/sdc11          48832       61886   104864256   83  Linux
/dev/sdc12          61887      101050   314584798+  83  Linux
/dev/sdc13         101051      104942    31262458+  83  Linux
/dev/sdc14         104943      108893    31736376   83  Linux                    <-- The MiniMe / partition

« Last Edit: April 19, 2010, 01:48:47 PM by old-polack »
Old-Polack

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



Lest we forget...