Motherboard change impacts disk naming, requires grub reconfiguration?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Motherboard change impacts disk naming, requires grub reconfiguration?
Had my prior Soyo MBD stop appreciating my two SATA drives, decided to snub them. Would see IDE fine, etc. just not the SATA drives. BIOS changes, Knoppix browsing, nothing worked. So enter new MBD.
Now that the new Gigabyte board is installed, can see the drives again (verified under Knoppix). However, what was previously /dev/hde and /dev/hdf under the Soyo is now reported as /dev/sda and /dev/sdb under the Gigabyte.
As a result, I can't boot any of the multiple OS installed. Would love to simply maintain my installs without having to start over. I have tried some edits to /etc/fstab and grub-related files as detailed below but still not having success. Grub menu comes up and starts the boot process on all the OS but they all crap out at some point during the boot sequence; FC5 gets the furthest along but then ends in a kernel panic after complaining about not finding root partition, etc.
I've tried googling and looking at the Gnu Grub site but am not able to figure this out so far. Would appreciate any pointers on what to do at this point to recover operation of the system without reinstallation of the OS (FC5 at least, I'm moving off of Win98 so I can just recover my data files from there and I'll be fine).
Code:
fdisk -l
Disk /dev/sda: 120.0 GB, 120059362816 bytes
255 heads, 63 sectors/track, 14596 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 1306 10490413+ c W95 FAT32 (LBA)
/dev/sda2 * 1307 2613 10493280 bf Solaris
/dev/sda3 2614 3918 10482412+ 83 Linux
/dev/sda4 3919 14596 85771035 5 Extended
/dev/sda5 3919 5223 10482381 83 Linux
/dev/sda6 5224 5745 4192933+ 82 Linux swap / Solaris
/dev/sda7 5746 14596 71095626 b W95 FAT32
Disk /dev/sdb: 120.0 GB, 120060444672 bytes
255 heads, 63 sectors/track, 14596 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 2550 20482843+ c W95 FAT32 (LBA)
/dev/sdb2 2551 14595 96751462+ f W95 Ext'd (LBA)
/dev/sdb5 2551 12111 76798701 c W95 FAT32 (LBA)
/dev/sdb6 12112 14595 19952698+ e W95 FAT16 (LBA)
root@0[knoppix]#
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,2)
# kernel /boot/vmlinuz-version ro root=/dev/hde3
# initrd /boot/initrd-version.img
#boot=/dev/hde
default=0
timeout=5
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
#hiddenmenu
password --md5 $1$CZnMoE2p$TZQ2dKOkAV.rUQQzqBTKe0
title Fedora Core (2.6.16-1.2111_FC5.stk16)
root (hd0,2)
kernel /boot/vmlinuz-2.6.16-1.2111_FC5.stk16 ro root=LABEL=/
initrd /boot/initrd-2.6.16-1.2111_FC5.stk16.img
title Fedora Core (2.6.16-1.2080_FC5)
root (hd0,2)
kernel /boot/vmlinuz-2.6.16-1.2080_FC5 ro root=LABEL=/
initrd /boot/initrd-2.6.16-1.2080_FC5.img
title Fedora Core (2.6.15-1.2054_FC5)
root (hd0,2)
kernel /boot/vmlinuz-2.6.15-1.2054_FC5 ro root=LABEL=/
initrd /boot/initrd-2.6.15-1.2054_FC5.img
title Solaris 10 U1
rootnoverify (hd0,1)
chainloader +1
title Windows
rootnoverify (hd0,0)
chainloader +1
title OldWin98
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1
original device.map file
Code:
# this device map was generated by anaconda
(hd0) /dev/hde
latest device.map
Code:
# this device map was generated by anaconda
(hd0) /dev/sda
BTW, here are some selected messages that are on the screen up to the point it hangs when attempting to boot FC5. The resume ones I find interesting... the old MBD showed a couple of flaky boots before it totally gave up on the SATA drives; I wonder whether that caused some resume/recovery files to be created?
lots of standard boot messages, sees and configures new chipset drivers, etc... ending with:
.
.
.
Trying to resume from LABEL=SWAP-hde6 <<NOTE, THIS IS A NEW MESSAGE BUT USES PRIOR DISK NAME NOTATION>>
Unable to access resume device (LABEL=SWAP-hde6)
Creating root device.
Mounting root filesystem.
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file of directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!
[<c011b2b2>] panic+0x3e/0x170 AND SO ON...
Labels are carried with the partition table (not sure this is the correct term, but it is not part of the OS data, but rather part of the partitioning info on the disk). Apparently they are using this notation as a way to *help* in the instance of moving a drive, as the partition labels would not change but the device numbering could. By using labels it should avoid just what I'm running into. OK, that said...
I tried the change to move to disk/partition numbering instead of LABEL= notation (both in grub.conf and fstab), and I am still running into the same issue. I think the problem is really the "Resume" item I noted above. It seems there is something recorded in a file somewhere that has hardcoded the old SWAP-hde6 partition label to be sought and that is being used to point to the (originally right) wrong place, which then can't be found. I tried using QTparted to see the label for the swap partition and it does not show there (while others do).
At this point, I believe I'm just going to punt and go for the reinstall as the above if it worked would only have fixed things for FC5 anyway. The things I had previously put most of my work into were stored in /home so I'll get to retain that and the install otherwise will go predictably.
Distribution: Fedora, mostly. Testing SUSE, Testing eee pc
Posts: 9
Rep:
I've solved it.
I copied a Fedora 5 system from one machine to a new one using a tar archive of / and made it work. While doing this, I solved your problems.
Your boot problem is because the partition label didn't match the source system, my experience tells me. You COULD change grub AND /etc/fstab and I've made that work before, but just using the expected labels is much easier. Here's the whole of what I did and how I overcame your problem.
I used the F5 rescue cd to boot the new machine and then fdisk to partition the drive into 9GB data and 512MB swap. Two primary partitions, the same as on the source system (both smaller, different device, no third 400GB "samba" partition, but matching closely enough).
I then used "mkfs -t ext3 /dev/hda1" and "mkswap -L SWAP-hda2 /dev/hda2" to format the partitions. That also labelled swap properly. To put the proper label on the ext3 partition, I used "e2label /dev/hda1 /1"
Tar produced with:
tar --absolute-names --preserve-permissions \
--exclude '/proc/*' --exclude '/dev/*' \
--exclude '/sys/*' --exclude '/var/run/*' \
--exclude /samba \
--exclude '/var/log/*gz' \
-czf /samba/big/fedora5root.tgz /
and restored by:
mkdir /mnt/stuff
mount /dev/hda1 /mnt/stuff
cd /mnt/stuff
ftp (to fetch tar) then
tar -xzf fedora5root.tgz
To build the boot information, I used:
"grub" "root (hd0,0)" "setup (hd0)" "quit"
This didn't all work the first time, of course, and I'm trying to net the procedure. The results are a clone of my first system on different hardware. All of my careful setup, customizing, and updating are now done on another system and I'm ready to change the name and IP address and make it distinct.
fdisk should add support for partition labels, but the work around is easy once known. Maybe I'll contribute some fdisk code...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.