Recover lost PFS3/SFS partitions?
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    I wiped out my MorphOS installation on my PowerBook by accident and overwrote the entire SSD with a Linux installation. :(

    Can someone please help me recover some files that I don't have backups of?

    My system partition was SFS and my data was on a PFS3 partition.

    I'm not too bothered about the system partition and SFSDoctor was no help at all, but I really need to recover some files from the PFS partition and PFSDoctor was even less helpful.

    Is there any chance I can get back these files or are they lost for good?
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »18.12.13 - 23:49
    Profile
  • Caterpillar
    Caterpillar
    Thomas
    Posts: 31 from 2004/3/31
    Please give more details about what you did. What was the partition layout before, what is the partition layout now and where did you install Linux to?

    You can only recover data which has not been overwritten. If you deleted the existing partitions and installed Linux in the same place, then everything is lost. Only if the area on the harddrive where the PFS partitions was has not been touched, there is a chance to recover something.

    Especially the beginning of the partition has to be untouched because PFS concentrates all meta data at the first part of the partition.
  • »19.12.13 - 07:39
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    Hi Thomas,

    Before this the layout was

    1MB Newworld boot partition
    512MB HFS partition for boot.img
    2GB SFS partition for System:
    40GB PFS3 partition for Work:
    15GB EXT4 partition for /
    1.5GB Linux swap partition

    I ran the Ubuntu installer from the live cd and told it to format the existing ext4 partition. The installer segfaulted so I ran it again and chose the option to reinstall over existing installation, but it didn't do what I assumed it would do and instead it wiped the entire partition map and created:

    1MB Newworld boot partition
    57MB EXT4 /
    2.5GB Swap partition

    The new ext4 partition has 3.16GB of data installed to it so I guess it has overwritten the PFS metadata at the beginning of the old partition. :(

    I'm open to all suggestions that might help me recover my sourcecode though.
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »19.12.13 - 11:22
    Profile
  • MorphOS Developer
    Henes
    Posts: 507 from 2003/6/14
    You can try to recreate the exact same partition map. With every partition located at the exact same position as the old ones. Byte for byte. Easier said than done...
    Then run sfsdoctor and pfsdoctor over them.
  • »19.12.13 - 11:50
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    Quote:

    Henes wrote:
    You can try to recreate the exact same partition map. With every partition located at the exact same position as the old ones. Byte for byte. Easier said than done...
    Then run sfsdoctor and pfsdoctor over them.



    Unfortunately I can't remember the exact layout, there were a few zero or almost zero byte empty partitions between a few of them for some unknown reason.

    I'll have a go though and see what happens, I'll dd the entire disk and try searching for certain strings with a hex editor as well.
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »19.12.13 - 12:05
    Profile
  • Caterpillar
    Caterpillar
    Thomas
    Posts: 31 from 2004/3/31
    Quote:

    The new ext4 partition has 3.16GB of data installed to it so I guess it has overwritten the PFS metadata at the beginning of the old partition. :(



    Yes, that's bad.

    PFS reserves a certain percentage in the beginning of a partition for its directory and begins behind that with storing data.

    So if the PFS and the EXT4 partition start at about the same place, it's rather unlikely that something can still be found if the PFS partition was not filled with at least 3 GB of data and the files you are looking for are young enough to be stored later than the first 3 GB of the partition.

    Given that the directory has been overwritten completely, searching for strings in the disk dump is probably your only option. Be prepared that you really only find file contents or fragments of file contents. All meta data was stored in the directory area. There is no information in the data area about which file a piece of data belonged to or where another fragment of a fragmented file could be located or in which order fragments were stored. You won't even find file names.



    [ Edited by Thomas 19.12.2013 - 13:43 ]
  • »19.12.13 - 12:42
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    There was at least 10GB of data on the PFS partition so I'm hoping the files I need are after the 3GB of ext4 data and are in one consecutive block of bytes.

    I took a backup last week but I made quite a lot of changes in the last couple of days and I really don't want to recreate those changes from my memory unless I really have to. :/

    I think I'm going to work on remote copies from now on.

    Is there an sshfs for filesysbox yet? I volunteer to be a beta tester if testers are needed.
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »19.12.13 - 13:18
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    Spent the last few days trying to recover stuff and managed to rescue a big fat zero, so will have to manage with my backup from a week ago.

    Ah well, we live and learn. :/

    [ Edited by Intuition 22.12.2013 - 17:33 ]
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »22.12.13 - 17:28
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    Just for the record:
    diskvalid (not included in MorphOS) may give better/other results than PFSDoctor...
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »12.11.20 - 11:21
    Profile
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    @polluks

    No, DiskValid can't help any better than PFSDoctor when nearly third of the data is overwritten.
  • »12.11.20 - 13:02
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    At least PFSDoctor asserts my partition is fine.
    But DiskValid says
    Code:
    starting directory tree check
    error: New_Work:Gits/goattracker2-code/goattrk2/branches/2.72_MacOSX/src/.svn/tmp/text-base(0xe690006;0xe690005) invalid filename
    error: New_Work:Gits/goattracker2-code/goattrk2/branches/2.72_MacOSX/src/.svn/tmp/text-base(0xe690006;0xe690005) invalid filename
    finished directory tree check
    encountered 2 errors
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »12.11.20 - 18:33
    Profile
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    I'm not certain it's a positive sign that the tool finds errors the other one doesn't.

    Either way, no tool (diskvalid or pfsdoctor) can recovered data that has been overwritten. Frequent backups are the only remedy against this.
  • »12.11.20 - 19:10
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    Quote:

    Piru schrieb:
    I'm not certain it's a positive sign that the tool finds errors the other one doesn't.

    Depending on if this bug is critical...
    Quote:

    Piru schrieb:
    Either way, no tool (diskvalid or pfsdoctor) can recovered data that has been overwritten. Frequent backups are the only remedy against this.

    sure
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »14.11.20 - 21:05
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    KennyR
    Posts: 878 from 2003/3/4
    From: #AmigaZeux, Gu...
    Quote:

    Intuition wrote:
    Spent the last few days trying to recover stuff and managed to rescue a big fat zero, so will have to manage with my backup from a week ago.

    Ah well, we live and learn. :/


    You are lucky (and smart) you have a backup from just a week ago. On Amiga I deleted a partition trying Linux APUS in 2002, and never got anything back. Tons of mods and PD stuff, hundreds of demos that came with my HDD, thousands of hours getting my desktop to exactly how I liked with icons and app setups, AmigaZeux IRC logs, pictures, documents... I never managed to find most of the lost files again, and never bothered configuring AmigaOS again.

    Did exactly the same on MorphOS years later, and once again I never quite ever had the heart to restore everying I'd lost. I just left it in an unconfigured mess to present day.

    Backup backup backup backup...

    [ Edited by KennyR 18.11.2020 - 21:58 ]
  • »18.11.20 - 21:55
    Profile