Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Ok so this might be one of the biggest mistakes I've ever done.
I was going to install Windows 10 on my computer. And as always I remove every drive before installation except the one that I want to install Windows on. BUT somehow I forgot this time.
When i get to the partitioning step during the Windows installation I remove all the partitions as I always do and create a new partition on the installation-disk. I click next and install.
Everything went fine until I noticed that I had forgot to disconnect my 2TB drive of my ext4 partition with all of my family photos, videos etc.
I fucking panic at this time and notice that I removed the partition and in all the panic I deleted the partition again so the system wouldn't write anything to it.
It appears that the Windows installer made a "System Reserved" partition on my 2TB disk..
I boot up on Linux and run testdisk to see if I can restore the partition.
It appears that it finds my old ext4 partition and I proceed to restore it. It asks me to reboot and when I mount the partition after reboot it's the damn System Reserved stuff of 500MB that is there.....
So now my question is. Can I in some way restore my data or at least parts of my data?
If so, how?
Or am I totally screwed here?
Please, any help is appreciated and I'm freakin' desperate!
My wife will kill me if she finds out.
photorec can help, the data that was overwritten is lost. Hard drives die all the time, what was your plan for a hard drive failure?
Thanks, I will try that.
I actually had a valid backup before but it got destroyed. I just got my fiber connection installed and that's was what I was waiting for to upload it on my Google Drive to have it safe..
Those instructions are for a damaged device with unreadable sectors. What you have is a partially overwritten device.
You restored the partition table, but did nothing to restore the filesystem.
Step 1: Use dd to make a full bit-for-bit copy of the 2TB drive. You may need this because the fsck step below has the potential to destroy all chance of recovery if it goes awry.
Step 2: Run testdisk on copy (or on the original drive if you really trust the copy), select "[Advanced] Filesystem Utils", and then "[Superblock]". Note the block number of the first backup super block that was found.
Step 3: Run "fsck.ext4 -y -b NUMBER" on the copy (or on the original -- same caveat as in Step 2), substituting the number found in Step 2. This is preferable to letting fsck.ext4 discover the backup super block on its own, since there is a small chance it could "discover" the wrong thing.
You should get something back. Some high-level directories will almost certainly be lost, but their subdirectories will show up in lost+found, complete with file names. And of course files in that first 500MB will be damaged or destroyed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.