Find the answer to your Linux question:
Results 1 to 4 of 4
Does anyone know why I keep running into this mess? http://www.dolda2000.com/~bpark/parted.txt Both ext2 and ext3 give me problems....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    GNU Parted Problem


    Does anyone know why I keep running into this mess?

    http://www.dolda2000.com/~bpark/parted.txt

    Both ext2 and ext3 give me problems.
    The best things in life are free.

  2. #2
    Linux Engineer Nerderello's Avatar
    Join Date
    Apr 2003
    Location
    North East England
    Posts
    1,190
    if you're using Fedora Core, its because of a bug. There are two ways of describing a hard disk - Cylinders Heads and Sectors (CHS) and linear. Modern Linux uses linear. Partitions are defined in both formats/ways. Fdisk and CFdisk examine the hard disk and work out what the CHS is, and so work reliably. Parted checks out the old way and comes up with incorrect values.

    Way around it:-
    Code:
    fdisk -l /dev/hda
    where the 'dev/hda' should be the hard disk in question.
    and then find out what the kernel reckons by:-

    Code:
    sfdisk -l /dev/hda
    again replace 'dev/hda' with hard disk in question.

    Make a note of the reported geometries given by fdisk and sfdisk. If they are the same, great, if not ...

    You will want to alter what the kernel thinks is there (one method is to add to the kernel line in your /boot/grub/grub.conf file the correct geometry - as an example (it'll probably be different on your PC) - kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/1 hda=38792,16,63 ).

    You can change it permenatly (ie. change what the kernel reckons is there) by using either the /proc/ide/hda/settings or by using sfdisk.

    The /proc/ide/hda/settings method :-
    Code:
    # echo bios_head:255  >  /proc/ide/hda/settings
    where you would put the value for the number of heads (255 in the example) on your hard disk (hda in the example). This value is the one that you noted down from the fdisk above (it is also shown in your BIOS at boot time).
    Then you could repeat the procedure for the bios_cyl , but this shouldn't bee needed as once you've got the correct number of heads the rest will fall into place.

    You can check what the /proc/ide/hda/settings has by doing a "cat /proc/ide/hda/settings" , it's there amongst a whole lot of other stuff.

    The sfdisk method.


    Code:
    # sfdisk -H 16 -d /dev/hda | sfdisk --no-reread -C 38792 -H 16 -S 63 /dev/hda
    here the first command causes sfdisk to dump the hard disk geometry (try entering "sfidk -d /dev/hda" to see what it looks like), this is then piped into sfdisk to write the correct values away. Again, the values that you use will be dependent upon what fdisk gave you earlier, and you don't really need to use the -C and -S only the heads value -H. I have used the values for CHS that are correct for my hard disk (probably not for yours) - Cylinders = 38792 Heads = 16 Sectors = 63 , which is different from my earlier example (where I used 255 for the number of heads).

    By entering the CHS (or at least the -H) values , forces sfdisk to write these away (it would normally only do the linear description.

    Remember to do this for all of youir hard disks.

    There you have it. I suggest that first you try the "adding to the kernel line in grub" method first. Do this by adding a new entry to your /boot/grub/grub.conf , as this will let you cope with any mistakes. Once you're happy with being able to boot with the correct geometry, then use either of the other two methos. But remember, make sure that you have a rescue disk, just in case (shouldn't need it, but you never know).

    have fun

    Nerderello

    Use Suse 10.1 and occasionally play with Kubuntu
    Also have Windows 98SE and BeOS

  3. #3
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Nerderello,

    Thanks for the post.

    I am using Debian testing (Sarge) as my base system but have used Parted v 1.6.1 from a Linux live rescue CD. I believe it's origins are from Gentoo.

    Unfortunately, I've just rebuilt the system using Partition magic and rebuilding my Linux partition (I needed the practice anyways).

    Still, this is useful information. I do have more questions:

    1. When partitioning a disk for the first time, which tool should I use? fdisk seems to be the best choice but I find it difficult to use since it doesn't deal with bytes.

    2. Is cfdisk reliable? I was told that cfdisk also suffers from miscalculations. From what I understand, cfdisk is just fdisk with menu driven front-end.

    3. Does the file system options have anything to do with these errors? I was doing a lot of research last night and came across that the "dir_index" should be turned off. I've tried turning off all options but still, I never got far.
    The best things in life are free.

  4. #4
    Linux Engineer Nerderello's Avatar
    Join Date
    Apr 2003
    Location
    North East England
    Posts
    1,190
    must be honest, I got the partition stuff from a mag.

    I usually use the partition druid ( wizard) that comes with Fedora's install CD to partition a disk. It's graphical and easy to use.

    I can't see that the filesystem used has anything to do with any partition problems, as you first partition and then create a filesystem in it.

    have fun

    Nerderello

    Use Suse 10.1 and occasionally play with Kubuntu
    Also have Windows 98SE and BeOS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •