Testdisk Showed Me the Problem, But I Can't Fix It.

Using TestDisk to repair the filesystem
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Posts: 1
Joined: 13 May 2016, 17:27

Testdisk Showed Me the Problem, But I Can't Fix It.

#1 Post by NedRed »

The problem is a bunch of undeleted superblocks left by deleted partitions as I've restructured the drive from time to time. Since all the files systems now use short dynamic formatting now, the superblocks are left behind, instead of being overwritten as happened previously when the partitions were reformatted throughout.

But that took a long time, which got longer as drives got larger. I estimate that it takes about an hour to reformat about 10 GBs of disk space, or ten hours to do a 1TB hdd.

Testdiak ia a great help in pinpointing superblocks all over if i do a deeper search. But among these are found remnants from old partitions that are now gone. I can write a new partition table, but what about all the superblocks that are now obsolete? Depending on where the start is or was for the new and old partitions, they can interlace on the screen during the deeper search. But i see no way to mark them for deletion or have them deleted.

This is not my area of expertise, and I know no way to force a full format. It should not be necessary anyway, as all that needs to be done is overwrite the defunct superblock sectors, right? Or a part of them anyway, enought so that they are not seen as superblocks anymore.

It's my impression that normal reads and writes akirt or skip superblocks without regare to their placement or content. Properly done, these in the wrong places should flag them for overwrites regardless. Another approach is to datetime stamp them when uperblocks are in dispute.

Testdisk does a great job of showing you when you have a proper lineup of the found likely partitions. I shows you when they don't fit together as they should and there is an overlap. gparted also does a good ahowing of the right partition structure and warns you of overlaps, but it does not go into details. It depends on gpart for a read only view inside the partitons, which is sometimes enough to access the partition's contents after you mount it. . Get it right, then write it as the new partition table would be my thought. But Testdisk says a reboot is necessary at that point. I'm not sure why,

Since Ubuntu 14.04 LTS I have been getting partitions and drives corrupted, even from running off the LiveCD. With 14.04, I found three was to trigger a corruption even, With 15.10, I didn't have to try, it just kept happening. I lost 6 or seven partitions early on. That's on 4 drives and 3 PCs. I'm still struggling to get back to normal. It's been months of effort just to hang in there.

Ubuntu-Gnome 16.04 has proved to be the worse yet experienced. None of the partitions types the installer hype work if implemented. I have to use gparted under Try to preformat them then attempt the install, but with jfs, even that does not work. The Ext2/3/4 efforts fail, the FAT32 and NTFS don;t work either, and it seems hopeless. Worse yet, it's gparted may offer more choices, but the installer does not work with them. No real consistency there.

It means I am off Ubuntu for awhile. I am currently taking a stab with SparkyLinux Rescue iso 4.1. It's a minimal system, but you really only need to get it installed, add in some more Repositories, add some scripting to install more packages, and make it fly. At least it comes prepared to recover or restore drives and paritions or recover data, which other packages don't do. And for the first time I see a ray of hope, as whatever plagued Ubuntu does not seem evident on this Debian cousin. But it is early in the battle, and no real exposure to it yet.

What it doesn't offer is a way to work with the drives via the GUI as to mounting them or examining their content. As a fallback, I have Ubuntu 8.04 up to 12.04 on DVDz, as there were no real complaints about these at the time. No actual installs until I get these drives tamed and my one good partition backed up in spades. Hope that day is soon.

Like I said though, it mostly seems ro be the partitions getting cross-threaded, and maybe I know why now. But whar can I do about it? I'm ready to try anything.

Sponsored links

Posts: 7
Joined: 14 Feb 2016, 06:47

Re: Testdisk Showed Me the Problem, But I Can't Fix It.

#2 Post by oldefoxx »

I can see that. Go deep and lots of different superblocks show up on the drive, and they don't work together and even interlace like you said. I use different partition names when I delete and recreate a partition, so the labels appear in square brackes on the right, and I can tell that way which ones are current, but there seems to be no other way to be sure.

Real problem is, if these superblocks linger as they do, and nothing testdisk does in the present or past runs cause them to change or go away,, then I have superblocks from the initial buy when it was almost all NTFS and I deleted that and made it a couple of EXT4 partitions instead. I guess the only safe thing to do is not change partitions but reformat it to something else where it is, and hole the new superblocs overwrite the old ones. That kind of makes it a hazard to try and use old drives over, doesn't it?

But a question that comes up is, are all partitions the same when it comes to placement from the leading edge of a new partition? If I just reformat NTFS as RXT4, will that overwrite all the existing superblocks in that partition?

Another question: I see a lot of small leading leading FAT32 partitions on the drives I get, and even run into them other places, even if the drives is for Linux. Is there a reason for that? Do you really have to have one? An older removable drive has two conflicting FAT32 superblocks up front, but they aren't the same, and one appears twice. Is that because the partition was resized or moved? That could make it even worse if that is true I guess.

Last question on this subject: Is there a tool available that wiill selectively overwrite existing superblocks? Like after a new partition table is generated and there are no partitions left? Or a tool that will go through a partition to remove its superblocks when gparted or some other method is used to delete a partition? I.m trying to learn all the disk-related tools in Linux and there are a bunch, and some do things like delete partition, but there is no discussion of superblocks. Just taking the partition table down or marking it as unassigned in an existing table does not render it gone, now when the data and the superblocks are left behind.

I tried formatting a partition as EXT3 instead of EXT4. and while that took time as it apparently went and checked the whole partition or did something, fsck immediately found it bad and got locked up in a real fight with it. Looked like EXT4 was running the show. So how did they do it before EXT4 took over? Can we do it that way again?

The way you write looks like my brother's. It's a lot like mine. Makes me wonder. If it's you, contact me. Can't find you (or him) online. If it is not you/him, sorry for the inconvenience of asking. If it is you/him, you might have some explaining to do. You don't have to if that would keep you from responding. It's been over 2 years, and I am tired of searching online.

I got my own bug to write up. You can't find a bug report link on this site, but they brag that they are fixing bugs in new releases. What's the connection there? Where did they get those bug reports from? just internal feedback? That was my last question here. Bye.