Date: Fri, 24 Feb 95 00:37 CST From: krnlhkr@mcs.com To: David Lim <lim@telerobotics.jpl.nasa.gov>, questions@FreeBSD.org Subject: Re: [Q] FreeBSD 2.0R - fdisk is non-destructive? Message-ID: <m0rhtej-000kR0C@mailbox.mcs.com>
next in thread | raw e-mail | index | archive | help
I've attached the original message below so you can see my reply first, then
check the data which is long.
Since 3 different fdisks (DOS, BSD, and the dos_tools) show the partition
table
to be correct, I have to think that your DOS filesystem is hosed.
DOS reports free space on the disk based on the number of clusters in the file
system.
Int21h Function36h reports total clusters and remaining clusters. This is the
FAT
table we know and love so well. I haven't peeked at the BSD dosfs code, but
my
guess is that the call df makes computes the freespace the same way.
So, your FAT or the number of clusters may have gotten hosed in your DOS
filesystem.
You can run chkdsk under DOS, but be prepared to lose some files. There are
several
reasons for DOS filesystem corruption: sometimes it just "happens", a virus
can
do it, or BSD could have hosed it. If you hadn't mounted a DOS filesystem
under
BSD I don't think BSD did it.
If you make the DOS partition with BSD's fdisk, you might not want to do this.
Generally I make DOS partitions with DOS's fdisk, BSD with BSD's, etc.
I would back up what I have, and do a chkdsk. It will report if the FAT is
corrupted, and that would explain what is wrong. If that is the case, you
will want to find out as soon as possible anyhow because you will eventually
lose files.
Hope that helps and let me know how it turns out or if you need more help.
-Louis
<---- Begin Included Message ---->
<---- Begin Included Message ---->
I just installed FreeBSD 2.0-R from the Walnut CD-ROM on a 1 Gbyte drive. I
created two slices one for DOS and one for FreeBSD. When I boot DOS, I run
fdisk, and it shows the slice sizes correctly. However, the DOS dir command
still reports free space relative to the entire disk. E.g. it says 100
Mbytes
used, 900 Mbytes free. Is this just a DOS bug of some sort? I'm worried
that
DOS will overwrite sectors assigned to FreeBSD.
<---- End Included Message ---->
An additional piece of information. When I first partitioned the FreeBSD
slice, I first imported the MS-DOS slice to partition e. However, when I do a
df under FreeBSD, it shows the same incorrect information as the DOS DIR
command. df shows my /dev/sd0e (MS-DOS slice) as having a capacity the size of
the entire disk!
I've looked through the FAQ and searched through the mailing list archives.
The only thing I've come up with is the SCSI card setting for 1 Gbyte drives.
I have this turned ON on the Buslogic card. Perhaps I should turn it off? I
tried turning it off, and tried booting (no reinstall) both DOS and FreeBSD,
they both still had the same problem, showing the MSDOS partition occupying
the entire drive. Perhaps I should turn it off and reinstall all of FreeBSD
and Windows/DOS? Perhaps I should use the real geometry of the drive, and
just make sure that the partition of DOS resides within 1024 cylinders again
using the real geometry of the drive? This just doesn't sound quite right to
me.
So I guess fdisk is destructive? Everyone who has partitioned their disk to
install FreeBSD, had to re-install DOS and windows?
I seem to recall a message someplace saying that some Conner drives have some
sort of auto-translation of the cylinders? And that some special care needs to
be taken when writing the MBR code? Unfortunately I can't seem to track down
this message.
---------------------------------------------------------------------------
--- Output of DOS fdisk
Partition Status Type Volume Label Mbytes System Usage
C: 1 A PRI-DOS Micron 501 FAT16 49%
2 non-DOS 512 51%
---------------------------------------------------------------------------
--- Output of tools\dos-tools\pfdisk 0
geometry 1013 64 32 (cyl hd sec)
# ID First (cyl) Last (cyl) Nmae #start, length
1 6 0 500 Dosbi 32,1026016
2 165 501 1012 unkno 1026048,1048576
---------------------------------------------------------------------------
---------------------------------------------------------------------------
--- Output of /sbin/disklabel
# /dev/rsd0a:
type: SCSI
disk:
label: MBR based label
flags:
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 64
sectors/cylinder: 2048
cylinders: 1013
rpm: 0
interleave: 0
trackskew: 0
cylinderskew: 0
headswitch: 0 # milliseconds
track-to-track seek: 0 # milliseconds
drivedata: 0
8 partitions:
# size offset fstype [fsize bsize cpg]
a: 51200 1026048 4.2BSD 1024 8192 16 # (Cyl. 501 - 525)
b: 65536 1077248 swap # (Cyl. 526 - 557)
c: 1048576 1026048 unused 0 0 # (Cyl. 501 - 1012)
d: 2074880 0 unused 0 0 # (Cyl. 0 - 1013*)
e: 1026016 32 MSDOS # (Cyl. 0*- 500*)
g: 931840 1142784 4.2BSD 1024 8192 16 # (Cyl. 558 - 1012)
Warning, revolutions/minute 0
super block size 0
---------------------------------------------------------------------------
--- Output of /sbin/fdisk
******* Working on device /dev/rsd0a *******
parameters extracted from in-core disklabel are:
cylinders=1013 heads=64 sectors/track=32 (2048 blks/cyl)
parameters to be used for BIOS calculations are:
cylinders=1013 heads=64 sectors/track=32 (2048 blks/cyl)
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 0 is:
sysid 6,(Primary 'big' DOS (> 32MB))
start 32, size 1026016 (500 Meg), flag 80
beg: cyl 0/ sector 1/ head 1;
end: cyl 500/ sector 32/ head 63
The data for partition 1 is:
sysid 165,(386BSD)
start 1026048, size 1048576 (512 Meg), flag 0
beg: cyl 501/ sector 1/ head 0;
end: cyl 1012/ sector 32/ head 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
<---- End Included Message ---->
----------------------------------------------------------------------
Louis J. Giliberto, Jr. ! Support the Free Software Foundation
krnlhkr@mcs.com !
----------------------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0rhtej-000kR0C>
