0

By GNU parted I created new DOS partition table, one partition and by mkfs.ext2 ext2 file system on that partition. I copied some files to that partition. After that I again created new DOS partition table, one partition and ext2 file system on the same HDD. When I mounted this partition some files still was there. Is it possible that files survive partition and file system recreation?

  • Can you be more clear ? – mkmayank May 8 '19 at 10:08
  • I think you didn't make the new filesystem exactly where it was, but after that disk area with overlapping. But the non-overlapping part of the old disk area is still marked as another new partition. So you just mounted a broken ext2. – 炸鱼薯条德里克 May 8 '19 at 11:49
1

Yes it's possible if you delete and re-create your partition from the exact same sector. The system does not a "full format" when you create your file system. By the way, you can do the same to extend a partition. Delete and recreate it starting from the same sector and ending on a further one

| improve this answer | |
  • But wouldn't mkfs.ext2 mark all the filesystem blocks of those files as available? And the inode table should be cleared. – 炸鱼薯条德里克 May 8 '19 at 11:43
  • Honestly, I'm not sure. In my case I found files back on an XFS disk coming from a RAID array and after creating a new partition table, partition and mkfs.xfs. – darxmurf May 9 '19 at 5:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.