Article View: aus.computers.linux
Article #47167Re: Disk Partition & Fdisk
From: Richard RUDEK
Date: Sat, 16 Jan 1999 00:00
Date: Sat, 16 Jan 1999 00:00
173 lines
5724 bytes
5724 bytes
Greg <g_pengelly@bigpond.com> wrote:
>Problems with Partitioning Disks & FDISK
>
>I have managed to installed both Linux & WIN95 on my PC.
>
>From memory I installed WIN95 first and then Linux
>
>fdisk in WIN95 created a 2G partition (FAT 16). From memory fdisk didnt
>give me the option of creating a smaller partition. My hard disk is
>4.3G.
You didn't try hard enough. You can override the values chosen by FDISK.
>
>I then installed Win95.
>
>Red Hat 5.1 Linux was then installed. During the installation process
>(when setting up the disk partition sizes) I reduced the size of the DOS
>partition to 1G. After further reading I believe I should have used
>FIPS.EXE to cut the DOS partition size down.
You mean you changed the size of the Windows partition in Linux's fdisk ?
A definate No, No, if you want to retain the data on the Windows partition,
and that's exactly what FIPS is for.
>
>The result is
>
>FDISK in Linux
> Flag Part type FS Type Size
>/dev/hda1 boot primary Dos fat16 1004
> Pri/Log Free Space 1043
>/dev/hhda5 Logical Linux 776
>/dev/hhda6 Logical Linux 1004
>/dev/hhda7 Logical Linux 203
>/dev/hhda8 Logical Linux swap 70
>
>
>FDISK in DOS
>Partition Status Type Mbyte System Usage
>1 A Pri Dos 1004 Fat16 24%
>2 Ext Dos 2055 50%
>
>My Concern
>
>Dir in Dos shows that there is 2G of disk space available. Scandisk in
>Dos shows that the disk is OK & there is 2G of free space available.
>Does Win95 have 2G or 1G ?
>
>Not liking this (& since I have only just installed both operating
>systems) I decided to start all over again.
>
>My Problem
>
>Fdisk in Dos will not reformat the hard disk
>
>If I try and delete the Primary drive the message is
>Can not delete the Primary when Extended exists
>
>If I try and delete the Extended drive the message is
>Can not delete the Extended when Logical exists
>
>If I try and delete the Logical drive the message is
>No Logical drives defined
>All logical drives deleted in Extended Dos
>
>
>All applications seem to be working OK but I am unhappy with Win95
>thinking it has 2G & Fdisk showing 1G allocated (I have rebooted the
>system several times and there is no change in the figures).
>
>
>How do I reformat the disk (or is there another way out).
>
Obviously, this is not to be done lightly. Although in this case, you've
said you were going to wipe and start over again, so this seems like a good
time to have a tinker. If you do need the data on the drive, then you could
create a file image of the Hard Disk (which obviously lives on a larger
drive than the disk your working on), so you can restore the state of the
drive if you stuff up.
eg:
# dd if=/dev/hda of=/mnt/BloodyBigDrive/tinker.dd
I've made a few assumptions, based on what you said above:
o You got into the situation by editing the partition table (fdisk)
and not by running FIPS.
o When you ran the SCANDISK in windows, you didn't let it "fix" any
problems, or that you created an "undo disk", and can reverse them.
o Nothing has written over the free space defined as:
Pri/Log Free Space 1043
If all these apply, then you should be able to correct the partition table
entry using Linux's fdisk - Normally I would use Norton's Utilities
DISKEDIT (MSDOS), which allows me to edit the numbers in-situ, calculate
things, etc, and not have to delete and recreate partitions using
"remembered" details .
Anyway using Linux's fdisk, you basically note your current partitions,
then delete and recreate the DOS partition.
# fdisk -l >~/ptable
This saves the textual details of the partition table into the file called
ptable, in your home directory.
# fdisk
Get a printout of your current partition,
: p
Delete partition 1 (/dev/hda1),
: d
: 1
Now recreate partition 1,
: n
: p
: 1
Now, enter the Start figure of /dev/hda1 (printed on screen previously) at
the "First Cylinder:" prompt, then enter highest figure quoted at the "Last
Cylinder..." prompt. eg:
First cylinder (1-827): 1
Last cylinder or +size or +sizeM or +sizeK ([1]-276): 276
NOTE: my version of fdisk (util-linux-2.7-18) didn't pickup the last
*available* cylinder correctly, until it failed the first time, quoting the
highest available cylinder of the whole drive !!!. Anyway, no damage done.
Then change the partition type to large FAT16 (type 6), or whatever it was
originally,
: t
: 1
: 6
Now check the results,
: p
Check them again, noting that q is your friend, when aborting...
Once your satisfied, then write the changes and quit,
: w
: q
That should be it. You'll have to reboot for the changes to take effect,
but you'll obviously have to reboot anyway to start and test in Windows.
When your satisfied Windows is working properly, eg:
Starting Windows...
<Ctrl F5>
C:\> SCANDISK /CHECKONLY
you can then delete ~/ptable from your home directory in Linux.
Let us know how it goes (on the newsgroup).
__ __ _______________________________
//)) //)) | Richard RUDEK. MicroDek. | Hey, it's Friday night...
//\\ //\\ | Chatswood, Sydney. Australia. | C:\WORK> CD \
`-------------------------------'
Technical Details
Message-ID:
<36a0550c.3145370@news.zeta.org.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<369F8FBE.3B63@bigpond.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102983,f7b36aeb30c38ed2 X-Google-Attributes: gid102983,public From: x@invalid.zeta.org.au (Richard RUDEK) Subject: Re: Disk Partition & Fdisk Date: 1999/01/16 Message-ID: <36a0550c.3145370@news.zeta.org.au> X-Deja-AN: 433279930 References: <369F8FBE.3B63@bigpond.com> Organization: Zeta Internet, http://www.zeta.org.au/ Newsgroups: aus.computers.linux