grub 0.97 and ufs2 madness - BSD

This is a discussion on grub 0.97 and ufs2 madness - BSD ; Hi Everyone, I just transferred my system from an 80GB SATA150 disk to a 200GB UDMA100 disk. Everything works, except that the very same version of grub doesn't seem to recognize the copy of my UFS2 filesystems on the 200GB ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: grub 0.97 and ufs2 madness

  1. grub 0.97 and ufs2 madness

    Hi Everyone,

    I just transferred my system from an 80GB SATA150 disk to a 200GB UDMA100
    disk.
    Everything works, except that the very same version of grub doesn't seem to
    recognize the copy of my UFS2 filesystems on the 200GB disk while it
    recognizes the original partitions perfectly on the old disk.
    Now, look at this!

    Both disks work fine, here is what dmesg shows:
    ad0: 190782MB at ata0-master UDMA100
    ad4: 76324MB at ata2-master SATA150

    And here is what booting from the grub floppy shows:
    -------------------------------------------------------------------------
    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> geometry (hd0)
    drive 0x80: C/H/S = 1023/255/63, The number of sectors = 390721968, /dev/ad0
    Partition num: 0, Filesystem type unknown, partition type 0x7
    Partition num: 1, [BSD sub-partitions immediately follow]
    BSD Partition num: 'a', Filesystem type unknown, partition type 0xa5
    BSD Partition num: 'b', Filesystem type unknown, partition type 0xa5
    BSD Partition num: 'd', Filesystem type unknown, partition type 0xa5
    BSD Partition num: 'e', Filesystem type unknown, partition type 0xa5
    BSD Partition num: 'f', Filesystem type unknown, partition type 0xa5
    BSD Partition num: 'g', Filesystem type unknown, partition type 0xa5
    Partition num: 4, [BSD sub-partitions immediately follow]
    BSD Partition num: 'a', Filesystem type unknown, partition type 0xa5
    Partition num: 5, Filesystem type is fat, partition type 0xb
    Partition num: 6, Filesystem type is ext2fs, partition type 0x83
    Partition num: 7, Filesystem type unknown, partition type 0x82

    grub> geometry (hd1)
    drive 0x81: C/H/S = 1023/255/63, The number of sectors = 156312576, /dev/ad4
    Partition num: 0, Filesystem type unknown, partition type 0x7
    Partition num: 1, [BSD sub-partitions immediately follow]
    BSD Partition num: 'a', Filesystem type is ufs2, partition type 0xa5
    BSD Partition num: 'b', Filesystem type unknown, partition type 0xa5
    BSD Partition num: 'd', Filesystem type is ufs2, partition type 0xa5
    BSD Partition num: 'e', Filesystem type is ufs2, partition type 0xa5
    BSD Partition num: 'f', Filesystem type is ufs2, partition type 0xa5
    BSD Partition num: 'g', Filesystem type is ufs2, partition type 0xa5
    BSD Partition num: 'h', Filesystem type is ufs2, partition type 0xa5
    Partition num: 4, Filesystem type is fat, partition type 0xb
    Partition num: 5, Filesystem type is ext2fs, partition type 0x83
    Partition num: 6, Filesystem type unknown, partition type 0x82

    grub>
    -------------------------------------------------------------------------

    Using the grub shell from FreeBSD prints the exact same thing, except for
    the Cilinder and Head numbers which are shown correctly there (LBA).

    This is what I did to transfer my system from one disk to another:
    1., booted FreeBSD 6.2-STABLE from the old disk, having the new disk
    attached as the second disk.
    2., running cfdisk-linux (built from ports) on the second disk, I created
    the required slices.
    3., using dd, I copied the Windows NTFS slice sector-by-sector.
    4., run "fdisk -B" on the second disk.
    5., I saved the output of "bsdlabel olddisk_s2", edited the sizes
    appropriately and changed the offset of partition "a" from 0 to 16, then
    fed back this file to "bsdlabel -RB" on newdisk_s2.
    6., run "newfs -O2" on newdisk_s2a and "newfs -U -O2" on newdisk_s2d ..
    newdisk_s2h.
    7., for each UFS2 partition on the new disk I transferred the appropriate
    data from the old disk using:
    dump -L0f- $source_partition | ( cd /mnt && restore -rf- )
    8., fstab and grub's menu.lst on the new disk was edited to reflect any
    changes.
    9., shutdown -p now
    10., phisically swap the old and the new disk.
    11., boot from the same grub floppy I generated under FreeBSD on the old
    disk, try to install grub using "root (hd0,1,a)" and "setup (hd0)", which
    failed because grub is unable to read (hd0,1,a).

    Chainloading works, so I am able to boot any of my systems from the new
    disk. Windows, FreeBSD and Linux all boot and work fine.
    But I am unable to install grub onto the new harddisk, so I use a grub
    floppy with chainloading temporarily.

    Any idea or suggestion why grub does this or how to overcome the problem?
    How could the very same grub floppy recognize every single ufs2 filesystem
    on the smaller disk and none of them on the new disk?

    Regards,
    Keve

    --
    if you need to reply directly:
    keve(at)mail(dot)poliod(dot)hu

  2. Re: grub 0.97 and ufs2 madness

    Keve Nagy wrote:
    > Hi Everyone,
    >
    > I just transferred my system from an 80GB SATA150 disk to a 200GB UDMA100
    > disk.
    > Everything works, except that the very same version of grub doesn't seem to
    > recognize the copy of my UFS2 filesystems on the 200GB disk while it
    > recognizes the original partitions perfectly on the old disk.


    Isn't it the same problem here?
    http://ubuntuforums.org/showthread.php?t=19887


    --

    Michel TALON


  3. Re: grub 0.97 and ufs2 madness

    Michel Talon wrote:

    > Isn't it the same problem here?
    > http://ubuntuforums.org/showthread.php?t=19887


    I believe it is NOT.
    This particular computer on which I experienced this grub issue is a P4 IBM
    ThinkCentre, which in my ipinion must be modern enough to handle any size
    of ATA harddisks up to 500GB, including all the LBA tricks the BIOS should
    know.
    Also, if it was a BIOS limitation related issue then it should affect the
    80GB drive as well, not the 200GB only. But all the ufs2 partitions are
    recognized on the 80GB drive. HOWEVER, you just gave me the thought that it
    could be a difference between the SATA and ATA controller, so I will do
    some test to prove or deny this.
    And third, if my problem were a "BIOS limitation only" related issue then
    grub SHOULD recognize the ufs2 partitions on the 200GB drive as soon as the
    CHS values are correctly set. Because under FreeBSD, running the grub shell
    DOES display the correct LBA values for Cilinder and Head, "geometry (hd0)"
    SHOULD recognize all ufs2 partitons. But it doesn't! :-(

    I will play around with this using some test disks, and see what happens.

    Regards,
    Keve

    --
    if you need to reply directly:
    keve(at)mail(dot)poliod(dot)hu

  4. Re: grub 0.97 and ufs2 madness

    Keve Nagy wrote:

    > Hi Everyone,
    >
    > I just transferred my system from an 80GB SATA150 disk to a 200GB UDMA100
    > disk.
    > Everything works, except that the very same version of grub doesn't seem
    > to recognize the copy of my UFS2 filesystems on the 200GB disk while it
    > recognizes the original partitions perfectly on the old disk.
    > Now, look at this!
    >
    > Both disks work fine, here is what dmesg shows:
    > ad0: 190782MB at ata0-master UDMA100
    > ad4: 76324MB at ata2-master SATA150
    >
    > And here is what booting from the grub floppy shows:
    > -------------------------------------------------------------------------
    > 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> geometry (hd0)
    > drive 0x80: C/H/S = 1023/255/63, The number of sectors = 390721968,
    > /dev/ad0
    > Partition num: 0, Filesystem type unknown, partition type 0x7
    > Partition num: 1, [BSD sub-partitions immediately follow]
    > BSD Partition num: 'a', Filesystem type unknown, partition type 0xa5
    > BSD Partition num: 'b', Filesystem type unknown, partition type 0xa5
    > BSD Partition num: 'd', Filesystem type unknown, partition type 0xa5
    > BSD Partition num: 'e', Filesystem type unknown, partition type 0xa5
    > BSD Partition num: 'f', Filesystem type unknown, partition type 0xa5
    > BSD Partition num: 'g', Filesystem type unknown, partition type 0xa5
    > Partition num: 4, [BSD sub-partitions immediately follow]
    > BSD Partition num: 'a', Filesystem type unknown, partition type 0xa5
    > Partition num: 5, Filesystem type is fat, partition type 0xb
    > Partition num: 6, Filesystem type is ext2fs, partition type 0x83
    > Partition num: 7, Filesystem type unknown, partition type 0x82
    >
    > grub> geometry (hd1)
    > drive 0x81: C/H/S = 1023/255/63, The number of sectors = 156312576,
    > /dev/ad4
    > Partition num: 0, Filesystem type unknown, partition type 0x7
    > Partition num: 1, [BSD sub-partitions immediately follow]
    > BSD Partition num: 'a', Filesystem type is ufs2, partition type 0xa5
    > BSD Partition num: 'b', Filesystem type unknown, partition type 0xa5
    > BSD Partition num: 'd', Filesystem type is ufs2, partition type 0xa5
    > BSD Partition num: 'e', Filesystem type is ufs2, partition type 0xa5
    > BSD Partition num: 'f', Filesystem type is ufs2, partition type 0xa5
    > BSD Partition num: 'g', Filesystem type is ufs2, partition type 0xa5
    > BSD Partition num: 'h', Filesystem type is ufs2, partition type 0xa5
    > Partition num: 4, Filesystem type is fat, partition type 0xb
    > Partition num: 5, Filesystem type is ext2fs, partition type 0x83
    > Partition num: 6, Filesystem type unknown, partition type 0x82
    >
    > grub>
    > -------------------------------------------------------------------------
    >
    > Using the grub shell from FreeBSD prints the exact same thing, except for
    > the Cilinder and Head numbers which are shown correctly there (LBA).
    >
    > This is what I did to transfer my system from one disk to another:
    > 1., booted FreeBSD 6.2-STABLE from the old disk, having the new disk
    > attached as the second disk.
    > 2., running cfdisk-linux (built from ports) on the second disk, I created
    > the required slices.
    > 3., using dd, I copied the Windows NTFS slice sector-by-sector.
    > 4., run "fdisk -B" on the second disk.
    > 5., I saved the output of "bsdlabel olddisk_s2", edited the sizes
    > appropriately and changed the offset of partition "a" from 0 to 16, then
    > fed back this file to "bsdlabel -RB" on newdisk_s2.
    > 6., run "newfs -O2" on newdisk_s2a and "newfs -U -O2" on newdisk_s2d ..
    > newdisk_s2h.
    > 7., for each UFS2 partition on the new disk I transferred the appropriate
    > data from the old disk using:
    > dump -L0f- $source_partition | ( cd /mnt && restore -rf- )
    > 8., fstab and grub's menu.lst on the new disk was edited to reflect any
    > changes.
    > 9., shutdown -p now
    > 10., phisically swap the old and the new disk.
    > 11., boot from the same grub floppy I generated under FreeBSD on the old
    > disk, try to install grub using "root (hd0,1,a)" and "setup (hd0)", which
    > failed because grub is unable to read (hd0,1,a).
    >
    > Chainloading works, so I am able to boot any of my systems from the new
    > disk. Windows, FreeBSD and Linux all boot and work fine.
    > But I am unable to install grub onto the new harddisk, so I use a grub
    > floppy with chainloading temporarily.
    >
    > Any idea or suggestion why grub does this or how to overcome the problem?
    > How could the very same grub floppy recognize every single ufs2 filesystem
    > on the smaller disk and none of them on the new disk?
    >
    > Regards,
    > Keve
    >


    Grub has worked OK Here on 160Gb ATA 100 booting FreeBSD, Linux, Windows.

    Tho. mostly I prefer to use Lilo.
    dmesg: ad0: 152626MB at ata0-master UDMA100

    ... and from lilo.conf:
    other=/dev/hda2
    label="FreeBSD"
    other=/dev/hda1
    label="windows"
    table=/dev/hda
    Likely I have a copy of grub config from linux buried somewhere on a backup
    CD...
    But then I'm only using one H/D at present.

    Cheers
    --

    Bill
    AMD64 - FreeBSD 6.2
    'The road less travelled'

  5. Re: grub 0.97 and ufs2 madness


    > Grub has worked OK Here on 160Gb ATA 100 booting FreeBSD, Linux, Windows.
    >
    > Tho. mostly I prefer to use Lilo.
    > dmesg: ad0: 152626MB at ata0-master UDMA100
    >
    > .. and from lilo.conf:
    > other=/dev/hda2
    > label="FreeBSD"
    > other=/dev/hda1
    > label="windows"
    > table=/dev/hda
    > Likely I have a copy of grub config from linux buried somewhere on a
    > backup CD...
    > But then I'm only using one H/D at present.
    >
    > Cheers


    This is not relevant to my issue here because you do not say how much
    control grub has to your ufs2 partitions.
    I am also able to use grub to boot FreeBSD, even on the 200GB ATA100 disk
    which shows the trouble. But that is by chainloading only.
    On the old SATA 80GB disk grub has access to the contents of my ufs2
    filesystem so it can load /boot/loader directly and it can load the grub
    menu and stage files from there, which doesn't work for the other disk.
    God knows why!

    Keve

    --
    if you need to reply directly:
    keve(at)mail(dot)poliod(dot)hu

+ Reply to Thread