How do I do full disk repairs?

I am trying to find the right command that does full disk repairs to repair the entire disk, regardless how many partitions or what format the partition is (e.g. ext4, ntfs etc). e2fsck only does checks to the specific partition that is in the ext form.

Doing sudo touch /forcefsck only does a check on the root partition. I need something that does a full disk check and I can’t seem to find anything on the Internet. Any suggestions?

What are you trying to achieve?

Are you trying to repair a damaged file system?

Are you attempting to recover files from a physically damaged disk?

Have you checked the Arch Wiki.

My first reply to your initial thread contains links for file system checking, smartmon disk hardware checks, and file recovery if necessary.

What more are you looking for?


it checks and attempts to repair spinning disks bad blocks etc,

There could be bad sectors or something since I can’t seem to resize an encrypted partition, even when I did a scan for that encrypted partition

Is this for SSDs as well?

This is not an indication of a failing disk.

Any smart errors?

sudo smartctl -a /dev/sdXX

No i don’t think so SSDs just die usually with no warnings and must be erased correctly.
They also need regular trimming they all have their own management programs as well

I see

Take a look at this it may help.
https://wiki.archlinux.org/index.php/Solid_state_drive

3 Likes

I thought we had that solved in this thread?

I assume you’re still frantically looking for a way to resize a luks partition with a GUI application, like gparted? :wink:

Anyway, I don’t think your drive/partition actually has any errors (bad sectors) at all.
It’s just that gparted will not resize the luks partition without knowing if the contained filesystem, in your case ext4, is “clean”.

When running sudo e2fsck -f <your opened luks device> manually, the underlying file system is forcibly checked for bad blocks and marked clean. Gparted then allows you to resize this luks partition.

I assume that gparted doesn’t do this needed “forced” check; you’ll just have to live with the manual intervention for now :sob::grin: .

1 Like

Yeah I thought so too :frowning: but during another test after wiping a lot of partitions and creating an encrypted partition, it would not work. even after running the checks you have done. So I assume that perhaps there is an issue with the disk itself, like bad sectors everywhere or whatever.

yep, cause it was working before, and to be honest it is just simply much easier to understand it. I will of course use your method if I really need to (and I did use part of your method before using gparted to fix the partition error) but then if I was not able to use gparted at all, even after attempting to reparir the partition, I assumed something is wrong with the entire disk.

Why would it work before but all of a sudden it did not work?

That is exactly what I did the 2nd time and it still wouldn’t let me resize :frowning:

Yeah true mate, thanks anyways :slight_smile:

Have you ever tried some other GUI partition managers?

I don’t have any personal experience with these, but maybe one of them will get the job done.

1 Like

I never tried them but I can give them a shot if gparted fails. Thanks mate :slight_smile:

Yes, please try :slight_smile: … and report back. May be helpful to a bunch of other users having a gui tool.

1 Like

Sure mate, only that I deleted those VMs but yeah if the issue ever arises, I will give them a try :slight_smile:

:poop: But … then … we may never know?

This question will linger in the background and nag me for some time. It’s something I actually despise about myself; sometimes I have difficulties with unanswered questions … even if it’s someone else’s issue altogether. I may have to try it out myself. :scream: :sweat_smile:

5 Likes

Yeah, I’m like that too. I’m more curious about what caused the problem than about the quickest possible solution.

3 Likes

I will try and simulate it again and cause the issue to happen again, how does that sound, allow some time for me to recreate it.

All good mate, I am like this as well :slight_smile:

1 Like

Very strange what I did to get it to work.

Ok so it is happening again. I tried to repair it via sudo e2fsck -f <partition> and it thinks everything was fine, even though I could not resize it.

The option to resize it was greyed out :frowning: I tried repairing the partition via this program but it did nothing.

Had the same issue just like gparted.

The only way I fixed it was I mounted it to /mnt sudo mount /dev/mapper/<luks encryption name> and then unmounted it sudo umount /dev/mapper/<luks encryption name> and then I used gparted to resize it and it works.

How does this make anysense, how come i have to mount and then unmount it and it now all of a sudden works? This really confuses me?

@unix_lover
There are loads of drive utilities you can download off the internet. Manufacturers of the drives usually provide them plus there are many freeware. Most modern UEFI have this built right in to clear the disc and wipe them clean. You can also use the tools already built into Linux.

https://wiki.archlinux.org/index.php/Securely_wipe_disk#wipe