Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
Hi there,
I have some trouble with Grub.
I have 3 HD: 1 for Debian, 1 for Xp and 1 for Xp_Game. When Updating grub it recognize all 2 XP (it seems!), but when choosing one of Xp variants it opens only one of them.
In the grub.cfg both Xp installations are seeing with the same UUID, and this is not correct.
Looking deep to find out which are the correct UUID I guess the same result:
In the grub.cfg both Xp installations are seeing with the same UUID, and this is not correct
It isn't necesary to use a UUID in grub.cfg. You can use the device name for the partition on the set root line with a simple chainloader entry. This is because Grub does not read ntfs partitions. I'd be curious to know how this happened other than dd or cloning?
The question is curios: why this command read "LABEL" in sdc1, while in sdb1 read the UUID?
Second question.
looking into windows boot.ini of both Xp installed I have noticed that square brackets from the first row is missing. Here an example:
Code:
boot loader]
timeout=1
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP
Professional" /noexecute=optin /fastdetect
Can anybody tell me if this is a a way that grub use to load ownself?
looking into windows boot.ini of both Xp installed I have noticed that square brackets from the first row is missing. Here an example:
Could you explain specifically what happens when you select the 2nd entry for xp? From your original post, it would appear that you have two menuentries for xp in the Grub menu, is that correct? Also, apparently one boots and the other fails, correct? What exactly happens when you select the second entry which does not boot?
I have an old netbook with xp and booted Linux on that machine and removed the bracket in the boot.ini file on xp and rebooted xp. On selecting xp, I get a message: windows could not boot because the following file is missing or corrupt: system32\\hal.dll. Rebooted Linux and replaced the bracket in the boot.ini file and then rebooted xp successfully. Do you get this message or some other message?
Grub does not 'boot' and windows. Basically what happens is the entry for windows in Grub points to a specific point on the xp (windows) partition where the boot code needs to be and booting is turned over to the windows system. That is basically what chainloading is.
What are the xp entries in the Debian grub.cfg file? Can you post them here.
The question is curios: why this command read "LABEL" in sdc1, while in sdb1 read the UUID?
Second question.
looking into windows boot.ini of both Xp installed I have noticed that square brackets from the first row is missing. Here an example:
Code:
boot loader]
timeout=1
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP
Professional" /noexecute=optin /fastdetect
Can anybody tell me if this is a a way that grub use to load ownself?
Thank
I don't think so. Grub requires the use of the chain loader to load a windows loader that can then load XP. The section you are showing doesn't do that.
Could you explain specifically what happens when you select the 2nd entry for xp? From your original post, it would appear that you have two menuentries for xp in the Grub menu, is that correct? Also, apparently one boots and the other fails, correct? What exactly happens when you select the second entry which does not boot?
Nothing! Just a black screen with a blinking cursor. For that reason I have supposed that the order in the bios was not correct, but nothing.
Code:
I have an old netbook with xp and booted Linux on that machine and removed the bracket in the boot.ini file on xp and rebooted xp. On selecting xp, I get a message: windows could not boot because the following file is missing or corrupt: system32\\hal.dll. Rebooted Linux and replaced the bracket in the boot.ini file and then rebooted xp successfully. Do you get this message or some other message?
I didn't get any bad message, just a black screen
Quote:
What are the xp entries in the Debian grub.cfg file? Can you post them here.
For sure here is what I have:
Code:
menuentry 'Windows NT/2000/XP (su /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-5E70A7E470A7C0DF' {
insmod part_msdos
insmod ntfs
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd1,msdos1' 5E70A7E470A7C0DF
else
search --no-floppy --fs-uuid --set=root 5E70A7E470A7C0DF
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry 'Windows Xp_Game (su /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-5E70A7E470A7C0DF' {
insmod part_msdos
insmod ntfs
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1 5E70A7E470A7C0DF
else
search --no-floppy --fs-uuid --set=root 5E70A7E470A7C0DF
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1
But I have noticed another strange thing: every time I try to digit the command in the console "update-grub" I have different indication on where are stored the 2 XP installations. Like this:
Code:
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Trovata immagine linux: /boot/vmlinuz-4.4.0-1-amd64
Trovata immagine initrd: /boot/initrd.img-4.4.0-1-amd64
Trovato Windows NT/2000/XP su /dev/sda1
Trovato Windows Xp_Game su /dev/sdb1
The menuentries posted from the grub.cfg file not only use the same UUID but have the same set root line; 'hd1,msdos1' which is why it only boots the one instance of xp. Your update-grub output shows one xp on sda1 and the other on sdb1 so only the sdb1 has a menuentry; sdb1 is equal to hd1,msdos1. You don't need everything in that menuentry so change one of the entries to the following and leave the other as is:
Code:
menuentry 'Windows NT/2000/XP (su /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-5E70A7E470A7C0DF' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
chainloader +1
}
The above entry should work if you just change it in the grub.cfg file in a text editor as root (using sudo) and save the change. Do NOT run update-grub but just reboot to test it.
In order for this to work, you will need a correct boot.ini file on both xp installs and the one that appears to be the problem is on sda1. You need to change the file so it points to the correct disk/partition. I'm not sure as I don't really use xp but I expect you would have to change both the line beginning with 'default' as well as the one beginning with 'multi', at least the disk entry. The xp on sdb1 needs the disk indicated as a 1, the partition can remain. The boot.ini on sda1 should have disk as 0 and partition as 1. Grub2 and windows both count physical hard drives from zero and partitions from one. I would also add the beginning bracket to whichever boot.ini file is missing. It might be a good idea to do an online search for proper entries in boot.ini or
check at a windows forum.
Thank you for your suggestion, but due to my frustration I have erased the second partition of Xp: too many problems!
But the facts more embarrassing was grub: everytime I digit "udate-grub" it changes the address of the disks and since I am not an expert I preferred to save what is working in the other 2 disks instead to lose every data.
I am sorry if I have made some trouble.
Finally I realized that grub read the hard drive from "udev" and udev is not very much reliable. I should have to set the "disk-id" while disk-id is unique instead the way as grub use.
The question is curious: why this command read "LABEL" in sdc1, while in sdb1 read the UUID?
It is simply because sdb1 does not appear to have a user defined label. If you count the fields for both you will see that sdc1 has four fields while sdb1 has only three. They both have UUIDs.
As far as I know, grub does not and can not read ntfs.
Really ? From the grub2 documentation
Many more file systems are supported, including but not limited to ext4, HFS+, and NTFS.
A module can register filesystem drivers (eg ext2, reiserfs, befs, ntfs). Note that at least one filesystem driver module is embedded in core.img so the files in directory /boot/grub can be read. Filesystem drivers cannot be auto-loaded; the “insmod” command must be used to explicitly load the necessary modules. The filesystem driver modules for Grub support reading only; Grub does not need to write data back to the filesystem during boot, and skipping write support makes the modules a lot smaller and easier to implement.
Support multiple filesystem types
Support multiple filesystem types transparently, plus a useful explicit blocklist notation. The currently supported filesystem types are ... NTFS (including compression)
Ideally you would need to change the UUIDs to be "unique". Which you would probably have to do under windows, since it's NTFS. Then update your grub and it should work. As long as that doesn't make XP grumpy. Never done that myself since winME was the last version of windows I ever kept actively installed on a system. The winME version broke loadlin (old way of booting linux using the windows boot loader), which was the last straw for me, no more windows.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.