Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Aug 1995 11:44:35 -0700 (PDT)
From:      Julian Elischer <julian@ref.tfs.com>
To:        luigi@labinfo.iet.unipi.it (Luigi Rizzo)
Cc:        hackers@freebsd.org
Subject:   Re: fdisk & disklabel troubles
Message-ID:  <199508291844.LAA17364@ref.tfs.com>
In-Reply-To: <199508290749.JAA04925@labinfo.iet.unipi.it> from "Luigi Rizzo" at Aug 29, 95 09:49:29 am

next in thread | previous in thread | raw e-mail | index | archive | help
OK I originally hacked fdisk together from the MACH utility "DISKUTIL"

> 
> After spending a few hours on the above programs, I have more
> details which I hope somebody can clarify. I am starting with a
> fresh, full 950726-SNAPSHOT installation on wd0 (entire disk for
> freebsd) and an aborted install on wd2 (entire disk for freebsd,
> but just did the partition and newfs).
> 
> I see that:
> 
> * fdisk cannot read a valid partition table from either disk. The
>   "bios idea" of the disk, as printed by fdisk, shows one cylinder less
>   than the real size.


seems to work here?
below, I add a third slice to take up the 31 sectors that dos 
left before itself.
I then dump out the slices, and see that the new slice is in fact
added to the disk..


jules: {8} ./fdisk -u /dev/rwd0
******* Working on device /dev/rwd0 *******
parameters extracted from in-core disklabel are:
cylinders=985 heads=13 sectors/track=32 (416 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=985 heads=13 sectors/track=32 (416 blks/cyl)

Do you want to change our idea of what BIOS thinks ? [n] n
Note: BIOS sector numbering always starts with sector 1
Information from DOS bootblock is:
The data for partition 0 is:
sysid 4,(Primary DOS with 16 bit FAT)
    start 32, size 49888 (24 Meg), flag 0
        beg: cyl 0/ sector 1/ head 1;
        end: cyl 119/ sector 32/ head 12
Do you want to change it? [n] n
The data for partition 1 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 49920, size 359840 (175 Meg), flag 80
        beg: cyl 120/ sector 1/ head 0;
        end: cyl 984/ sector 32/ head 12
Do you want to change it? [n] n
The data for partition 2 is:
<UNUSED>
Do you want to change it? [n] y
Supply a decimal value for "sysid" [0] 165
Supply a decimal value for "start" [0] 1
Supply a decimal value for "size" [0] 31
Explicitly specifiy beg/end address ? [n] n
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 1, size 31 (0 Meg), flag 0
        beg: cyl 0/ sector 2/ head 0;
        end: cyl 0/ sector 32/ head 0
Are we happy with this entry? [n] y
The data for partition 3 is:
<UNUSED>
Do you want to change it? [n] 
Do you want to change the active partition? [n] 

We haven't changed the partition table yet.  This is your last chance.
parameters extracted from in-core disklabel are:
cylinders=985 heads=13 sectors/track=32 (416 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=985 heads=13 sectors/track=32 (416 blks/cyl)

Information from DOS bootblock is:
0: sysid 4,(Primary DOS with 16 bit FAT)
    start 32, size 49888 (24 Meg), flag 0
        beg: cyl 0/ sector 1/ head 1;
        end: cyl 119/ sector 32/ head 12
1: sysid 165,(FreeBSD/NetBSD/386BSD)
    start 49920, size 359840 (175 Meg), flag 80
        beg: cyl 120/ sector 1/ head 0;
        end: cyl 984/ sector 32/ head 12
2: sysid 165,(FreeBSD/NetBSD/386BSD)
    start 1, size 31 (0 Meg), flag 0
        beg: cyl 0/ sector 2/ head 0;
        end: cyl 0/ sector 32/ head 0
3: <UNUSED>
Should we write new partition table? [n] y
ioctl DIOCWLABEL: Operation not supported by device
jules: {8} ./fdisk /dev/rwd0
******* Working on device /dev/rwd0 *******
parameters extracted from in-core disklabel are:
cylinders=985 heads=13 sectors/track=32 (416 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=985 heads=13 sectors/track=32 (416 blks/cyl)

Note: BIOS sector numbering always starts with sector 1
Information from DOS bootblock is:
The data for partition 0 is:
sysid 4,(Primary DOS with 16 bit FAT)
    start 32, size 49888 (24 Meg), flag 0
        beg: cyl 0/ sector 1/ head 1;
        end: cyl 119/ sector 32/ head 12
The data for partition 1 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 49920, size 359840 (175 Meg), flag 80
        beg: cyl 120/ sector 1/ head 0;
        end: cyl 984/ sector 32/ head 12
The data for partition 2 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 1, size 31 (0 Meg), flag 0
        beg: cyl 0/ sector 2/ head 0;
        end: cyl 0/ sector 32/ head 0
The data for partition 3 is:
<UNUSED>
jules: {9} 

> 
> * fdisk cannot write the partition table either (or at least, it cannot
>   be read back!). I tried to set the correct parameters and write to
>   disk, fdisk did not write any error message but reading again the
>   partition table shows the same old values.
>   (cannot do further experiments with working fdisks, but my setting is
>   easily reproducible).
see above

getting ready:
jules: {18} sh MAKEDEV wd0s3{a,b,c,d,e,f,g}

> 
> 
> * (BTW, the "usage" line of fdisk shows a "-r" flag which does not
>   exist.
hmmm mea culpa
> 
> Luckily, fdisk does not kill the system. With disklabel, things seem to
> be worse: whenever I try to write a label, the system reboots.
> 
> As a reference, here are the different ideas of the disks:
> 
> REAL:           1010 cyl, 12 hd, 55 sec, total 666.600 sectors
> fdisk:          1009 cyl, 12 hd, 55 sec, part. start 1, size 665.939
>                                          beg.: cyl.0 sec.2 hd.0
>                                          end:  cyl.1009 sec.1 hd.0
> disklabel:      1009 cyl, 12 hd, 55 sec, size 666.545
> 
> 
> REAL:           1057 cyl, 16 hd, 63 sec, total 1.065.456 sectors
> fdisk:          1056 cyl, 16 hd, 63 sec, part. start 1, size 1.064.447
>                                          beg.: cyl.0 sec.2 hd.0
>                                          end:  cyl.32 sec.1 hd.0
> disklabel:      1056 cyl, 16 hd, 63 sec, size 1.065.393

ok I'll try: I'll try put a label on the new little part I just made..
getting ready:
jules: {18} sh MAKEDEV wd0s3{a,b,c,d,e,f,g}

jules: {19} disklabel -R /dev/rwd0s3 /tmp/xxx

hmmm yep, it hangs the system....
I guess I'll need to go have a look at that.. :)







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508291844.LAA17364>