Can’t find source of unplugdrive

Forum Forums antiX-development Development Can’t find source of unplugdrive

  • This topic has 39 replies, 9 voices, and was last updated Oct 21-7:55 pm by Robin.
Viewing 10 posts - 31 through 40 (of 40 total)
  • Author
    Posts
  • #61264
    Member
    Robin

      Version update to unplugdrive 0.83

      Bugfixes:
      — true rotational devices do spin down now when user is told it is safe to unplug.
      — speeded up waiting time for write cache sync with device. Turned out on heavy system load the check misses sometimes the moment system reports cache is written, causing our script to wait forever… Fix speeds up waiting time for this noticeably.

      Side effects: As a consequence of this bugfix the default behaviour of unplugdrive had to be changed. Since we simply can’t tell users it is safe to unplug their rotational device while it is still spinning, the default has to take this into account. If user decides on his own not to use safe settings, he can use options.
      So the option -s or –safe-mode is deprecated now, since safe mode is to be default now.

      Instead we see two new options now:
      -u – -unsafe which restores the unsafe behaviour known as default from former versions.
      -i – -ignore doesn’t care of rotationals, even in default mode. This is meant to deal with some unreliable manufacturers, fooling us reporting to system their device was rotational even if this is not true. In case manufacturer have implemented this correctly (completely), the wrong report is acceptable, since these devices do actually react to spindown command with the correct answer (telling “yes, we are spun down” in no time) so everything works fine. But some manufacturers don’t care neither of correct reporting nor of responding to spindown command at all. Which causes system to wait useless 30 seconds for a response which never happens to come. Only in these special cases user may speed up things a little by using -i, knowing what he’s doing.

      Translations:
      Some few new strings for this version are waiting for translation on transifex antiX contribs.

      No need to copy strings 1:1 from ”Pirate English” to true English (en). Only If you want to make improvements to my doggerel original strings, please “translate” the string(s) in question to true English (en), leaving all the fine ones blank. If you want to have different flavours of English please feel free to add strings in en_GB, en_US and other English language flavours.

      Now most of the strings are featured with developers notes and string instructions.

      Download:
      Program script file of unplugdrive ver. 0.83 on gitlab for download.
      Unplugdrive Version 0.83 Language template file (.pot) on gitlab for download.
      Unplugdrive 0.83 German language file (.mo) on gitlab for download.

      Bug reporting:
      As always: Please test this on any kind of plugable storage devices and please report any bugs here. I have myself done testing alredy with all pluggable devices within my reach.
      If no problems show up, I’ll file a merge request for this version to anticapitalista next week.

      Bear in mind, the wellknown “can’t-unmount-when-mountpoint-contains-blank-character” bug isn’t fixed yet in this version. So there is no need to report about this. Bugfix for this will come in next version.

      Have fun with it
      Kind regards
      Robin

      Windows is like a submarine. Open a window and serious problems will start.

      #61270
      Anonymous

        unless Jimmy had chosen the “toram” liveboot option, the boot device should be filtered from the list, eh?
        (I didn’t test. Would umount recognize the boot device as “busy” and refuse to unmount it?)

        .

        http://en.wiktionary.org/wiki/footgun

        footgun (plural footguns)

        (programming slang, humorous, derogatory)
        Any feature whose addition to a product results in the user shooting themselves in the foot.

        #61271
        Member
        Robin

          Good morning skidoo (or hello, since I don’t know which daytime is in your place)

          many thanks for your bug report. I know about this specific problem and have worked on it already. (I never have tried what actually happens if clicking OK in the dialog on your screenshot… since it was obvious to me live medium can only get removed under the condition you described.) But I was also aware of the fact, not all users might see the interdependence, so it is a good idea to prevent them from unplugging their live antiX boot medium. (We really don’t want to footgun antiX users)

          I believe I have found a way to filter these devices from the list presented to user. But this took some major rewriting of the code (which deserves a bit cleanup anyway, all these different lists in use are a thorn in my side, this is legacy still from original script), and the new code is not ready for use by now. My new method filters devices which are storage source file systems of mounted filesystem images from being presented to user for unmounting, displaying them separately as not unmountable for this reason.

          So this will get fixed in one of the next versions also.

          So long and many thanks for testing!

          Windows is like a submarine. Open a window and serious problems will start.

          #62757
          Member
          Robin

            New language files available for unplugdrive ver. 0.83

            Many thanks for the great work of all translators in any languages.

            Language file updates for unplugdrive ver. 0.83 from transifex:
            Greek (el)
            English (en)
            Spanisch (es)
            French (fr)
            Belgian French (fr_BE)
            Portuguese (pt)
            Brasilian Portuguese(pt_BR)
            Russian (ru)
            German (de)

            sha-256-checksums for unplugdrive ver. 0.83:

            f3546e19877a71e473b7ca462a0f027d0e209cf45fc736595771f7006b02341a  unplugdrive.sh
            556ecb616e48a81ec44bc396e109528214d15b8e2a0096e5e3bf99a74de85103  de/unplugdrive.sh.mo
            2bf4dc04725a4c45dc7ded1aab2a2a3b875ae26f743e77a38ce41589c0bcb596  el/unplugdrive.sh.mo
            4be229c3b54f20707a2e38b62898928adf3103315a422a490c67a9d9bc92a093  en/unplugdrive.sh.mo
            b03d0a9bf4061f043021b173c20360d3a44616af1311cdbc30a742d876eba40b  es/unplugdrive.sh.mo
            462abe687ea20c7679ed454ba1534514be46b99e4e1b8ab4d0c2f7d57a163673  fr/unplugdrive.sh.mo
            8c45288ed1be9dd10d449c7258a691a73cb8dfdb39317ff4c5ae761ac8a4081f  fr_BE/unplugdrive.sh.mo
            84b989e6d333bacfca78c2130dc7235de4c86c7451bfdb7d0c7c51e083a59d4c  pt/unplugdrive.sh.mo
            d44d3e0e8e7bba90ba5bee2494cdaec05ab8b76591ebea833988808283ca5c5a  pt_BR/unplugdrive.sh.mo
            d4cb57f9c862b95af365ea2c15d2e70fa5df0432170fedcbe07431d882fbee7a  ru/unplugdrive.sh.mo

            Please note: users of country specific language files (four significant letter code) like e.g. “fr_BE” need to download the base language file (two significant letter code) e.g. “fr” also. Copy these language files to the corresponding system folder
            /usr/share/locale/<language-code>/LC_MESSAGES.

            Hint to English language users: this time there also is an English language file present, which contains some error corrections of original strings. It is recommended to copy the file to its target system folder. This works just like all the other languages also, but contains some few strings only, which get replaced automatically each time when script is run.

            @anticapitalista: merge request on gitlab is filed now.

            Windows is like a submarine. Open a window and serious problems will start.

            #63200
            Member
            Qwerty

              I’m totally not an expert on this topic and it looks like powering modern disks off by unplugging while they’re spinning should be safe at the hardware level anyway, but when it’s about clean and proper procedures, is just “hdparm -Y” really enough? I haven’t found a reliable source of information, but various guides that I read suggested
              echo 1 >/sys/block/.../device/delete
              and some of them
              echo offline >/sys/block/.../device/state
              before that too, but I’m not sure about the full set of actions done by these.

              • This reply was modified 2 years, 12 months ago by Qwerty.
              #63221
              Member
              Robin

                Hello Qwerty,
                thank you very much for your suggestions. You meet my own concerns.

                I haven’t found a reliable source of information

                exactly this is the point. Since I also didn’t and don’t find any clean documentation about these commands (*), I believe it is not a good idea to use them. We need at least to know what exactly they are doing before engaging them.

                it looks like powering modern disks off by unplugging while they’re spinning should be safe at the hardware level

                Even for modern drives: “It looks like…“ isn’t enough. Moreover, this is antiX, and we have to consider users employing older hardware also. We can’t simply say: Let’s hope the users drives won’t get damaged, but we don’t have any clue whether this is true.

                when it’s about clean and proper procedures, is just “hdparm -Y” really enough?

                It’s about protecting users devices. And no, I’m quite sure it is not enough. But it is all I could do by now, since there doesn’t seem to exist any documented command providing a clean shutdown of rotational devices besides of “hdparm -Y”.

                So if you can provide more pieces information about the exact effects and side effects of these commands, this would be a great help.

                Also, any help of specialised experts in this area is highly welcome.

                _____
                (*) Single “official” text I could find about it was from RHEL: Clean storage device removal But it doesn’t give any insights what exactly happens when the commands are performed.

                Windows is like a submarine. Open a window and serious problems will start.

                #69234
                Member
                Robin

                  New version out: unplugdrive 0.89 on gitlab.

                  New in this version:

                  • AntiX boot device will not be longer available for unplugging, it is greyed out now. This goes for any devices being base for nested mounts.
                  • Devices with mountpoints containing blanks are treated correctly now.
                  • Devicelisting and selection are combined in one place now, making it more easy to find what you want at a glance.
                  • A bit of facelifting, carefully, no really great difference in general apperence.
                  • Complete internal restructuring of the code base, getting rid of the multiple redundant listings.
                  • Improved flexibility to add conditions under which a drive is not allowed to get unmounted.

                  Needed: sudo. But there is no need to type your password again and again for this anyway. As written before: I strongly encourage antiX developers simply to add the line

                  %users ALL=(root) NOPASSWD: /usr/local/bin/unplugdrive.sh

                  to the antixers file in /etc/sudoers.d

                  and add an alias to the system defaults:

                  alias unplugdrive='sudo unplugdrive.sh'

                  So you will be able to start the script as used from the versions before 0.82c by typing unplugdrive. Until then you can apply these easy modifications yourself on your own system while using the newer versions of unplugdrive.

                  @anticapitalista : Merge request is sent. @Xecure works right now on a workaround to get rid of the requirement of sudo, which will also function in this new version, as far as I can see. You’ll find the discussion at gitlab.

                  Translations: There are 10 new or altered strings to be translated at antiX-contribs on transifex for the new version.

                  Attachments:

                  Windows is like a submarine. Open a window and serious problems will start.

                  #69305
                  Member
                  Robin

                    Again a version update. Unplugdrive Version 0.90 is available on gitlab.

                    Our good old unplugdrive comes with a new feature. It can handle luks encrypted partitions, they get automatically closed before unmounting the device. Only if this fails, user is asked to close them himself before proceeding. See attached screenshots.

                    You can see which partition is recognised as encrypted in the main selection dialog window. These drives are marked by an aterisk (*) now.

                    9 new strings to translate at antiX-contribs on transifex for this feature. All the existing strings were kept this time.

                    Please let me know whether it works for you, or whether there are any bugs to be fixed.

                    Robin

                    Windows is like a submarine. Open a window and serious problems will start.

                    #69350
                    Member
                    marcelocripe

                      Robin, I know the programming code is in good hands (yours…). The only things that concern me are the spaces available, please consider leaving larger spaces, otherwise the translated texts will not fit. Several sentences in pt-BR received the line break ‘\n’ when they reached the maximum amount of 80 characters.

                      – – – – –

                      Robin, eu sei que o código de programação está em boas mãos (as suas …). As únicas coisas que me preocupam são os espaços disponíveis, por favor, considere deixar espaços maiores, caso contrário os textos traduzidos não caberão. Várias frases em pt-BR receberam a quebra de linha ‘\n’ quando atingiram a quantidade máxima de 80 caracteres.

                      #69365
                      Member
                      Robin

                        Sorry, Mareclo. Bash scripting has nothing in common with a word processing software, where you can freely decide how and where the texts are placed. To achieve something like a design in the output of a program running in bashscript, you have to do some pull-ups and similar contorted manoeuvres. (Otherwise it will give you the feeling of 1980s green monitor and line printer style.) So making an appealing design possible with these restricted tools and their options not only asks some skills from the script writers but also from the translators.
                        But there are ways always to overcome these restrictions.

                        My proposal to you: Please write simply all what is necessary for your language into transifex entries of this script, and don’t care about any line length restriction for now. If you are ready, let me know, then I’ll reformat your translations e.g. by adding some control characters to them, so everything will fit nicely in the respective places. (Yes, this is possible, if you know which arguments may get understood in a specific place by the script code. But it would fill a book if somebody would try to write all this kind of background information about a specific string into the developer notes…)

                        Hope this helps
                        Greetings
                        Robin

                        P.S.: There is the upcoming version 0.91 already present on gitlab for testing. It features both, working with and without sudo, but not all functions will get used by now when not sudoed in some way. As soon Xecure and me will have merged our parallel approaches of solving the need-of-sudo problem, there will come the 0.92 version, which hopefully will bring full functionality for sudo and non-sudo usage, using different methods, each of which has specific advantages and drawbacks. So it is a good idea to let the user have the choice, simply by entering sudo or not in front of the script.

                        Windows is like a submarine. Open a window and serious problems will start.

                      Viewing 10 posts - 31 through 40 (of 40 total)
                      • You must be logged in to reply to this topic.