Re: How to create *exactly* the same partitions in different disks

From: Glenn Dawson (glenn_at_antimatter.net)
Date: 08/31/05

  • Next message: Giorgos Keramidas: "Re: rc.conf - setting interface UP without IP-address?"
    Date: Wed, 31 Aug 2005 03:21:03 -0700
    To: Norberto Meijome <numard@meijome.net>, FreeBSD Questions <freebsd-questions@freebsd.org>
    
    

    At 12:07 AM 8/31/2005, Norberto Meijome wrote:
    >Hi,
    >pretty simply, how do I create slices (fdisk) that are exactly the
    >same throughtout different drives so they can be used in a RAID5 config?
    >
    >I tried using sysinstall and typing the SAME values but they result
    >is always slightly off. I tried passing the values by hand, but it
    >changes it anyway.
    >
    ># echo "p 2 165 20964825 467427240" | fdisk -v -f- /dev/ad6
    >******* Working on device /dev/ad6 *******
    >fdisk: WARNING: adjusting size of partition 2 from 467427240 to 467426295
    > to end on a cylinder boundary
    >parameters extracted from in-core disklabel are:
    >cylinders=484521 heads=16 sectors/track=63 (1008 blks/cyl)
    >
    >Figures below won't work with BIOS for partitions not in cyl 1
    >parameters to be used for BIOS calculations are:
    >cylinders=484521 heads=16 sectors/track=63 (1008 blks/cyl)
    >
    >Information from DOS bootblock is:
    >1: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    > start 63, size 20964321 (10236 Meg), flag 0
    > beg: cyl 0/ head 1/ sector 1;
    > end: cyl 317/ head 15/ sector 63
    >2: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    > start 20964825, size 467426295 (228235 Meg), flag 0
    > beg: cyl 318/ head 7/ sector 1;
    > end: cyl 162/ head 15/ sector 63
    >3: <UNUSED>
    >4: <UNUSED>
    >fdisk: Geom not found
    >
    >[root@cerberus] [Wed Aug 31 17:02:10 2005]
    >~
    ># fdisk -s /dev/ad4
    >/dev/ad4: 484521 cyl 16 hd 63 sec
    >Part Start Size Type Flags
    > 1: 63 20964762 0xa5 0x80
    > 2: 20964825 467427240 0xa5 0x00
    >
    >[root@cerberus] [Wed Aug 31 17:01:35 2005]
    >~
    ># fdisk -s /dev/ad6
    >/dev/ad6: 484521 cyl 16 hd 63 sec
    >Part Start Size Type Flags
    > 1: 63 20964321 0xa5 0x00
    > 2: 20964825 467426295 0xa5 0x00

    fdisk wants slices to start on a head boundary, and end on a cylinder boundary.

    if you make start evenly divisible by the number of sectors per
    track, and make size+start evenly divisible by sectors*heads, fdisk
    won't change any of the numbers on you.

    So, for your disk:

    start / sectors = 332775
    you have size specified as 467427240, so:
    (467427240 + 20964825) / (16 * 63) = 484515.9375
    fdisk will treat that as 484515 and do:
    (16 * 63 * 484515) - 20964825 = 467426295
    and use that number as the new size.

    This matches ad6. It would appear that ad4 had the start and end
    values explicitly set causing it to come out with different numbers.

    -Glenn

    >Help!!!
    >
    >thanks in advance,
    >beto
    >_______________________________________________
    >freebsd-questions@freebsd.org mailing list
    >http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    >To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"

    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"


  • Next message: Giorgos Keramidas: "Re: rc.conf - setting interface UP without IP-address?"

    Relevant Pages

    • Re: How to create *exactly* the same partitions in different disks
      ... > fdisk wants slices to start on a head boundary, and end on a cylinder ... So sysinstall doenst follow the rule? ... is how the slices were done. ...
      (freebsd-questions)
    • Re: no partition entries for /dev/ad3
      ... Maybe there is a "rescan devices" command? ... fdisk thinks it has no work to do: ... Then you can disklabelthe slices which will ...
      (freebsd-current)
    • Re: FreeBSD fdisk how to?
      ... bsdlabel -B disk ... But this does not create slices, ... The fdisk statement I ran only with one partition entry is to learn fdisk, that's why I ran in test mode. ... I need at least 2 partitions, one for FreeBSD 7 and other for FreeBSD 8. ...
      (freebsd-questions)
    • Re: How to create *exactly* the same SLICES in different disks
      ... sorry, i meant slices. ... Norberto Meijome wrote: ... how do I create slices (fdisk) that are exactly the same ... > parameters to be used for BIOS calculations are: ...
      (freebsd-questions)
    • disklabel and fdisk cant write to disk. Interactive versions?
      ... When I run fdisk and dislabel from /stand/sysinstall, ... This happens on all four scsi drives on this system, ... BIOS sector numbering starts with sector 1 ... The data for partition 1 is: ...
      (comp.unix.bsd.freebsd.misc)