Lost access to windows partition, due to typo in command
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Lost access to windows partition, due to typo in command
I was trying to repair a flash drive, following a post on this forum, and accidentally issued /sbin/mkdosfs -F32 /dev/sda1
instead of /sbin/mkdosfs -F32 /dev/sdf. sdf is my flash drive and sda1 is a 120 gig windows ntfs partition. I rebooted knoppix and it sees sda1 and sda2 (suse, is fine) and sees nothing on the partition. It cannot have destroyed it as the command took less than a second to execute. It provided no output. When I try booting into Windows, I get a message saying that this is not bootable, please insert a system cd. Please help, as I had a website project due Friday on it!
You could try a windows restore disk. Or you could try tools from http://www.linux-ntfs.org/ - they have one called mkntfs. The tools would probably give you a way to recover the data, at the very least.
Alright, I'm compiling everything (required libraries), but have 2 questions:
-Is the restore disk the installation disk (I have no other disks)
-Will mkntfs also format it, or bring it back, like reversing mkdosfs?
Everything is going down the drain.
After installing glibc, my linux won't boot, shutdown, so I am using Knoppix now.
Also mkntfs started overwriting sda1 with 0's, so I pulled the plug at 2%. Now the computer doesn't regonise the type of partition on it!
Ok, should I run mkdosfs again to give it a recognizeable filesystem type? I don't think the XP disk would help since officially the partition is blank. I did find a program called foremost http://foremost.sourceforge.net/
which won't install on Knoppix. I have burned my data from the Linux partition to CD's and will reinstall Suse, from there run foremost to see if I can pick anything up... but as I said, my most urgent question is: DO I NEED TO RUN MKDOSFS AGAIN?
UPDATE: I'm just gonna go ahead and do it, won't wait for any replies here...
UPDATE: Just mkdosfs'ed it, now starting to reinstall suse
Major Update: I repaired Suse with the installation cd, foremost did not work. Neither did Active@ NTFS Reader, nor Active@ Partition Recovery. The only thing that did, however, was the R-Studio Emergency Demo http://www.data-recovery-software.ne...Download.shtml
however it is limited to <64 KB files, and $80 is a considerable amount of dough to pay. Would anyone here know of a comparable program that is freeware/shareware/costs less? Please keep in mind that I can only run linux and livecd stuff, while most programs are for windows on the same machine (No other computer in my house has SATA drives, so I cannot transfer the drive to another box). Thanks.
I wonder if the structure of the filesystem influences the actions of the recovery software (foremost in this case). Makes sense - FAT (data strucure) will be significantly different to NTFS, and hence trying to locate the data may well be handled differently.
Personally I'd reformat as NTFS and try recovery then - on an image of the real data of course. If you fugg it up you just take another copy and try something else.
Nobody has mentioned backups yet ... interesting ...
how would i reformat to ntfs without overwriting the disk / where can i make an image without having to pay for proprietary software...
dd if=/dev/<windowspartition> of=/path/to/img/file bs=2048
or something like that will create an image of what's currently
there. Before you go and do that check with a hex-editor that
it still makes sense (i.e. if there's only 0's - don't bother). If there's
no hex-editor installed, just the device. If it looks like mostly gibberish
you may be lucky. If it's homogenous except for the first couple
of 100 bytes you're out of luck.
Whether re-formatting with NTFS *won't* wipe the content I can't
tell, I never tried it ...
The only way I can see of getting the data back is editing the MBR, but I seriously suggest you don't try that unless you're happy with reformatting the drive if you make a mistake...
Once you change a partition type (even if you just define the partition as free space without giving it a different partition type), you can be fairly sure you've lost the data. Obviously this is why you need to backup before doing any work with partitions...
There are some commercial recovery tools that might give you a chance of getting the data back, but I don't know any of them...