GRUB device numbers/names, use of device.map (Re: migrating Debian GNU/Linux Etch to second SATA drive)
Am 2008-05-10 um 07:01 schrieb Paul Csanyi: [EMAIL PROTECTED] writes: By the way, if you have a floppy drive, you can install GRUB on a floppy too, then you have a GRUB emergency disk which lets you perform operation such as those you described (in the GRUB shell) (for cases of drive failure etc.). -Moritz That shall I to do, or maybe there is an alternative option, say to install GRUB on the USB stick as emergency disk? I haven't done that, but it should also work. Make sure you test if you can actually boot from your USB stick or not because not all machines can boot from USB devices. E.g., I have a computer that should be able to do it according to the manual and all the settings in the BIOS, but after hours of trying I still couldn't get it to work, it's a buggy BIOS. Also, if it works on one of your machines, it may not work on another or computer of a friend who you are trying to help. If you are frequently using the USB stick, you might occasionally format it, erase it etc., so be careful not to destroy your GRUB install on it. Then, I guess, you have to be careful with the GRUB drive numbers (hd0, ...) when you use the USB stick. E.g., depending on whether or not the USB stick is plugegd in or possibly even which controller it is plugged into, the numbers of all drives may be different. Depending on the BIOS, the USB stick might be considered a floppy drive, so it might be fd1 instead of hd1, for example. So you should be very careful when you try to reinstall GRUB, to ensure you are not (for example) overwriting the MBR on a Windows disk. Generally, GRUB uses some sort of *guessing* to assign the drive numbers, so one always has to be careful.[1] (All of the above of course also applies to the case where you use a floppy. But then you will at least usually know that fd0 is your regular floppy drive.) The GRUB shell offers the find command. You can use it to find a certain file you know exists on a particular drive, which will help you find out which device number GRUB uses for that disk. Another tip is to type something like root ( + tab, it will give you a list of possible devices, then complete the name of one device and use tab again, GRUB should then tell you which file system is on that disk which might also help you. Then there is a file named /boot/grub/device.map where one can define which device should have which number, but the use of this file is quite confusing and poorly documented, and it took me many tries to understand. (The GRUB manual and all sorts of search results couldn't help me clearly.) Summary: (1) If GRUB is started from within Debian: * If started with the command grub, the file device.map is ignored. GRUB assigns device names (hd0 etc.) based on *guesses* it makes.[1] * If started with the command grub --device-map=device.map and the file device.map exists, the file device.map is parsed. * If started with the command grub --device-map=device.map and the file device.map does not exist, GRUB *guesses* the device names [1] and stores the result of the guessing in the file device.map. (2) If GRUB is started directly from the BIOS (GRUB shell): * The file device.map is ignored, the device names are derived from GRUB's guessing.[1] Note that (2) is also the situation you have when you boot your system normally. In other words: Making changes to device.map does not influence device numbers actually used by GRUB when booting. (That's why I don't use that file, I personally find no use for it.) -Moritz [1] This guessing can, of course, never be really consistent and leads to all sorts of confusing situations, e.g. different device numbers depending on whether GRUB is started from the BIOS of from within Debian or different numbers after changing cables in the computer. It is one of the fundamental logical flaws in the design of GRUB and one of the reasons GRUB 0.97 is not developed further. (Development effort goes to GRUB 2, currently at version 1.9something, which has been in the works for years and is still not ready for release and is not documented yet, so for most people is not a viable alternative.) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: GRUB device numbers/names, use of device.map (Re: migrating Debian GNU/Linux Etch to second SATA drive)
[EMAIL PROTECTED] writes: Am 2008-05-10 um 07:01 schrieb Paul Csanyi: [EMAIL PROTECTED] writes: By the way, if you have a floppy drive, you can install GRUB on a floppy too, then you have a GRUB emergency disk which lets you perform operation such as those you described (in the GRUB shell) (for cases of drive failure etc.). -Moritz That shall I to do, or maybe there is an alternative option, say to install GRUB on the USB stick as emergency disk? Now, when I have finally installed GRUB on the sda so I can to boot with it the Debian Etch that is on the sdb, I can use Debian Etch Netinstall CD in rescue mode. I run a shall in the rescue mode on the root partition of the Debian Etch system (on the sdb). There I chroot target/ , mount /usr/ and run grub: grub root (hd1,0) grub setup (hd0) grub quit Another tip is to type something like root ( + tab, it will give you all of possible devices, then complete the name of one device and use tab again, GRUB should then tell you which file system is on that disk which might so help you. The tip that you wrote down abowe is helpful. -- Regards, Paul Csanyi http://www.freewebs.com/csanyi-pal/index.htm -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: migrating Debian GNU/Linux Etch to second SATA drive
Kevin Mark [EMAIL PROTECTED] writes: On Thu, May 08, 2008 at 11:12:30PM +0200, Paul Csanyi wrote: Hello! cd / mount -t ext3 /dev/discs/disc1/part1 /mnt # this is the / partition of the sdb mount -t ext3 /dev/discs/disc1/part2 /mnt/usr # this is the /usr partition of the sdb mount -t proc proc /mnt/proc mount -t sysfs sys /mnt/sys mount -o bind /dev /mnt/dev chroot /mnt /bin/bash But, I can't to install grub to boot sdb root from the sda MBR. Any advices will be appreciated! Is the partition mounted rw ? Which partition? nano /etc/mtab ... /dev/sdb1 / ext3 rw,errors=remount-ro 0 0 Did you mean this abowe? This is the: /dev/discs/disc1/part1 mounted as /mnt -- Regards, Paul Csanyi http://www.freewebs.com/csanyi-pal/index.htm -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: migrating Debian GNU/Linux Etch to second SATA drive
NN_il_Confusionario [EMAIL PROTECTED] writes: On Thu, May 08, 2008 at 11:12:30PM +0200, Paul Csanyi wrote: Error: /dev/scsi/host1/bus0/target0/lun0/disc does not have any corresponding BIOS drive. is /etc/mtab correct ? is /boot/grub/device.map (which might be created by grub-install by reading /etc/mtab) correct ? Yes, it is: nano /etc/mtab ... /dev/sdb1 / ext3 rw,error=remount-ro 0 0 have you searched google Linkname: grub error does not have any corresponding BIOS drive\ - Google Search URL: http://www.google.com/search?num=100hl=enie=ISO-8859-1q=grub+error+does+not\ +have+any+corresponding+BIOS+drivebtnG=Search ? I checked /boot/grub/device.map: (hd0) /dev/sda (hd1) /dev/sdb I edited menu.lst: # kopt=root=/dev/sdb1 ro # groot=(hd1,0) I run grub-install with --recheck option. Still I have no success. I boot the Debian Etch system from the sda, and check the /boot/grub/ directory of the Debian Etch system from the sdb. There I find strange situation. The /boot/grub/ directory contain another /boot directory with grub/. I removed this second boot/grub/ directory. This must be the case because when I tried to run grub-install I tried also to reinstall grub with aptitude reinstall grub.. I shall reboot to see how it works the grub-install now. -- Regards, Paul Csanyi http://www.freewebs.com/csanyi-pal/index.htm -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: migrating Debian GNU/Linux Etch to second SATA drive
Paul Csanyi [EMAIL PROTECTED] writes: NN_il_Confusionario [EMAIL PROTECTED] writes: On Thu, May 08, 2008 at 11:12:30PM +0200, Paul Csanyi wrote: Error: /dev/scsi/host1/bus0/target0/lun0/disc does not have any corresponding BIOS drive. is /etc/mtab correct ? is /boot/grub/device.map (which might be created by grub-install by reading /etc/mtab) correct ? Yes, it is: nano /etc/mtab ... /dev/sdb1 / ext3 rw,error=remount-ro 0 0 have you searched google Linkname: grub error does not have any corresponding BIOS drive\ - Google Search URL: http://www.google.com/search?num=100hl=enie=ISO-8859-1q=grub+error+does+not\ +have+any+corresponding+BIOS+drivebtnG=Search ? I checked /boot/grub/device.map: (hd0) /dev/sda (hd1) /dev/sdb I edited menu.lst: # kopt=root=/dev/sdb1 ro # groot=(hd1,0) I run grub-install with --recheck option. Still I have no success. I boot the Debian Etch system from the sda, and check the /boot/grub/ directory of the Debian Etch system from the sdb. There I find strange situation. The /boot/grub/ directory contain another /boot directory with grub/. I removed this second boot/grub/ directory. This must be the case because when I tried to run grub-install I tried also to reinstall grub with aptitude reinstall grub.. I shall reboot to see how it works the grub-install now. No success. :( -- Regards, Paul Csanyi http://www.freewebs.com/csanyi-pal/index.htm -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: migrating Debian GNU/Linux Etch to second SATA drive
Paul Csanyi [EMAIL PROTECTED] writes: Paul Csanyi [EMAIL PROTECTED] writes: NN_il_Confusionario [EMAIL PROTECTED] writes: On Thu, May 08, 2008 at 11:12:30PM +0200, Paul Csanyi wrote: Error: /dev/scsi/host1/bus0/target0/lun0/disc does not have any corresponding BIOS drive. is /etc/mtab correct ? is /boot/grub/device.map (which might be created by grub-install by reading /etc/mtab) correct ? Yes, it is: nano /etc/mtab ... /dev/sdb1 / ext3 rw,error=remount-ro 0 0 have you searched google Linkname: grub error does not have any corresponding BIOS drive\ - Google Search URL: http://www.google.com/search?num=100hl=enie=ISO-8859-1q=grub+error+does+not\ +have+any+corresponding+BIOS+drivebtnG=Search ? I checked /boot/grub/device.map: (hd0) /dev/sda (hd1) /dev/sdb I edited menu.lst: # kopt=root=/dev/sdb1 ro # groot=(hd1,0) I run grub-install with --recheck option. Still I have no success. I boot the Debian Etch system from the sda, and check the /boot/grub/ directory of the Debian Etch system from the sdb. There I find strange situation. The /boot/grub/ directory contain another /boot directory with grub/. I removed this second boot/grub/ directory. This must be the case because when I tried to run grub-install I tried also to reinstall grub with aptitude reinstall grub.. I shall reboot to see how it works the grub-install now. No success. :( At last I have success! :D I don't use grub-install command but run grub on the command line, and: grub root (hd1,0) grub setup (hd0) grub quit Success!! -- Regards, Paul Csanyi http://www.freewebs.com/csanyi-pal/index.htm -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: migrating Debian GNU/Linux Etch to second SATA drive
I am not sure if I understood you correctly, so please correct me if I am wrong, but I assume: * you have basically moved all needed partitions for a full Debian system from one disk to another, * and now you want to install GRUB to this second disk so that GRUB can boot from that disk (and you can eventually remove the old disk from the system). Can you still (temporarily) boot from your first disk where GRUB is still installed? You don't need to be able to boot Debian from the old disk, you just need a working GRUB install there. Does GRUB display a menu when you boot from your old disk? Then you can use the GRUB shell, and within the GRUB shell you can run several commands to install GRUB to the second, new hard disk. You get to the GRUB shell by pressing the c key when GRUB displays the menu. (Maybe you have to press Esc first, I am not sure and can't try it now.) Let me know if this would work for you, then I could tell you more about which commands to run in the GRUB shell. Am 2008-05-08 um 23:12 schrieb Paul Csanyi: Hello! I tried to migrating from the first to second SATA drive My Debian Etch OS with Gparted. I copied the /, /usr, /var, swap, /tmp, /home partitions of the system to the second SATA: sdb with Gparted. Then I tried to set up grub to boot this Debian system from the first SATA drive sda, and did the following: - boot the install CD of the Etch Netinstall - at prompt use expert - ... - detecting disks - did not disk partition - run a shell Here I follow the mini howto: http://wiki.archlinux.org/index.php/Reinstalling_GRUB cd / mount -t ext3 /dev/discs/disc1/part1 /mnt # this is the / partition of the sdb mount -t ext3 /dev/discs/disc1/part2 /mnt/usr # this is the /usr partition of the sdb mount -t proc proc /mnt/proc mount -t sysfs sys /mnt/sys mount -o bind /dev /mnt/dev chroot /mnt /bin/bash grub-install /dev/sda Error: /dev/scsi/host1/bus0/target0/lun0/disc does not have any corresponding BIOS drive. I can't here as root to use nano because of the bterm error. I did the following to get some editor, namely mcedit: TERM=xterm export TERM mcedit /etc/fstab I can to use here mcedit, but with difficulties. Still can to edit fstab, however. But, I can't to install grub to boot sdb root from the sda MBR. Any advices will be appreciated! -- Regards, Paul Csanyi http://www.freewebs.com/csanyi-pal/index.htm -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: migrating Debian GNU/Linux Etch to second SATA drive
Am 2008-05-09 um 22:13 schrieb Paul Csanyi: At last I have success! :D I don't use grub-install command but run grub on the command line, and: grub root (hd1,0) grub setup (hd0) grub quit OK, I hadn't seen this last message from you when I wrote mine, but I see that you have had success with exactly what I was going to suggest to you. I am just wondering if you are aware that you still need your first disk installed to boot the second. So far, GRUB is not installed on the second disk, so if your first disk breaks, you will not (easily) be able to boot from the second disk. I am not sure about what you are doing with those two disks, but maybe it is wise to install GRUB also to the second disk, in case you remove the first one at some point. (Or you could directly boot from the second disk.) By the way, if you have a floppy drive, you can install GRUB on a floppy, too, then you have a GRUB emergency disk which lets you perform operation such as those you described (in the GRUB shell) (for cases of drive failure etc.). -Moritz -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: migrating Debian GNU/Linux Etch to second SATA drive
[EMAIL PROTECTED] writes: I am not sure if I understood you correctly, so please correct me if I am wrong, but I assume: * you have basically moved all needed partitions for a full Debian system from one disk to another, That is correct. I copied all Debian partition from sda to sdb with Gparted live CD. * and now you want to install GRUB to this second disk so that GRUB can boot from that disk (and you can eventually remove the old disk from the system). No. I want to keep sda for the Windows XP. I want to install Grub on this sda so I can to boot with it the Debian on the sdb. -- Regards, Paul Csanyi http://www.freewebs.com/csanyi-pal/index.htm -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: migrating Debian GNU/Linux Etch to second SATA drive
[EMAIL PROTECTED] writes: By the way, if you have a floppy drive, you can install GRUB on a floppy too, then you have a GRUB emergency disk which lets you perform operation such as those you described (in the GRUB shell) (for cases of drive failure etc.). -Moritz That shall I to do, or maybe there is an alternative option, say to install GRUB on the USB stick as emergency disk? -- Regards, Paul Csanyi http://www.freewebs.com/csanyi-pal/index.htm -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
migrating Debian GNU/Linux Etch to second SATA drive
Hello! I tried to migrating from the first to second SATA drive My Debian Etch OS with Gparted. I copied the /, /usr, /var, swap, /tmp, /home partitions of the system to the second SATA: sdb with Gparted. Then I tried to set up grub to boot this Debian system from the first SATA drive sda, and did the following: - boot the install CD of the Etch Netinstall - at prompt use expert - ... - detecting disks - did not disk partition - run a shell Here I follow the mini howto: http://wiki.archlinux.org/index.php/Reinstalling_GRUB cd / mount -t ext3 /dev/discs/disc1/part1 /mnt # this is the / partition of the sdb mount -t ext3 /dev/discs/disc1/part2 /mnt/usr # this is the /usr partition of the sdb mount -t proc proc /mnt/proc mount -t sysfs sys /mnt/sys mount -o bind /dev /mnt/dev chroot /mnt /bin/bash grub-install /dev/sda Error: /dev/scsi/host1/bus0/target0/lun0/disc does not have any corresponding BIOS drive. I can't here as root to use nano because of the bterm error. I did the following to get some editor, namely mcedit: TERM=xterm export TERM mcedit /etc/fstab I can to use here mcedit, but with difficulties. Still can to edit fstab, however. But, I can't to install grub to boot sdb root from the sda MBR. Any advices will be appreciated! -- Regards, Paul Csanyi http://www.freewebs.com/csanyi-pal/index.htm -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: migrating Debian GNU/Linux Etch to second SATA drive
On Thu, May 08, 2008 at 11:12:30PM +0200, Paul Csanyi wrote: Hello! cd / mount -t ext3 /dev/discs/disc1/part1 /mnt # this is the / partition of the sdb mount -t ext3 /dev/discs/disc1/part2 /mnt/usr # this is the /usr partition of the sdb mount -t proc proc /mnt/proc mount -t sysfs sys /mnt/sys mount -o bind /dev /mnt/dev chroot /mnt /bin/bash But, I can't to install grub to boot sdb root from the sda MBR. Any advices will be appreciated! Is the partition mounted rw ? -K -- | .''`. == Debian GNU/Linux == | my web site: | | : :' : The Universal |mysite.verizon.net/kevin.mark/| | `. `' Operating System| go to counter.li.org and | | `-http://www.debian.org/ |be counted! #238656 | | my keyserver: subkeys.pgp.net | my NPO: cfsg.org | |join the new debian-community.org to help Debian! | |___ Unless I ask to be CCd, assume I am subscribed ___| -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: migrating Debian GNU/Linux Etch to second SATA drive
On Thu, May 08, 2008 at 11:12:30PM +0200, Paul Csanyi wrote: Error: /dev/scsi/host1/bus0/target0/lun0/disc does not have any corresponding BIOS drive. is /etc/mtab correct ? is /boot/grub/device.map (which might be created by grub-install by reading /etc/mtab) correct ? have you searched google Linkname: grub error does not have any corresponding BIOS drive - Google Search URL: http://www.google.com/search?num=100hl=enie=ISO-8859-1q=grub+error+does+not+have+any+corresponding+BIOS+drivebtnG=Search ? -- Chi usa software non libero avvelena anche te. Digli di smettere. Informatica=arsenico: minime dosi in rari casi patologici, altrimenti letale. Informatica=bomba: intelligente solo per gli stupidi che ci credono. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]