LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't boot with 2 cloned hard drives, where UUIDs are different & GRUB specifies UUID (https://www.linuxquestions.org/questions/linux-newbie-8/cant-boot-with-2-cloned-hard-drives-where-uuids-are-different-and-grub-specifies-uuid-898192/)

ziphem 08-18-2011 10:35 PM

Can't boot with 2 cloned hard drives, where UUIDs are different & GRUB specifies UUID
 
I cloned my hard drive, from my primary hard drive to my secondary 'ultrabay' hard drive. After cloning, I booted from my ultrabay hard drive (the clone), changed the UUIDs of all ext3 partitions (all the partitions that I could change) on that drive, and changed all FSTAB and GRUB specifications from labels to UUIDs (where applicable).

I also booted into the primary drive, changed the FSTAB and GRUB to use UUIDs instead of labels.

So now, each drive has their own UUIDs, and each specifies such in FSTAB and GRUB.

The problem is that, while I can successfully boot each drive *separately*, when I try to boot from the primary hard drive while the ultrabay hard drive is also present, I get the warning: "no root device found, sleeping forever."

I am totally lost about why this is happening. I thought if there'd be a problem, the drive wouldn't boot on its own - but they *are* both booting separately.

I'd immensely appreciate any guidance about what could be causing this, and what steps I could take to fix this!

Thanks a ton!!!

sundialsvcs 08-19-2011 03:17 PM

What motivated you to specify UUIDs?

It sounds to me like GRUB thinks that it has two-or-more drives to boot from. Since it has no provision for choosing between them, it stops.

RockDoctor 08-19-2011 04:39 PM

Can't tell from what was stated in the OP if the boot drive was properly specified. Code below is taken from my grub.conf (aka menu.lst) file; I use grub-legacy:
Code:

title Fedora (2.6.40.3-0.fc15.x86_64)
    root (hd0,4)
    kernel /boot/vmlinuz-2.6.40.3-0.fc15.x86_64 ro root=/dev/sda5  rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us selinux=0

Note the second line - it tells me which hard drive and partition to look on for the rest of the bootloader - in this case 1st hard drive, 5th partition (grub-legacy starts numbering from zero). The UUID doesn't come into play until the kernel line; I used root=/dev/sda5 (and you'd use root=UUID=whatever), specifying the kernel file on /dev/sda5 of hd0.

ziphem 08-19-2011 07:30 PM

Thanks a ton for the replies.

My grub.conf is:

Code:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,4)
#          kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda5
default=0
timeout=5
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.35.13-92.fc14.i686.PAE) via UUID
        root (hd0,4)
        kernel /vmlinuz-2.6.35.13-92.fc14.i686.PAE ro root=UUID=4dd82094-943a-4a2e-aaf6-b7d34a26abf7 rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
        initrd /initramfs-2.6.35.13-92.fc14.i686.PAE.img
title Fedora (2.6.35.13-92.fc14.i686.PAE) (OLD, pre-UUID)
        root (hd0,4)
        kernel /vmlinuz-2.6.35.13-92.fc14.i686.PAE ro root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
        initrd /initramfs-2.6.35.13-92.fc14.i686.PAE.img
title Other
        rootnoverify (hd0,0)
        chainloader +1

So I have the UUID specified in the kernel line. I tried stripping out everything else on that line after root=, but that didn't do the trick either, so I'm utterly confused.

The reason why I wanted different UUIDs was because I wanted to, first, avoid what was happening - the PC was booting from the second drive when I had the first and the second in the computer at the same time - and also to mount both drives.

Any further suggestions?

Thanks a ton.

RockDoctor 08-19-2011 08:36 PM

My thought would be to set up something like the following in grub.conf on the hard drive that actually boots:

Code:

# Fedora 14 on original disk:
title Fedora (2.6.35.13-92.fc14.i686.PAE) via UUID
        root (hd0,4)
        kernel /vmlinuz-2.6.35.13-92.fc14.i686.PAE ro root=UUID=uuid_of_orignal rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
        initrd /initramfs-2.6.35.13-92.fc14.i686.PAE.img

# Fedora 14 on cloned disk:
title Fedora (2.6.35.13-92.fc14.i686.PAE) via UUID
        root (hd0,4)
        kernel /vmlinuz-2.6.35.13-92.fc14.i686.PAE ro root=UUID=uuid_of_clone rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
        initrd /initramfs-2.6.35.13-92.fc14.i686.PAE.img

None of my desktop systems currently have two internal drives, so I can't verify the above. Are you sure the drive you think you're booting from is the drive you're actually booting from? I've encountered situations when I've had two drives in a system where I thought I was booting off one drive but was actually booting off the other.

ziphem 08-25-2011 11:16 AM

I put my computer to hibernate, then made a test. I put in a second, non-Fedora HD in the 2nd drive slot, and 'woke' up the PC. It resumed fine. I then tried that with the cloned Fedora HD, and I got a 'sleep' error. I shut down, and then rebooted my computer - but the computer didn't reboot, but instead resumed from hibernate. So, it's like the PC reads the cloned as the primary drive whenever it's present in the computer. That's so strange. Any further suggestions? I have no idea why this happening / what the issue is behind it, making it happen.

Thanks!

ziphem 08-25-2011 11:36 AM

What if I removed the hash and put into both GRUBs: boot=/dev/sda5 ?

Thanks.

RockDoctor 08-25-2011 02:54 PM

I see an error in what I posted earlier. Why not something like this:
Code:


title Fedora (2.6.35.13-92.fc14.i686.PAE) via dev
        root (hd0,4)
        kernel /vmlinuz-2.6.35.13-92.fc14.i686.PAE ro root=/dev/sda5 rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
        initrd /initramfs-2.6.35.13-92.fc14.i686.PAE.img

# Fedora 14 on cloned disk:
title Fedora (2.6.35.13-92.fc14.i686.PAE) via dev
        root (hd1,4)
        kernel /vmlinuz-2.6.35.13-92.fc14.i686.PAE ro root=/dev/sdb5 rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
        initrd /initramfs-2.6.35.13-92.fc14.i686.PAE.img


ziphem 08-25-2011 09:41 PM

Ok, thanks for the response. Actually doing df shows:

Code:

Filesystem          1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      51606140  10280988  38703712  21% /
tmpfs                  1021772      808  1020964  1% /dev/shm
/dev/sda5              495844    65372    404872  14% /boot
/dev/mapper/VolGroup-lv_home
                    217163740  84166832 121965564  41% /home
/dev/sda3            53797288  17041208  36756080  32% /media/SHARED
/dev/sda2            156753916 133577600  23176316  86% /media/SW_Preload
/dev/sda1              102396    25288    77108  25% /media/System Reserved

So root should be at /dev/mapper/VolGroup-lv_root ; if I do a root=/dev/sda5 would that work?

syg00 08-25-2011 10:38 PM

Quote:

Originally Posted by ziphem (Post 4453251)
So, it's like the PC reads the cloned as the primary drive whenever it's present in the computer. That's so strange.

Not at all. The BIOS makes those determinations, not you. It's certainly consistent with (some of) what you're seeing. Try your test with another disk that has a bootloader in the MBR (of the inserted disk).
I would have thought LABELs would have been a better option - change the backup to say "backup". Makes more sense (to me) to use metrics that mean something to people (i.e. you) than the machine.

ziphem 09-14-2011 01:13 PM

Ok, I think I have some time and the courage to give this a shot, following some of the (very detailed) tutorials. However, I have a seriously basic question - the Fedora rescue CD - what is it? Is it the live DVD, or CD, in which I have the option to boot into rescue mode? Or does it also describe what is basically just the live CD/DVD?

Second, in some of the instructions on changing volume names, it says to edit initrd. However, I've also seen I can rebuild it with mkinitrd. Are there disadvantages of just rebuilding rather than editing? I think if I can get it to work, I'll edit, that way I can be sure I keep everything how it was in initrd how it was before I changed volume names (?) (obviously except for the changed volume names...!).

Thanks a ton!

frieza 09-14-2011 02:05 PM

unless you have done some sort of customization that rebuilding the initrd will undo, i would say it's easier just to rebuild the initrd with mkinitrd as a conservative effort, if that doesn't work, then edit the initrd.

ziphem 09-16-2011 11:09 PM

Ok I'm stumped again. I've been in the rescue mode, and I've renamed the volume group and volume labels. I've also edited fstab to indicate the right group and labels. My problem now is initrd - my /boot is empty, and I'm totally stumped. With an empty /boot (I did chroot /mnt/sysimage), I can't run mkinitrd, or edit the file. I can't seem to find an answer on this anwywhere. I appreciate any help.

Thanks!!!

ziphem 09-18-2011 04:42 PM

I made good progress, but still running into a problem. It's frustrating because I think I'm just a step away (or maybe that's just me telling myself that!).

I re-ghosted the primary to the backup hard drive, so I'd have an up to date copy of my primary hard drive with which to work. I then used the Fedora DVD and booted into rescue mode, as suggested. I was able to change the volume name, but did so only with the /home partition (from lv_home to lv_homeHD2). I also changed the volume group name for all volumes (ffrom VolGroup to VolGroupHD2). I then did mkinitrd initrd.##.##.## ##.##.##, or something to that effect (I should have done mkinitrd initrd and not mkinitrd initramfs I guess). Note I didn't change UUIDs of the backup HD yet, they are identical to the primary hard drive.

The second hard drive, on its own, boots up ok (!!), and I did a df, and saw the volume labels and group were in fact changed. So I'm pretty happy about this, because that's great progress for me.

However, when I boot up both hard drives in the computer (primary hard drive in main slot, backup hard drive in ultrabay), still, I get a warning and the system won't boot. I don't have it in front of me, but the warning is something like 'No root found. Sleeping foreever').

I'd greatly appreciate any suggestions on how you think I might be able to fix this and get me from 'almost there' to 'there.' It also goes without saying that I really appreciate all the feedback thus far, so thank you for that!!

Ps. sorry, for not answering one of the suggestions by RockDoctor! I did try =/dev/sda5 in the grub line, but got an error about the system already being mounted and in use, I believe...unfortunately it didn't work. Thanks for the suggestion though.


All times are GMT -5. The time now is 06:40 PM.