LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Deleted ntfs partition - added linux partition in its place - corrupt! (https://www.linuxquestions.org/questions/linux-from-scratch-13/deleted-ntfs-partition-added-linux-partition-in-its-place-corrupt-337896/)

eklhad 06-28-2005 01:13 AM

Deleted ntfs partition - added linux partition in its place - corrupt!
 
I am comverting a spare drive from ntfs to linux.
It is in the second position, i.e. hdb.
I deleted the partition (using fdisk,
as shipped with redhat), and thus, all partitions were gone.
Looks good. I added the linux partition in its place.
One partition, type 83 linux, looks good.
I created the file system, mkfs.ext2, looks good.
I tried to automount it, and the kernel still thought it was ntfs.
Naturally it wouldn't mount properly,
and, when I forced an fsck, it was corrupt.
I started over, this time rebooting after almost every step.
Delete, reboot, add, reboot, mkfs, fsck -f,
and the automounter STILL thought it was ntfs, thus corrupting everything again.
So I started over, same ritual,
and this time I mounted with the type specified as ext2.
Looks good. I copied some files over.
Then forced an fsck.
Superblock corrupt, hopelessly corrupt.
There is some piece of ntfs that won't go away, even if I delete all the partitions,
and it's destroying everything I try to do.
Interestingly, the first drive was also ntfs,
but fedora installed on that drive, and apparently they know the secret to get rid
of ntfs completely!
When I automount the first drive from a rescue floppy, the kernel knows darn well it's linux.
No problem.
But the second drive remains ntfs, somewhere deep inside, no matter what I do.
I suppose I can spend a few hours and install Fedora on the second drive,
then delete all the files; at least it will be a real linux partition.
But I'd rather understand what is going on.

Noth 06-28-2005 02:15 AM

If you ran the 3rd fsck (the one after you copied some files over) while the partiton was mounted, it'll tell you it's corrupt even though it's not because the data on disk won't be consistent with what's in memory because of caching.

Other than that, I have no idea. I've never had any problems deleting/creating partitions.

eklhad 06-28-2005 02:31 AM

Hi, it's me again, answering my own question.
Didn't get any sleep tonight, but hey, I figured it out.
I had to zero out the first meg of the partition, thus clearing the mysterious
ntfs bits, whatever and wherever they were.
dd if=/dev/zero of=/dev/hdb1 bs=1024k count=1
Then I ran mkfs.ext2, and the automounter knew it was linux.
Copied files over, unmounted, and fsck -f was happy.
No trouble at all.
So there it is; hope this helps someone else in a similar situation.
I will always remember to zero things out when changing the type
of a preexisting partition.


All times are GMT -5. The time now is 07:55 AM.