RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Command to edit file permissions (solved)

    Scheduled Pinned Locked Moved Help and Support
    raspbian
    11 Posts 4 Posters 2.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sirhenrythe5thS
      sirhenrythe5th
      last edited by sirhenrythe5th

      Sorry guys to annoy you with basics: could someone give me the right command to change the permissions of a file?
      I want to get rid of the write protection of the nvrams of Atomiswaves "Metal Slug 6".
      I dont have a PC, so i have to use the terminal on the Pi.
      Would "sudo chmod ugo-rwx [path]" work?

      -- Retro-Achievements Username: SirALX --
      RetroRatio: 1.88
      Started Games beaten: 2,47%
      Site Rank: 4382/93743 ranked users (TOP 4.76%)
      Last seen in [The Legend of Zelda: Lost in Time (HACK) [N64], exploring Hyrule at Night]

      YFZdudeY 1 Reply Last reply Reply Quote 0
      • YFZdudeY
        YFZdude @sirhenrythe5th
        last edited by YFZdude

        @sirhenrythe5th
        I think you have it correct but I wonder if it should be ugo+rwx or ugo=rwx instead since you would be stating either to "add" those permissions or permissions "equal" such and such.

        I only learned the octal form of the command so that would be

        sudo chmod 777 <path/file>

        S 1 Reply Last reply Reply Quote 1
        • S
          sleve_mcdichael @YFZdude
          last edited by sleve_mcdichael

          @yfzdude said in Command to edit file permissions:

          I wonder if it should be ugo+rwx or ugo=rwx instead

          In this case I think they are equivalent, since you are adding or setting all three.

          If a file was r-- and you do a chmod +w it will become rw-. But if you did chmod =w then it would just become -w-.

          When you're doing all three, whether you "set" them or "add" them, the result is still rwx, either way.

          Also you can use a (all) instead of ugo. chmod a+rwx <file>.

          There's no reason nvram should be executable though, right? So you probably want a=rw actually.

          Additionally, (a)ll is the default if none of (u)ser, (g)roup, nor (o)ther are specified so really you can just use =rw.

          Edit: oh I see, @sirhenrythe5th said - and you were suggesting either + or = instead, not suggesting + instead of = like I thought.

          @sirhenrythe5th:

          I want to get rid of the write protection of the nvrams of Atomiswaves "Metal Slug 6".
          I dont have a PC, so i have to use the terminal on the Pi.
          Would "sudo chmod ugo-rwx [path]" work?

          You want to "get rid of the write protection" so it's no longer protected and so after the operation the file will be writable? Or you want to get rid of write permissions so the file becomes read-only? You probably don't want to do -r in either case, as then you wouldn't be able to read from it at all (I think?)

          Use =r or =rw to make it either read-only or read-write, for all users.

          (I just googled this like five minutes ago so don't take my word for it but I think this is how it works.)

          sirhenrythe5thS 1 Reply Last reply Reply Quote 1
          • sirhenrythe5thS
            sirhenrythe5th @sleve_mcdichael
            last edited by

            Thank you both very much, very helpful Information!!!
            You are right, it is not necessary to add executable permissions to the nvram, and as far as no special groups or users are involved the parameter "a" will be perfect.

            By saying "get rid" of write protection i meant that i want to allow the system to write the file.
            Metal Slug 6 has the issue that it only runs once and does not start anymore on further trys.
            I read in another thread here that this is caused by the created nvram-files and can be fixed by either deleting the files after every start, or changing the file permissions to writeable.

            -- Retro-Achievements Username: SirALX --
            RetroRatio: 1.88
            Started Games beaten: 2,47%
            Site Rank: 4382/93743 ranked users (TOP 4.76%)
            Last seen in [The Legend of Zelda: Lost in Time (HACK) [N64], exploring Hyrule at Night]

            Lister of SmegL S 2 Replies Last reply Reply Quote 0
            • Lister of SmegL
              Lister of Smeg @sirhenrythe5th
              last edited by

              @sirhenrythe5th
              probably stating the obvious here but I like the ease of using Pixel desktop for managing files & folders

              2021-09-19-105426_1920x1080_scrot.png

              1 Reply Last reply Reply Quote 1
              • S
                sleve_mcdichael @sirhenrythe5th
                last edited by sleve_mcdichael

                @sirhenrythe5th said in Command to edit file permissions:

                I read in another thread here that this is caused by the created nvram-files and can be fixed by either deleting the files after every start, or changing the file permissions to writeable.

                I've not done this myself but if I'm reading correctly, that thread says to disable the write permissions of the files, that is to say to enable write protection so the file is unwritable and cannot be altered. I think you are supposed to use chmod =r <file> to make it read-only for all users.

                sirhenrythe5thS 1 Reply Last reply Reply Quote 0
                • sirhenrythe5thS
                  sirhenrythe5th @sleve_mcdichael
                  last edited by sirhenrythe5th

                  @sleve_mcdichael sorry, i am not an english native speaker, so i may have problems to explain in the right way.
                  It is all about this thread:
                  https://retropie.org.uk/forum/topic/25835/atomiswave-problems-with-metal-slug-6-and-kof-neowave?_=1632123223808
                  I have this issue running MS6 more than one time and want to do this:

                  *"I figured it out a while ago

                  Run the Atomiswave games once and let it generate the nvmem and nvmem2 files ... play the game for a bit, then exit it.

                  After that, disable Write Permissions and the game will work fine the next time you launch it ... without needing to delete the nvmem and nvmem2 files ever again.

                  With Write Permissions enabled .. the 2nd time you launch the game, it just hangs at the Notice ~ All Backup Data Was Cleared screen.

                  I used WinSCP to disable the Write Permissions for my entire Atomiswave rom folder."*

                  As i dont have a PC, i cannot use SSH, Putty, WinSCP.
                  Thats why i search for the right terminal command.
                  I hope this is more understandable.

                  -- Retro-Achievements Username: SirALX --
                  RetroRatio: 1.88
                  Started Games beaten: 2,47%
                  Site Rank: 4382/93743 ranked users (TOP 4.76%)
                  Last seen in [The Legend of Zelda: Lost in Time (HACK) [N64], exploring Hyrule at Night]

                  YFZdudeY 1 Reply Last reply Reply Quote 0
                  • YFZdudeY
                    YFZdude @sirhenrythe5th
                    last edited by YFZdude

                    @sirhenrythe5th

                    So I think I have the picture now. This is what you would want to do.

                    1. Delete the nvmem and nvmem2 files if they are present and the game isn't running.
                    2. Run the game once so it generates the two files. Then exit to command line.
                    3. Type sudo chmod a-w <path/nvmem> and sudo chmod a-w <path/nvmem2.
                    4. Now it should run each time without problem.

                    The thread mentioned removing the ability for anything to write to the files after they are initially created. It seems the second launch edits the data and causes some kind of corrupted file.

                    sirhenrythe5thS 1 Reply Last reply Reply Quote 1
                    • sirhenrythe5thS
                      sirhenrythe5th @YFZdude
                      last edited by

                      @yfzdude thank you!!! I will do so in the evening :)

                      -- Retro-Achievements Username: SirALX --
                      RetroRatio: 1.88
                      Started Games beaten: 2,47%
                      Site Rank: 4382/93743 ranked users (TOP 4.76%)
                      Last seen in [The Legend of Zelda: Lost in Time (HACK) [N64], exploring Hyrule at Night]

                      sirhenrythe5thS 1 Reply Last reply Reply Quote 0
                      • sirhenrythe5thS
                        sirhenrythe5th @sirhenrythe5th
                        last edited by

                        thanks to everyone: it worked! :D

                        In the end it was not worth the afford, i just run into another issue: when i change settings (language, continues) in the atomiswave-servicemenu and push "save & exit" the whole system freezes :D :D (even with fresh nvrams without changing the permissions).

                        But that is ok, i played around and IMO Metal Slug 6 is not the best part off this series, i ignore it for the moment.

                        I learned new linux-commands and that is good anyway ;)

                        -- Retro-Achievements Username: SirALX --
                        RetroRatio: 1.88
                        Started Games beaten: 2,47%
                        Site Rank: 4382/93743 ranked users (TOP 4.76%)
                        Last seen in [The Legend of Zelda: Lost in Time (HACK) [N64], exploring Hyrule at Night]

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          sleve_mcdichael @sirhenrythe5th
                          last edited by sleve_mcdichael

                          @sirhenrythe5th said in Command to edit file permissions (solved):

                          run into another issue: when i change settings (language, continues) in the atomiswave-servicemenu and push "save & exit"

                          I mean, yeah. You've just made the nvram read-only, and now you're trying to save changes to it. That ain't gonna work. You'd have to do all that before you locked the file, while it was still writable.

                          Oops! Missed the part where you said it even happens without changing the permissions.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.