[ e-mail CCed ]
> WinNT is already installed on my PC. The 10Gb disk is partitioned:
> C: FAT 2047Mb primary
> D: FAT 2047Mb logical
> Leaving 5547Mb of free space, where I want to put Linux.
> I started with Linux boot and root disks and got scared when I got to
> fdisk. Initially fdisk reported
> Device boot begin start end blocks Id System
> /dev/hda1 * 1 1 261 2096451 6 DOS 16-bit >=32M
> /dev/hda2 262 262 522 2096482+ 5 Extended
> /dev/hda5 262 262 522 2096451 6 DOS 16-bit >=32M
> So I figured that hda1 was C:, hda5 was D:, and that I needed to split
> up hda2 to hold the root, swap and home Linux partitions.
Well, not exactly ...
Quote:> Next, I deleted partition 2 and then re-added it. Upon deleting
> partition 2, however, hda5 disappeared. And that got me spooked since
> I don't want to lose the data I have on D:.
Uh-oh! =8-O That was not a good idea - /dev/hda2 is the extended
partition, you can think of it as a container for any logical drive
youre going to add. It doesnt take any space, it basically says
"this place is reserved for logical drives".
Quote:> As an exercise, I continued with fdisk and made 3 new primary Linux
> partitions, but then I "quit" fdisk without writing the new partition
> table because I was afraid of losing D:. (Hope that's clear.)
A wise decision, indeed.
Quote:> My questions:
> Was I proceeding correctly or would D: have been lost if I wrote the
> new partition table ?
D: would have been history.
Quote:> Is there a way to do the Linux partitioning without risking the loss
> of D: ?
Basically yes, of course. Something seems to be strange with your
setup, though. You said that there are about 5.5GB unused space.
Well, the problem is, when creating your NT partitions, you made
the extended partition too small obviously, just the size of the
logical drive it contains, instead of _the_whole_rest_ of your disk.
The proper way would have been to create your 2GB primary partition
(/dev/hda1, C:), an extended partition of 8GB (/dev/hda2, but no
drive letter!), plus a logical drive of 2GB (/dev/hda5, D:), and
leave the rest of the drive free for Linux partitions, which would
have been further logical drives inside the extended partition
(/dev/hda6, /dev/hda7, ...).
Your problem is now that you can _not_ have any further partition
after the extended one. IIRC, it goes like this: you can have a max
total of 4 partitions on a disk, only one of which can be an extended
partition, and it has to be the last one in the row. Thus, you are
limited to the following setup possibilities (_P_rimary, _E_xtended):
P
E
P-P
P-E
P-P-P
P-P-E
P-P-P-P
P-P-P-E
The extended partition can conatain any number of logical drives, I
think, only limited by disk space (and drive letters under DOS and
Windoze, of course :-). Given the fact that DOS/Windoze fdisk is
crippled enough to be able to create only _one_ primary partition,
the most common setups youll find are either P (one primary partition
spanning the whole disk (again limited under DOS/Windoze, or rather
FAT, to a max size of 2GB)) or P-E (one primary, plus one extended
spanning the rest of the disk, containing logical drives). E (one
extended partition spanning the whole disk, only containing logical
drives) is rare, because you need a primary partition to boot, but
it happens as well (as a second/third/fourth disk in a system).
For you, this means that with your current setup, the rest of the
disk is effectively wasted/unusable (someone correct me if Im wrong).
This leaves you with 2 possible solutions (well, 3 actually :-) ...
1. "Wimp": Backup your data on D:, then proceed as you did already; ie.
delete /dev/hda5, then /dev/hda2, then recreate /dev/hda2 so that
it covers the entire remaining disk, recreate /dev/hda5 with Id = 6,
and add your Linux partitions as logical drives as desired, starting
with /dev/hda6. Under NT, reformat D: as FAT, and restore your
backup.
2. "Daredevil": Write down or make a printout of your current setup,
exactly as shown by fdisk above. Delete /dev/hda5 and /dev/hda2,
then recreate /dev/hda2 spanning the whole disk again. Now comes
the tricky part: recreate /dev/hda5 (Id = 6) _on_the_very_same_
cylinder boundaries that you wrote down (ie. start cylinder = 262,
end cylinder = 522), fdisk has an option to do this. Then create
your Linux partitions as above. Since fdisk does not modify the
actual data on the disk (it only rewrites the MBR), your data
on D: is still there .. DISCLAIMER: I can not guarantee 100% that
this will work - it should work in theory, but youre on your own
if you try this. If you lose your data (although I dont think
this will happen), tough luck, I warned you!
3. "Rich kid": So what, its only 5.5GB wasted! Buy a second/third/
fourth disk, or a whole new PC while youre at it, just for Linux.
;-)
Alright ... hope this doesnt create more confusion than it helps to
clear up.
Thomas
--
=---------------------------------------------------------------------=
- Thomas Zajic aka ZlatkO ThE GoDFatheR, Vienna/Austria -
- Spam-proof e-mail: thomas(DOT)zajic(AT)teleweb(DOT)at -
=---------------------------------------------------------------------=