Author Topic: do fdisk and devicemap indicate same devices?  (Read 326 times)

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2436
  • Any Bugs in site?
do fdisk and devicemap indicate same devices?
« on: May 13, 2011, 03:20:15 AM »
Plodding around cleaning out a suspect drive (not sure what it is suspect of  ;D)

I have cleared almost every partition and previous indication was that all was well, could again save archive files from Opera to USB stick.

A second problem was the prevention of LiveCD full install, full stop.  Now The install seemed to go ok but GRUB seems to have taken a knock.  Producing an error 22.

Code: [Select]
[root@localhost gert]# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8a208a20

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    71682029    35840983+   7  HPFS/NTFS
/dev/sda2        71682030   130287149    29302560   83  Linux
/dev/sda3       130287150   188892269    29302560   83  Linux
/dev/sda4       188892270  1953520064   882313897+   5  Extended
/dev/sda5       188892333  1212891434   511999551    7  HPFS/NTFS
/dev/sda6      1212891498  1221068519     4088511   82  Linux swap / Solaris
/dev/sda7      1221068583  1245631904    12281661   83  Linux
/dev/sda8      1245631968  1294453439    24410736   83  Linux
/dev/sda9      1294453503  1333523519    19535008+  83  Linux
/dev/sda10     1333523583  1382345054    24410736   83  Linux
/dev/sda11     1382345118  1421399069    19526976   83  Linux
/dev/sda12     1421401118  1463344157    20971520   83  Linux
/dev/sda13     1463346206  1495217744    15935769+  83  Linux
/dev/sda14     1495217808  1540440719    22611456   83  Linux

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 62 sectors/track, 123562 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x965c8f52

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    62926603    31462278   83  Linux
/dev/sdb2        62926604   146818033    41945715   83  Linux
/dev/sdb3       146818034   251674288    52428127+  83  Linux
/dev/sdb4       251676290  1953515219   850919465    5  Extended
/dev/sdb5       251676337   304126513    26225088+  83  Linux
/dev/sdb6       304128562   360771703    28321571   83  Linux
/dev/sdb7       360773752   421609858    30418053+  83  Linux
/dev/sdb8       421611907   486640978    32514536   83  Linux
/dev/sdb9       486643027   507614546    10485760   83  Linux
/dev/sdb10      507616595   528588114    10485760   83  Linux
/dev/sdb11      528590163   553755986    12582912   83  Linux
/dev/sdb12      553758035   577195534    11718750   83  Linux
/dev/sdb13      577197583   602363406    12582912   83  Linux
/dev/sdb14      602365455   627531278    12582912   83  Linux
/dev/sdb15      627533327   658990606    15728640   83  Linux
/dev/sdb16      658992655   690449934    15728640   83  Linux
/dev/sdb17      690451983   721909262    15728640   83  Linux
/dev/sdb18      721911311   763854350    20971520   83  Linux

Disk /dev/sdc: 2002 MB, 2002747392 bytes
32 heads, 63 sectors/track, 1940 cylinders, total 3911616 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4c672daa

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63     3911039     1955488+   6  FAT16
[root@localhost gert]#

Code: [Select]
[root@localhost gert]# cat /boot/grub/de
device.map         device.map.backup  device.map.old    
[root@localhost gert]# cat /boot/grub/device.map
(hd0) /dev/sda

I am runnig a LiveCD to get above information, and from an older forum thread I got the idea that the devicemap would reflect the drives that fdisk -l sees.

The link was:   http://www.pclinuxos.com/forum/index.php/topic,66169.msg537782.html#msg537782
My question is, should device.map not contain something like this:

Quote
(hd0) /dev/sda
(hd2) /dev/sdb                  
(hd3) /dev/sdc

Ah, yes at the moment only /dev/sdb10 hold data taken from all the other partitions before reformatting them with mke2fs -t ext4 _L DELTA-xx  /dev/sdbxx

Later /dev/sdb1 was reformatted to ext3 for test of installing LiveHDD here, it was the failure of this to happen that drew my attention to a problem.

Then I tried the LiveCD full install to /dev/sdb2, which seemed ok but for GRUB up the pole looking for drives I guess  ;D

Any advice welcome

Edit:  Occurred to me to look int the older device.maps

Quote
[gert@localhost gert]$ cat /boot/grub/dev
device.map         device.map.backup  device.map.old    
[gert@localhost gert]$ cat /boot/grub/device.map.backup
(hd0) /dev/sda
(hd1) /dev/sdb
[gert@localhost gert]$ cat /boot/grub/device.map.old
(hd0) /dev/sda
(hd1) /dev/sdb
[gert@localhost gert]$


Assuming it makes no difference if I am 'looking' using LiveCD I guess I have answered my own question.  So now What?

Edit:

Well since I got GRUB error 22 when /dev/sdb removed I re-install grub (which I thought I had already done when /dev/sdb was connected)

Quote
   GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub> root (hd0,2)    <---- /dev/sda3  
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd
 Possible disks are:  hd0 hd1

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  17 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,2)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.

grub>


Quote
[gert@localhost ~]$ cat /boot/grub/device.map
(hd0) /dev/sda
(hd1) /dev/sdb
(hd2) /dev/sdc
[gert@localhost ~]$



It worked my system is up and running again, and also when I reconnect /dev/sdb

Last step to check can I make a stanza that will boot the system on /dev/sdb2

Quote
title LiveCD-Full-Install on /dev/sdb2
kernel (hd1,1)/boot/vmlinuz BOOT_IMAGE=linux root=LABEL=DELTA-02  resume=LABEL=swap4000 splash=silent vga=788
initrd (hd1,1)/boot/initrd.img


When trying to run, I get

Error 22: No such partition

Yet

Quote
   GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub> find /boot/grub/stage2
 (hd0,1)
 (hd0,2)
 (hd0,6)
 (hd0,7)
 (hd0,8)
 (hd0,9)
 (hd0,10)
 (hd0,11)
 (hd0,12)
 (hd1,1)

grub>


???


« Last Edit: May 15, 2011, 07:26:15 PM by wedgetail »
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2436
  • Any Bugs in site?
Re: do fdisk and devicemap indicate same devices?
« Reply #1 on: May 15, 2011, 07:17:17 AM »
Since booting off a LiveCD takes some time on my machines I downloaded Super Group CD, a 4 MB approximately and burnt it to a CD RW and then booted.

This seemed to indicate that GRUB sees the install on /dev/sdb ie as (hd1,2) when the USB stick is plugged in and as (hd1,1) when USB stick is removed. ???

I can boot the LiveCD full install by removing the USB stick but that was not really the idea as I normally leave the USB stick in place.  Seems like there is still something odd about the /dev/sdb.
« Last Edit: May 15, 2011, 07:21:09 AM by wedgetail »
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11581
  • ----IOFLU----
Re: do fdisk and devicemap indicate same devices?
« Reply #2 on: May 15, 2011, 08:08:43 AM »
Since booting off a LiveCD takes some time on my machines I downloaded Super Group CD, a 4 MB approximately and burnt it to a CD RW and then booted.

This seemed to indicate that GRUB sees the install on /dev/sdb ie as (hd1,2) when the USB stick is plugged in and as (hd1,1) when USB stick is removed. ???

I can boot the LiveCD full install by removing the USB stick but that was not really the idea as I normally leave the USB stick in place.  Seems like there is still something odd about the /dev/sdb.

Possibly you meant (hd2,1), as grub will see drive transpositions caused by removable drives, but not partition transpositions.

Copy the present menu.lst stanza, paste it below the present stanza, change the two (hd1,1) entries to (hd2,1) and for the title use Test-boot. When you get the GRUB error 22, use the Test-boot option from the boot menu.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2436
  • Any Bugs in site?
Re: do fdisk and devicemap indicate same devices?
« Reply #3 on: May 15, 2011, 07:05:11 PM »
old-polack
I have just repeated the use of Super GRUB CD and you are correct, it was showing a jump to (hd2,1).  Despite I thought I had checked my BIOS settings I started thinking I had better double check. On this motherboard the BIOS has two sections BOOT order and HDD order, the HDD order was set to: HDD1, USB HDD, HDD2 with HDD1 and HDD2 being identical.  Initially for a long time I ran with HDD1 and USB external HDD when I then got another hard drive I just added this in the case, maintaining the HDD drive order with the USB HDD as no 2.  

During experiments this HDD USB drive is on and off and I am guessing the USB stick then takes over in position 2 (HDD2 = (hd1)) and because there is no pclos boot system on this I don't see (hd1,x) in the options when using Super GRUB CD I still did not get it, even when I see that (hd2,1) does have a pclos boot system, which I am using right now

Well I have set the HDD order to HDD1, HDD2, USB HDD though since I don't really use it to boot from (but do have a system on a partition here) I will leave it for the time being. I am also starting to think this is what screwed up my experiments with LiveHDD installs really bad.

With the new HDD order Super Grub CD also identifies as I would expect.  A little bit more experimentation and I hope to declare this topic solved.   :)  Thank you again.

Edit:
I did find this link and I did read it, but only almost understood it, the answer is in here. 

http://www.pclinuxos.com/forum/index.php/topic,66169.msg537782.html#msg537782

I have saved a copy of that thread (ie a copy of the PRINT version as that neatly gives you the whole thread but for the formatting  :'( )
« Last Edit: May 15, 2011, 07:35:10 PM by wedgetail »
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen