Author Topic: Problems after changing partition layout  (Read 405 times)

Offline Cris70

  • Full Member
  • ***
  • Posts: 139
Problems after changing partition layout
« on: March 03, 2013, 02:06:43 PM »
Hi all,
I am having a problem with my boot hard drive, due to some work I did to change the partitioning layout.
Let me explain: I was running out of space on my root partition, so I decided to remove two old partitions I had on the same disk and then extend the root partition to occupy all the space.
That's exactly what I did, and all was well.... nearly. At the next boot, grub dumped me to an interactive prompt, but that was expected. The layout had changed and the UUIDs had changed too.
I booted from a livecd and corrected the UUIDs in grub's menu.lst and in /etc/fstab. Then, on the next boot I told grub about the new root, and it happily booted.
Despite the apparent happy ending, I have two problems I can't solve:
- when it boots, pclinuxos still looks for /dev/sda3 and /dev/sda6 which are now gone. This introduces a two minute (1 for each partition) pause in the boot progress. I have been unable to find where the heck this information is stored;
- grub still dumps me to the command line at every boot, despite having reinstalled it a couple of times; each time I have to tell it about the new root, and then it loads my menu and correctly boots;

I am really at a loss: how can I tell grub to save the new root, and how can I make linux forget about /dev/sda3 and /dev/sda6?

All this is complicated by the fact (but this is an old story.. it's been like so for years...) that grub sees the drive layout differently from pclinuxos: it has /dev/sda and /dev/sdb swapped with respect to pclinuxos. So when I start grub interactively under pclinuxos to reinstall it, I have to use a different root (hd0,1); when it boots the root becomes (hd2,1). This is maybe the reason why I cannot get it to boot without "help" from me.

Google found a couple of old cases like mine, unfortunately without solution.

Any help is appreciated.

Bye
Cris

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10675
  • MLUs Forever!
Re: Problems after changing partition layout
« Reply #1 on: March 03, 2013, 02:15:37 PM »
Quote
I am really at a loss: how can I tell grub to save the new root,

Edit /boot/grub.menu.lst file (you will need to have root permissions) to point to the correct partition

 
Quote
and how can I make linux forget about /dev/sda3 and /dev/sda6?

Rebuild the initrd .....  you will find instructions in a few posts on the forum.

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 TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 728
Re: Problems after changing partition layout
« Reply #2 on: March 03, 2013, 02:21:38 PM »
Rebuild the initrd .....  you will find instructions in a few posts on the forum.

As root

Code: [Select]
mkinitrd -f -v /boot/initrd-$(uname -r).img $(uname -r)
Terry
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|

Offline Cris70

  • Full Member
  • ***
  • Posts: 139
Re: Problems after changing partition layout
« Reply #3 on: March 03, 2013, 03:43:06 PM »
Quote
I am really at a loss: how can I tell grub to save the new root,

Edit /boot/grub.menu.lst file (you will need to have root permissions) to point to the correct partition

Unfortunately that's not the case. I did already do what you suggest (see my original message) but that's not enough.
Actually menu.lst is loaded from root, so grub must already know where root is. The problem lies before menu.lst is loaded.

Quote
and how can I make linux forget about /dev/sda3 and /dev/sda6?

Rebuild the initrd .....  you will find instructions in a few posts on the forum.


Thank you! That did the trick!! Now my system boots without the two minutes pause.

Unfortunately the first problem is still here.
Any suggestions?

T.I.A.
Cris

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10675
  • MLUs Forever!
Re: Problems after changing partition layout
« Reply #4 on: March 03, 2013, 04:04:51 PM »
Quote
- grub still dumps me to the command line at every boot, despite having reinstalled it a couple of times; each time I have to tell it about the new root, and then it loads my menu and correctly boots;

What exactly are you doing?


It would appear that when you reinstall Grub you are not using the correct root partition.

How are you reinstalling it?
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 Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6384
  • I'm going South
Re: Problems after changing partition layout
« Reply #5 on: March 03, 2013, 04:09:50 PM »
Quote
I am really at a loss: how can I tell grub to save the new root,

Edit /boot/grub.menu.lst file (you will need to have root permissions) to point to the correct partition

Unfortunately that's not the case. I did already do what you suggest (see my original message) but that's not enough.
Actually menu.lst is loaded from root, so grub must already know where root is. The problem lies before menu.lst is loaded.

Quote
and how can I make linux forget about /dev/sda3 and /dev/sda6?

Rebuild the initrd .....  you will find instructions in a few posts on the forum.


Thank you! That did the trick!! Now my system boots without the two minutes pause.

Unfortunately the first problem is still here.
Any suggestions?

T.I.A.
Cris


I'm a bit confused. Wasn't your first problem the two-minute pause? Anyway, I think it could be helpful if you posted your /boot/grub/menu.lst, and the output of the commands blkid and fdisk -l.

Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Cris70

  • Full Member
  • ***
  • Posts: 139
Re: Problems after changing partition layout
« Reply #6 on: March 03, 2013, 04:17:05 PM »
Quote
- grub still dumps me to the command line at every boot, despite having reinstalled it a couple of times; each time I have to tell it about the new root, and then it loads my menu and correctly boots;

What exactly are you doing?

Just17, I have to issue the command "root (hd2,1)", then simply pressing ESC will load my menu.lst.

It would appear that when you reinstall Grub you are not using the correct root partition.

How are you reinstalling it?

As root, I enter the command "grub". Then I issue the command "find /boot/grub/stage1", which show me the root partition as seen by grub. As I told before, when pclinuxos is booted grub sees disks mapped differently, and so it will reply with "(hd0,1)". I issue "root (hd0,1)" and then "setup (hd0)" and that's it.

Am I doing something wrong?

Bye
Cris

Offline Cris70

  • Full Member
  • ***
  • Posts: 139
Re: Problems after changing partition layout
« Reply #7 on: March 03, 2013, 04:27:33 PM »
Hi Bald Brick!

I'm a bit confused. Wasn't your first problem the two-minute pause? Anyway, I think it could be helpful if you posted your /boot/grub/menu.lst, and the output of the commands blkid and fdisk -l.

I'm sorry, when I said "first" I was just referring to the order in which Just17 replied. Not important though... I'm including here the info you requested:

Code: [Select]
[root@polaris boot]# cat /boot/grub/menu.lst
timeout 5
color black/cyan yellow/cyan
gfxmenu (hd2,1)/boot/gfxmenu
default 0

title linux
kernel (hd2,1)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=7b643238-6535-3966-352d-326466332d66 splash=silent vga=788
initrd (hd2,1)/boot/initrd.img


title linux-nonfb
kernel (hd2,1)/boot/vmlinuz BOOT_IMAGE=linux-nonfb root=UUID=7b643238-6535-3966-352d-326466332d66
initrd (hd2,1)/boot/initrd.img


title failsafe
kernel (hd2,1)/boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=7b643238-6535-3966-352d-326466332d66 failsafe
initrd (hd2,1)/boot/initrd.img


title 2.6.38.8-pclos3.pae.bfs
kernel (hd2,1)/boot/vmlinuz-2.6.38.8-pclos3.pae.bfs BOOT_IMAGE=2.6.38.8-pclos3.pae.bfs root=UUID=7b643238-6535-3966-352d-326466332d66 splash=silent vga=788
initrd (hd2,1)/boot/initrd-2.6.38.8-pclos3.pae.bfs.img


title 3.2.18-pclos2.pae.bfs
kernel (hd2,1)/boot/vmlinuz-3.2.18-pclos2.pae.bfs BOOT_IMAGE=3.2.18-pclos2.pae.bfs root=UUID=7b643238-6535-3966-352d-326466332d66 splash=silent vga=788
initrd (hd2,1)/boot/initrd-3.2.18-pclos2.pae.bfs.img

Code: [Select]
[root@polaris boot]# blkid
/dev/sdb5: LABEL="LinuxOpt" UUID="45247e0e-d630-11de-8dea-00138ffcde61" TYPE="jfs"
/dev/sdb6: LABEL="LinuxHome" UUID="471b3fea-d630-11de-8dea-00138ffcde61" TYPE="jfs"
/dev/sdb7: UUID="e97c07f4-0000-0000-0000-000000005c0f" TYPE="jfs"
/dev/sdc2: SEC_TYPE="msdos" LABEL="DOS BOOT" UUID="96AE-1D00" TYPE="vfat"
/dev/sdc5: SEC_TYPE="msdos" LABEL="DOS DATA" UUID="D86F-E814" TYPE="vfat"
/dev/sdc6: LABEL="ECS DATA 1" UUID="E8AE-7814" TYPE="hpfs"
/dev/sdc7: UUID="e97c07f4-0000-0000-0000-000000001c0e" TYPE="jfs"
/dev/sdc8: UUID="e97c07f4-0000-0000-0000-000000009010" TYPE="jfs"
/dev/sdc9: UUID="e97c07f4-0000-0000-0000-00000000600f" TYPE="jfs"
/dev/sdc10: LABEL="DIGITAL VID" UUID="01A2-F387" TYPE="vfat"
/dev/sda2: LABEL="LinuxRoot" UUID="7b643238-6535-3966-352d-326466332d66" TYPE="ext3"
/dev/sda1: LABEL="LinuxSwap" UUID="020019c8-a2c6-43ab-963e-e31411c422e8" TYPE="swap"

Code: [Select]
[root@polaris boot]# fdisk -l

Disk /dev/sda: 18.4 GB, 18360785920 bytes
255 heads, 63 sectors/track, 2232 cylinders, total 35860910 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63     2088449     1044193+  82  Linux swap / Solaris
/dev/sda2   *     2088450    35857079    16884315   83  Linux

Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1           16065   488392064   244188000    f  W95 Ext'd (LBA)
/dev/sdb5           16128    20996954    10490413+   7  HPFS/NTFS
/dev/sdb6        20997018   283579379   131291181    7  HPFS/NTFS
/dev/sdb7   *   283579443   488392064   102406311   35  Unknown

Disk /dev/sdc: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders, total 80293248 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *          63       16064        8001    a  OS/2 Boot Manager
/dev/sdc2           16065      835379      409657+   6  FAT16
/dev/sdc3          835380    80292869    39728745    5  Extended
/dev/sdc5          835443      947834       56196    6  FAT16
/dev/sdc6          947898     1381589      216846    7  HPFS/NTFS
/dev/sdc7   *     1381653    22282154    10450251   35  Unknown
/dev/sdc8        22282218    43182719    10450251   35  Unknown
/dev/sdc9        43182783    63665594    10241406   35  Unknown
/dev/sdc10       63665658    80292869     8313606    c  W95 FAT32 (LBA)


You can disregard everything on /dev/sdc. Those are old OS/2 partitions that I have recently "virtualized" (i.e. copied to a VirtualBox VDI image).

Bye
Cris

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10675
  • MLUs Forever!
Re: Problems after changing partition layout
« Reply #8 on: March 03, 2013, 04:31:41 PM »
Quote
- grub still dumps me to the command line at every boot, despite having reinstalled it a couple of times; each time I have to tell it about the new root, and then it loads my menu and correctly boots;

What exactly are you doing?

Just17, I have to issue the command "root (hd2,1)", then simply pressing ESC will load my menu.lst.

It would appear that when you reinstall Grub you are not using the correct root partition.

How are you reinstalling it?

As root, I enter the command "grub". Then I issue the command "find /boot/grub/stage1", which show me the root partition as seen by grub. As I told before, when pclinuxos is booted grub sees disks mapped differently, and so it will reply with "(hd0,1)". I issue "root (hd0,1)" and then "setup (hd0)" and that's it.

Am I doing something wrong?

Bye
Cris

Try doing it from a LiveCD/LiveUSB and see if you get a different result.

Also it might be the contents of the /boot/grub/device.map that is throwing things awry.

Maybe editing the device.map would correct the problem.


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