LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   device mapping switch (https://www.linuxquestions.org/questions/linux-newbie-8/device-mapping-switch-649375/)

james2b 06-15-2008 02:57 AM

device mapping switch
 
I had 3 Linux installed and booting on my internal IDE drive with windows XP, all on separate partitions, (PCLinuxOS, Ubuntu, and Mepis) and the grub last installed with Mepis on the MBR. I also have a external eSATA/USB drive now with Fedora 9 installed just fine. I had to do a repair of the MBR just before I installed Fedora, so now I can only boot into XP and the new Fedora 9, and want to add the other Linux's but I have both a changed swap file, (due to some partitioning changes with GParted), and issues with the internal and external drive device order, or mapping. Mepis had the device map file as ; (hdo) /dev/hda , and (hd1) /dev/sda , which are the internal IDE and external hard drives, which seems correct. Now Fedora has this device map file; (hd1) /dev/sda, and (hd0)/dev/sdb, and in the grub it lists Fedora root as (hd0,0), so will a drive map switch fix this issue?
Here is my drives fdisk -ls;

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x826d56f6

Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 208813+ 83 Linux
/dev/sda2 1959 3916 15727635 83 Linux
/dev/sda3 6201 16970 86510025 f W95 Ext'd (LBA)
/dev/sda4 27 1958 15518790 83 Linux
/dev/sda5 14164 16970 22547227+ 7 HPFS/NTFS
/dev/sda6 6201 6722 4192902 82 Linux swap / Solaris
/dev/sda7 6723 8680 15727603+ 83 Linux
/dev/sda8 8681 10638 15727603+ 83 Linux
/dev/sda9 10639 12596 15727603+ 83 Linux
/dev/sda10 12597 14163 12586896 b W95 FAT32

Partition table entries are not in disk order

Disk /dev/sdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x89518951

Device Boot Start End Blocks Id System
/dev/sdb1 * 534 10976 83883397+ 7 HPFS/NTFS
/dev/sdb2 10977 13587 20972857+ 83 Linux
/dev/sdb3 13588 24321 86220855 f W95 Ext'd (LBA)
/dev/sdb5 13588 15545 15727603+ 83 Linux
/dev/sdb6 15546 17503 15727603+ 83 Linux
/dev/sdb7 17504 18064 4506201 82 Linux swap / Solaris
[root@localhost ~]#

stefan_nicolau 06-15-2008 09:13 PM

Can you please describe what is not working properly?

The device map is (I think, correct me if I'm wrong) more or less a convenience feature to allow you (for example) to use 'grub-install /dev/sda'. It should not change the behaviour of grub.

Please also identify (in Fedora) which of sda or sdb is your internal drive. With libata, both ide and sata disks now share the /dev/sdX namespace. Also, different distributions may load kernel modules in a different order, thus changing the name-device mapping.

james2b 06-15-2008 11:17 PM

The internal IDE hard drive is, Disk /dev/sdb: 200.0 GB, and I can boot the windows XP fine since no grub in on that drive. And then to boot the external USB/SATA drive by the grub for Fedora, I just hit the F10 key early in the POST to select the boot first device as the external drive, which is; Disk /dev/sda: 250.0 GB.The 3 Linux's installed on the internal drive are not yet booting, but were booting with grub from Mepis on the MBR of that internal drive. But since some major repair of the mbr and the partition table, and some partition changes using the GParted tool, such as; (delete, re-size, etc),the swap file has changed partition number for the internal drive, and first hard drive has switched too.

james2b 06-16-2008 06:46 PM

I found where to change the swap file, (etc/fstab file), and now need to know for device map change. Do I change both the device.map file, and the grub boot menu.lst file too, (since the internal and external hard drives are switched in Fedora 9 device map file, as compared to how it was when I had all the Linux distro's booting originally). The newer Linux versions will see both IDE and a SATA drive as sda, and sdb, where-as some older versions see the internal IDE as hda, and the external USB/SATA as sda.

stefan_nicolau 06-17-2008 06:07 PM

If what you are trying to do is to add Windows to the grub menu, there is no need to edit device.map . If the system boots from the external disk, that one should be hd0. Just edit menu.lst :
Code:

title Windows XP
root (hd1,0)
makeactive
chainloader +1



All times are GMT -5. The time now is 01:32 AM.