Multi-booting from internal HD and USB HD issue Salix LILO and Fedora Grub
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.
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Rep:
Multi-booting from internal HD and USB HD issue Salix LILO and Fedora Grub
Hi,
I've got a small issue in which I have no idea (although many theories) on how to work it out.....
Basically what concerns me the most is that I'm trying to recover the build of my old now fried laptop which ran Fedora 15 64bit.
I am currently running Salix 64bit on my new system which shouldn't be a problem apart from the fact that it uses LILO as boot manager and I've never worked with it before.
This is what I have:
Internal drive /dev/sda running Salix: boot and root on /dev/sda1
USB hard drive from old laptop: /dev/sdb1 for boot and root
How can I boot the USB HD???
When I run directly from the BIOS I get this error:
dracut Warning no root device "boot:/dev/UUID/UUID=..." found
The crazy thing is that in /etc/fstab I still have the UUID of the device which is exactly the same as the 'real' UUID of the device.
I just wonder if I would need to re-install grub on that disks MBR?
But then what's the best way to do that? - USB boot of Fedora 15 64bit?
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
Ok my solution was to install GRUB2 (version 1.99).
However there are some obsticals I'm facing....
I copied the old /etc/grub.conf file over from my USB Fedora build and edited the disks to match up with the current 'disk-state' which doesn't work
Even using hd(1,0) as the root drive for each Fedora option isn't working.
Currently I don't even have a nice grub menu as for whatever reason - have tried /boot/grub/grub.conf and /etc/grub.conf - it doesn't come up.
Will need to re-run:
Code:
grub-mkconfig
In the mean time I can crudely access my system via:
Code:
linux /boot/vmlinuz root=/dev/sda1
boot
The internal HD works fine and Salix comes up
Now my only issue is how the friggin-heck do I get F15 back booting?
I tried the same command using root=/dev/sdb1 which I get the error of
'no such disk'
?????
The disk is attached and shows as so in the bios! Even booting into the Salix OS instance I can get /dev/sdb1 mounted to whever I wish - usually /sdb
Actually like Ubuntu has grub-update or the otherway round; if there was a command like that, that would be the best but manually it seems I am struggling to boot my USB drive
It's USB 3.0 too in a version 3 port on my notebook so all matches too.....
Ok back to more research and playing around to fix the error.
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
Here's another little update -
I ran:
Code:
grub-mkconfig > /boot/grub/grub.cfg
grub-setup
This gave me grub with a menu and 2 boot lines for the Salix install; one full boot and one Single user mode
I then added the lines:
Code:
menuentry 'Fedora 15' --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext4
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root /dev/sdb1
echo 'Loading Fedora ...'
linux /boot/vmlinuz-2.6.41.4-1.fc15.x86_64 root=/dev/sdb1 ro
initrd /boot/initramfs-2.6.41.4-1.fc15.x86_64.img
}
but the system claims 'no disk' hd(1,0). The kernel needs to be mounted before....
I am quickly going to try to copy the F15 kernel over to Salix /boot dir under a sub-dir called fedora then attempt to piggy-back off that by setting the root to /dev/sdb1 once the kernel has loaded.
I think the issue is due to the disk being a USB drive and either/or-not my bios firmware. (although should be able to handle it as is a Lenovo X220)
1. You said you installed GRUB 1.99. Was it installed in Salix or the USB drive?
2. What does this command return:
Code:
which os-prober
os-prober is responsible for detecting other Linux OSes on the system. No os-prober, no other Linux OSes in the menu. Not all distros install os-prober as part of the installation, especially if there consider GRUB2 still in development.
3. What is the content of /boot/grub(2)/device.map? It should be similar to:
(hd0) /dev/sda
(hd1) /dev/sdb
4. The USB drive is a USB device, the usb.mod (and possibly the usbms.mod) modules must be loaded first.
5. What filesystem is on the USB drive, ext2,3,4 etc?
5. Try this. From the GRYB menu, drop to GRUB's command line and enter the following commands:
Code:
insmod part_msdos
insmod usb
insmod usbms
insmod ext2
insmod gzio
set root='(hd1,msdos1)'
Now if GRUB recognizes the root of the USB drive, the command:
Code:
ls /boot
will return the contents of /boot.
If it does, then do:
Code:
linux /vmlinuz-2.6.41.4-1.fc15.x86_64 root=/dev/sdb1 ro 1
initrd /initramfs-2.6.41.4-1.fc15.x86_64
boot
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
Thanks for the response
Quote:
1. You said you installed GRUB 1.99. Was it installed in Salix or the USB drive?
Both!
Quote:
2. What does this command return:
Code:
which os-prober
os-prober is responsible for detecting other Linux OSes on the system. No os-prober, no other Linux OSes in the menu. Not all distros install os-prober as part of the installation, especially if there consider GRUB2 still in development.
Wasn't installed so I slapt-get'd it
Took one extra step here: grub-mkconfig > /boot/grub/grub.cfg
Quote:
3. What is the content of /boot/grub(2)/device.map? It should be similar to:
(hd0) /dev/sda
(hd1) /dev/sdb
4. The USB drive is a USB device, the usb.mod (and possibly the usbms.mod) modules must be loaded first.
Let's see...
Code:
menuentry "GNU/Linux, with Linux 2.6.37.6 (on /dev/sdb1)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 3aad331a-3289-4406-a971-e9eda6768bdd
linux /boot/vmlinuz-2.6.41.4-1.fc15.x86_64 root=/dev/sdb1 ro
initrd /boot/initramfs-2.6.41.4-1.fc15.x86_64.img
}
Hmm.... not good! Even fs type is wrong as had ext4 on Fedora (USB drive)
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
Quote:
5. What filesystem is on the USB drive, ext2,3,4 etc?
Ext4
Quote:
5. Try this. From the GRYB menu, drop to GRUB's command line and enter the following commands:
Added:
Code:
menuentry "GNU/Linux, with Linux 2.6.37.6 (on /dev/sdb1)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod usb
insmod usbms
insmod ext4
insmod gzio
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 3aad331a-3289-4406-a971-e9eda6768bdd
linux /boot/vmlinuz-2.6.41.4-1.fc15.x86_64 root=/dev/sdb1 ro
initrd /boot/initramfs-2.6.41.4-1.fc15.x86_64.img
}
Quote:
Now if GRUB recognizes the root of the USB drive, the command:
You mean once the kernel of Fedora has loaded?
as ls /boot gives me the boot dir within my root filesystem....
The above modules I added rendered this message on Grub:
Quote:
file not found
error no such device
hd1 cannot get C/H/S values
you need to load the kernel first
OK, please follow the command exactly. Even though you have ext4 filesystem on the USB drive, you must load the ext2 module, there IS NO ext4 module in GRUB. The command 'insmod' tells GRUB to load the specified GRUB module. These are the .mod files in /boot/grub. When you get GRUB's menu, press 'c' to go to the GRUB command line. Your prompt will change to:
Code:
grub>
From there do (EXACTLY):
Code:
insmod part_msdos
insmod usb
insmod usbms
insmod ext2
insmod gzio
set root='(hd1,msdos1)'
You may already have some the modules loaded, but reloading them would not cause any problems. I have included them because I don't know which GRUB modules you have loaded.
Now, if GRUB recognizes,the root of the USB drive, the command:
Code:
ls /boot/
will give you a list of the files in the /boot directory of the USB drive.
Do you see a file listing?
ONLY if you see a file listing will the following commands work:
Code:
linux /vmlinuz-2.6.41.4-1.fc15.x86_64 root=/dev/sdb1 ro 1
initrd /initramfs-2.6.41.4-1.fc15.x86_64
boot
If you are still able to boot from lilo do the following to add fedora to the lilo boot menu.
1. mount the fedora partition at /mnt
2. edit the /etc/lilo.conf in salix and add the following.
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
Quote:
Now, if GRUB recognizes,the root of the USB drive, the command:
Code:
ls /boot/
will give you a list of the files in the /boot directory of the USB drive.
Do you see a file listing?
No listing! - Error: hd1 cannot get C/H/S values
Quote:
If you are still able to boot from lilo do the following to add fedora to the lilo boot menu.
1. mount the fedora partition at /mnt
2. edit the /etc/lilo.conf in salix and add the following.
Quote:
# Linux bootable partition config begins
image = /mnt/boot/vmlinuz-2.6.41.4-1.fc15.x86_64
initrd = /mnt/boot/initramfs-2.6.41.4-1.fc15.x86_64.img
root = /dev/sdb1
label = Fedora 15
read-only
# Linux bootable partition config ends
at the prompt run lilo
Quote:
lilo
reboot and cross your fingers
Tried that in the beginning but lilo came up with an error saying that booting th ekernel was going to be over 31 sectors meaning that it would overwrite the filesystem.
That's why I ended up putting Grub on the system in the first place
Have you tried coping the fedora kernel and initrd to /boot of salix and use the following lilo.conf entry
# Linux bootable partition config begins
image = /boot/vmlinuz-2.6.41.4-1.fc15.x86_64
initrd = /boot/initramfs-2.6.41.4-1.fc15.x86_64.img
root = /dev/sda1
label = Fedora 15
append = "root=/dev/sb1"
read-only
# Linux bootable partition config ends
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443
Original Poster
Rep:
Yep tried that too....
Again the problem is that the Fedora Kernel is too large for Lilo. The only answer I got was to patch it from my readings.
I mean what is the C/H/S error anyway? I read about it in the mean time and it seems people running MS based NTFS or similar have those kinds of problems?
Initially, you loaded GRUB onto the USB drive, did it complete?
I had a similar problem when I accidently installed GRUB to my Windows drive and stopped the installation before it completed. I also the C/H/S error. C/H/S - Cylinder/Head/Sector drive geometry. Reported by fdisk from your previous post. If the drive's geometry cannot be read, you cannot boot from it.
Could you try repairing the MBR? I have no idea how it's done.
Another option you may have is to chroot into Fedora from Salix and re-install GRUB/GRUB2 in Fedora, this should also repair the MBR.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.