LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-16-2024, 08:50 AM   #1
V_REDFOX
LQ Newbie
 
Registered: Jun 2022
Distribution: Opensuse Tumbleweed
Posts: 7

Rep: Reputation: 0
HDD partition table corrupt after power outage


I run a OMV server for more than 6 months without issues until i accidentally turned off my UPS. After turning the OMV box on I've noticed connection to the server has been severed. After connecting a keyboard and monitor and booting knoppix I noticed the one of the data drives is inaccessible. Gparted reports the following errors Invalid argument during seek for read on /dev/sda and The backup GPT table is corrupt, but the primary OK, so that will be used The gdisk output in the imagehttps://ibb.co/Lt74p0p mentions something about the partition being larger than the drive, not sure if the info is useful but the 4Tb drive in question had been cloned from a 2Tb one with partitions grown to new size. Is there a way to fix this issue without reformating?
 
Old 02-17-2024, 08:43 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
The usually recommended tool for recovering a partition table is testdisk. It's sometimes not the easiest tool to use, but it's quite good at discovering where partitions should be. It's included in the SystemRescue live CD, which is my personal favorite for doing system recovery, disk image backups, etc.
 
1 members found this post helpful.
Old 02-18-2024, 08:02 AM   #3
vasilis74
LQ Newbie
 
Registered: Apr 2020
Distribution: Devuan, Ubuntu, OpenWRT
Posts: 6

Rep: Reputation: 3
I suggest testdisk(terminal application) too. You will have first to understand how it works and be very careful, but it does good job, for partitions reappear and also for saving to other disk the content of corrupted disk (photorec also saves content, same package with testdisk I think). Testdisk is in most Linux repositories also, for if you install your disk in another computer.
I am not sure if you sould select MBR or EFI GPT in testdisk, regarding what I read in your photo, maybe try both.
Visit all testdisk's capabilities, then write to disk!
I wish you luck!
 
1 members found this post helpful.
Old 02-18-2024, 09:53 AM   #4
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,132
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
I'm not sure if this is a new feature or not. I use parted to create my tables/partitions. Recently, while doing some bit-flip testing, when the partition table got corrupted, parted offered to restore a backup of the partition table.
 
1 members found this post helpful.
Old 02-18-2024, 10:59 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
testdisk is the usual answer, but given it's a data drive, and probably a single partition, I'd just do as gdisk states. Delete the partition from say parted, then fire gdisk back up and let it do its stuff. When all is clean, allocate a partition over the entirety of the remainder of the disk.
Simple.
 
1 members found this post helpful.
Old 02-22-2024, 03:31 PM   #6
V_REDFOX
LQ Newbie
 
Registered: Jun 2022
Distribution: Opensuse Tumbleweed
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks to everybody for your replies, I used testdisk to recover data and configs from data drive but it turned out the system drive, although seemed to be ok (it mounted without errors and seemed to be readable at first glance) was also corrupted, i could not access some folders from a live media and testdisk showed errors when recovering files.

But luckily i have recovered the important data on these drives - docker config folder and compose stacks, the most important data i have are my photo/video gallery and my documents, but they are stored on my pc, on two drives on the server that suffered the outage, and a secondary mini pc that is used mainly for backups and data sync.

P.S. - I have added a separate physical drive to store docker configs so i can make drive image backups for the worst case scenario like i have experienced.

Last edited by V_REDFOX; 02-22-2024 at 03:36 PM.
 
Old 02-22-2024, 07:45 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
I think Ranish has updated the program maybe look for it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to avoid corrupt drives if power outage is a huge issue? jwiggins Linux - Newbie 5 07-18-2014 09:35 PM
dd to smaller partition gives corrupt superblock or partition table manscher Linux - General 5 07-10-2014 04:18 AM
LVM partition lost after power outage Dagwyn Linux - Software 3 10-30-2008 06:09 AM
Repair Questions after Power Outage Cynthia Blue Linux - Newbie 1 12-28-2003 11:31 AM
XServer not starting after power outage jcksrobbins Linux - General 2 08-24-2003 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration