Deleted ntfs partition - added linux partition in its place - corrupt!
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.