1. Apophys

    OP Apophys Newbie
    Newcomer

    Joined:
    May 17, 2009
    Messages:
    9
    Country:
    Gambia, The
    Hello,

    I would like to exchange my internal HDD for another one. So a backup was created via payload and system backup. After the new disk was installed, I imported the backup using System Restore. All savegames and settings as well as the previously installed apps are there. But unfortunately the games that were moved via App2USB do not start. Since the links are probably not contained in the database.

    Now my question is how does App2USB work? Games that were moved with the payload will only be displayed in the PS4 system if the USB drive is connected.
    Probably the pkg files are mounted and not linked right? and where does App2USB put this information?
    So it must have something to do with the system files that do not belong to the backup.

    It would also be interesting to know how to change the links / mounts manually.
     
  2. MostlyUnharmful

    MostlyUnharmful GBAtemp Fan
    Member

    Joined:
    Feb 8, 2018
    Messages:
    387
    Country:
    Italy
    What app2usb does it simply moves files from the internal disk to the external USB device and then creates a symbolic link from USB to the original path. App2usb doesn't store the information anywhere, or better it modify the filesystem and for Orbis it appears as a transparent operation, thanks to POSIX. Also it can gracefully recover if for some reasons the external device is not connected, instead of crashing and burning.

    The application is maintained on a public repository, look at the sources, are quite readable and is basically a single file. The function where the magic happens is called "copyFile".

    About the question how to change the links manually, from what I know there isn't a (CLI) shell that you could use on the PS4, so if you want to modify the filesystem you need to build an executable and invoke the syscalls manually. Doable but error prone and tedious if you ask me. If you want to try search some basic C POSIX filesystem manipulation examples, other than the hassle to build it as a PS4 target and requiring netcat every time you need to launch the binary, should be the same experience... ^__^

    I suppose using the OpenOrbis SDK would simplify the task, as you can attach a debugger.


    P.S. there's a Ps4Explorer or similar named application that should be a file browser, but don't know if it could be useful for this task.
     
    Last edited by MostlyUnharmful, Aug 24, 2020
    KiiWii likes this.
  3. Apophys

    OP Apophys Newbie
    Newcomer

    Joined:
    May 17, 2009
    Messages:
    9
    Country:
    Gambia, The
    Thanks for the information, the symbolic links cannot be copied? How can I then replace the internal HDD without having to reinstall all the games that are on the USB HDD?

    Or another scenario, I have two USB HDDs both MOUNT_POINT = 0 in the .ini. (Since I was too stupid to configure it correctly right away) Now I would like to use one of the USB HDDs as MOUNT_POINT = 1 without having to reinstall all the games. How do I do that?
     
    Last edited by Apophys, Aug 24, 2020
  4. MostlyUnharmful

    MostlyUnharmful GBAtemp Fan
    Member

    Joined:
    Feb 8, 2018
    Messages:
    387
    Country:
    Italy
    I guess Sony utilities don't support the option to copy symlinks and I don't know if any 3rd party/homebrew utility is available with that capability, I don't use external disks so never faced the problem.

    If app2usb can't be used in this case, I would say you have two options, you could try mounting the PS4 partition on Linux and use the standard cp, mv, ln commands to manipulate the partition, but right now I'm not bored enough to check if it's feasible (I don't even know if the partition can be mounted RW).

    The other is to get the list of file you want to modify, create a simple C program to "unlink/remove" the files (delete) and then use the "symlink" function to create the symbolic link with the new path. As I wrote above, tedious and errors prone. Ah, you also need to modify the app.db file with the new paths, but that's trivial with an update SQL query...
     
  5. m3inard

    m3inard GBAtemp Regular
    Member

    Joined:
    Aug 28, 2020
    Messages:
    100
    Country:
    Philippines
    i tried cloning but it didn't work.
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - REPLACING, RESTORE, APP2USB