0

To better explain what is wrong now with my harddisk let me tell you the series of events:

I was trying to expand a CentOS root partition. In order to do that I first tried to unmount and remove the home partition (where the free storage was avaialble) after data backup. I was able to unmount the partition but facing some issues while removing the home partition.

Frustrated me, despite all the warnings that an XFS file system can not be shrunk, I tried lvreduce on home partition thinking that it will produce some error. But it did not. So now I tried expanding the root partition to see what happens and ended up corrupting the both partitions. I was receiving Invalid magic number in superblock error message while mounting.

I was able to xfs_repair home partition but there was some permission issues when trying the same on root. Meanwhile I tried some solution on some blog online and accidentally changed the partition type to ext4 and now I can access the root partition but there is no data in it.

Is there anyway I can recover the data in root partition now?

4
  • mabey testdisk will help if you have another disk with equal or greater volume to restore to, but ... Commented Oct 5, 2021 at 22:58
  • @FrankThomas I have already tried testdisk but it says it does not support xfs currently. And, is there anything you wrote after "but..."? Commented Oct 6, 2021 at 9:05
  • My take is your filesystem metadata is hosed beyond recovery. your raw data is likely intact but if the filesystem metadata has been overwritten, only file-carving utilites like photorec or recuva or easus will be able to recover the data, and critical information like file names and locations in folder hierarchies will be lost. additionally file carving utilities will only work for text or know filetypes with predictable binary layouts (headers and footers or length metadata). the degree to which your filesystem data has been overwritten may vary by FS type, so give it a try but... Commented Oct 7, 2021 at 4:29
  • look at it this way; you saved your home, so your content is safe. only your system configuration would be lost if you choose to reinstall. I would backup your content though, slick the disk, and create a new home partition, restoring the files into it. it is not certian your repairs to /home are complete (just sufficient) so the cautious route is to put this mad quest behind you once and for all with a new partition. Commented Oct 7, 2021 at 4:33

0

You must log in to answer this question.

Browse other questions tagged .