Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
There are five partitions on my external drive (sdb) connected by usb. Grub on my internal drive sees them and lists them on the grub menu screen. But if I try to boot one of the systems on them, I get
Code:
hd1 cannot get C/H/S values
you need to load the kernel first
Grub ls returns only the list of partitions on sda, the internal drive and does not see those on sdb.
I've read many many related articles but only found one that directly tells me what to do, but it is thirteen years old:
Quote:
You need to install the bootloader for debian on /dev/hdb. Then after that the entry in your grub.conf on /dev/hda will work properly. Without a bootloader, how will grub hand over the control to the debian kernel ??
So, here are the steps in short:
1. Boot into rescue mode with Cd-1, at boot prompt type-
linux rescue
2. mount your root partition with
chroot /mnt/sysimage
3. Install grub on the boot sector of second hard disk with
/sbin/grub-install /dev/hdb
Next, check if /etc/grub.conf on your disk with fedora (/dev/hda) points to the correct devices and files of your debian disk..and that should do it...
I don't really understand anything but item 3. If I just do item 3 from a live OS, using sdb rather then hdb, will it install the grub to the external drive without destroying my internal grub?
Also, must space be allotted on the external drive for the grub-install? Does it have to be formatted space?
Will my sdb1 partition, which is currently at the beginning of the partition, be overwritten?
Last edited by hilltownboy; 11-20-2016 at 03:24 PM.
Do the five partitions on your external usb all have different operating systems on them?
Is the error you report occurring when you select any or all of them from the boot menu?
If you Debian installed on the internal drive, are you able to mount/access the partitions on the external drive? and is the external drive seen in the BIOS?
The article you mention is in reference to Grub Legacy. If you are using a current Debian or other Linux, you probably do not have Grub Legacy isntalled. If you have different operating systems on the external, what is the primary distribution on the internal? Have you ever been able to boot anything on the external? Have you run grub-mkconfig from your primary Grub boot system? Are these GPT or MBR systems.
You haven't posted much information which would help someone to help you. Either download and run the bootinfoscript or get boot repair from the link below and burn it to a CD and run it but select just the option to Create Bootinfo Summary and do not try any repairs. Post a link to the output here.
Is the external drive formated gpt whereas the internal drive is msdos or vice-a-versa? Sometimes that will cause problems due to missing modules when grub was installed.
yancek, thanks for your reply and interest. Before answering your questions let me mention somrthing in Boot Info Summary that may be critical:
Code:
Windows is installed in the MBR of /dev/sdb.
WindowsXP was originally on my computer HPCompaq 6910p but I ditched it.
Your questions in order:
1. External disk has copies of three operating systems and two storage items, and a lot of empty partitions.
2. The error occurs when selecting any from the boot menu. I should display the error in full:
Code:
no such device: <uuid of the particular device>
hdx cannot get C/H/S values
you need to read the kernel first
3. Any OS on the internal drive or usb flash drive can mount any of the external partitions. The BIOS allows usb flash drive to boot, but with the external disk it shows:
Code:
Non-system disk or disk error
replace and strike any key when ready
upon which the system hangs
4. Every OS is Grub2 (that's why I changed the cited command to sdb), except for PCLinux on the internal drive. (I don't really use PCLinux and it is no longer supported for my 32 architecture.)
The primary internal distribution is Debian8 (jessie).
I once booted sdb1 (a copy of Debian squeeze) from the jessie grub menu, but because the original had been on sda8, it brought up what is now on sda8. So I manually edited the sdb1 grub.cfg to change all references to sda8 and hd0,8 to sdb1 and hd1,1. After that, it would not boot, so using a live usb OS I ran update-grub on sdb1. It now has the references to sdb1 and the same uuid as on its fstab and jessie grub.cfg, but still will not boot.
I have run update-grub which supposedly runs grub-mkconfig.
All systems are MBR.
5. Bootinfoscript is several thousand pages long because of the length of grub.cfg in all the partitions. I doubt that you want all that -- maybe certain parts.
Check the grub.cfg menuentries from your primary system on sda (Debian?) and compare the entries to the output of the blkid command (may need sudo blkid) to see if it is using the correct uuid's for the partitions. Or you could post that info here for members to review.
I understood that you had some Linux (Debian?) installed on the internal drive. The info in your last post only mentions two Debian installs on sdb, is that your external drive? Which systems grub.cfg are posting? Might be best to run boot repair and post a link to the pastebin where the output goes, just use the Create Bootinfo Summary and don't make any changes.
yancek, the above #7 is in direct response to your #6 re check and compare. The first part is the blkid on two partitions with Debian OSs on the sdb, the external drive.
The second part are the sda grub.cfg sections applicable to those two partitions. These are from grub.cfg on Debain8 on the internal drive, which establishes the grub menu which shows all partitions on both drives and will boot those on sda but not those on sdb.
I couldn't find Boot Repair in the Debian repository and am not too keen on installing non-Debian programs.
I couldn't find Boot Repair in the Debian repository and am not too keen on installing non-Debian programs.
Then don't install it on Debian. If you look at the page of the link I posted, it explains that you can download it and burn it to a CD/flash drive which will be bootable and you can use it that way. Your output of the blkid and the grub.cfg file show the correct uuid's so the problem lies elsewhere.
If the external usb drive is /dev/sdb then there should be additional grub2 modules to handle usb storage. The two Linux menu entries for grub on the internal drive should have the lines
insmod usbms
insmod ehci
older setups may use uhci or ohci instead. You could load all three if you don't know which one you need. Basically you need to add grub2 USB mass storage support as well as a module for the USB controller interface.
This appears to be a bug with grub2 mkconfig where it either doesn't realize a drive is on usb and thus add the necessary modules or it expects the usb support to be provided transparently by the motherboard firmware. I have read about a similar bugs on Ubuntu and other dist. where they were getting the exact same error messages
no such device: <uuid of the particular device>
hdx cannot get C/H/S values
you need to read the kernel first
grub can't find the uuid on /dev/sdb on usb drive as the usb support modules haven't been added.
Edit the grub.cfg by hand and add
insmod usbms
insmod ehci
insmod uhci
insmod ohci
It it works you can then remove the two unneeded hci modules through commenting out and testing. It should be mentioned that these problems wouldn't occur if you had an eSATA external drive.
tofino_surfer, many thanks for your advice. I added the insmod ubsms and insmod ehci lines to the grub.cfg section on the internal drive for booting the external sdb4 partition, which is what you suggested if I understand correctly.
Result: nothing at all would boot, with in every case the error message to the effect that (hd0,msdos8) not found. That's the address for the internal Debian8 that has the active grub.cfg. This is what I did:
Code:
menuentry 'Debian GNU/Linux (8.1) (on /dev/sdb4)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-58737a29-7851-4f74-b210-9e03a3a31a75' {
insmod usbms
insmod ehci
insmod part_msdos
insmod ext2
set root='hd1,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos4 --hint-efi=hd1,msdos4 --hint-baremetal=ahci1,msdos4 58737a29-7851-4f74-b210-9e03a3a31a75
else
search --no-floppy --fs-uuid --set=root 58737a29-7851-4f74-b210-9e03a3a31a75
fi
linux /boot/vmlinuz-3.16.0-4-686-pae root=UUID=58737a29-7851-4f74-b210-9e03a3a31a75 ro quiet
initrd /boot/initrd.img-3.16.0-4-686-pae
grub ls did not list any partitions other than hd0,msdos8 not found. I tried the uhci and ohci alternatives and found the same result.
I did check that both usbms and ehci modules are available in my Debian8, although not shown as loaded (lsmod).
Last edited by hilltownboy; 11-25-2016 at 03:57 PM.
>>>Result: nothing at all would boot, with in every case the error message to the effect that (hd0,msdos8) not found. That's the address for the internal Debian8 that has the active grub.cfg.
I have done some more searching and there have been changes between grub 2.00 and 2.02. There is a new command 'nativedisk' that you should use instead of loading the usb modules separately. What is happening currently is that if you load a grub2 usb driver it disables the biosdisk functions and you no longer have access to the SATA drive where (hd0,msdos8) is located. The message below mentions this:
The command nativedisk loads native drivers for many interface types if no arguments are given. However it changes all of the device names so that (hd0,msdos8) becomes (ahci1,msdos8) for a SATA disk. The grub prefix will also be changed. I tried this myself and all of the 'hd' became 'ahci'. I don't have any usb disks attached but they may show up as ehci or uhci.
Use the command nativedisk instead of the two insmod commands. As the names change try the command nativedisk followed by ls in your grub shell before attempting t edit your grub.cfg. Not only will SATA device names change to ahci but your usb drive may be detected as the modules are added by nativedisk. As said they may show up as ehci or uhci. Let me know if this works.
As mentioned, partitions on the external drive had copies, not original installations, of various OS, mostly debian. I just put an original installation of Debian8-1 on the first external partition and updated grub on the internal drive. Lo and behold, not only does the grub menu (internal drive) boot Debian8-1 (external drive), but also now grub ls lists all of the external drive partitions.
However, if the BIOS is set to boot from the external disk the non-system disk error appears and the system is frozen.
I'm marking this as solved even though I don't pretend to understand it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.