udev not updating usb permissions and group












1















I am using ubuntu 10.04 LTS - Locid Lynx. I have a requirement to set specific group and permissions for any usb stick file/directories on mount. I have tried overwriting the udev rules. Here is what I have done:




  1. Created 99-test.rules under /etc/udev/rules.d/ directory with content as SUBSYSTEMS=="usb",GROUP="tomcat6",MODE="0777",NAME="test"

  2. sudo service udev restart


Now when I mount the usb stick and run 'sudo blkid', it prints



/dev/test: UUID="002A-0AA5" TYPE="vfat"


But the ls -l /media/ gives back



drwx------ 4 admin admin 8192 1969-12-31 16:00 002A-0AA5


It seems that above rule from 99-test.rules is getting applied but getting overwritten afterwards, thus changing group and permissions back to some default value. What is it I am missing here? Do I have to change anything else?










share|improve this question














bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • An aside: I gather from the name that you are testing this rule, but before you actually put it in place you might want to add something like KERNEL=="sd?1" so it does only apply to USB storage devices (and not cameras, audio devices, etc).

    – John S Gruber
    Aug 13 '12 at 17:36
















1















I am using ubuntu 10.04 LTS - Locid Lynx. I have a requirement to set specific group and permissions for any usb stick file/directories on mount. I have tried overwriting the udev rules. Here is what I have done:




  1. Created 99-test.rules under /etc/udev/rules.d/ directory with content as SUBSYSTEMS=="usb",GROUP="tomcat6",MODE="0777",NAME="test"

  2. sudo service udev restart


Now when I mount the usb stick and run 'sudo blkid', it prints



/dev/test: UUID="002A-0AA5" TYPE="vfat"


But the ls -l /media/ gives back



drwx------ 4 admin admin 8192 1969-12-31 16:00 002A-0AA5


It seems that above rule from 99-test.rules is getting applied but getting overwritten afterwards, thus changing group and permissions back to some default value. What is it I am missing here? Do I have to change anything else?










share|improve this question














bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • An aside: I gather from the name that you are testing this rule, but before you actually put it in place you might want to add something like KERNEL=="sd?1" so it does only apply to USB storage devices (and not cameras, audio devices, etc).

    – John S Gruber
    Aug 13 '12 at 17:36














1












1








1








I am using ubuntu 10.04 LTS - Locid Lynx. I have a requirement to set specific group and permissions for any usb stick file/directories on mount. I have tried overwriting the udev rules. Here is what I have done:




  1. Created 99-test.rules under /etc/udev/rules.d/ directory with content as SUBSYSTEMS=="usb",GROUP="tomcat6",MODE="0777",NAME="test"

  2. sudo service udev restart


Now when I mount the usb stick and run 'sudo blkid', it prints



/dev/test: UUID="002A-0AA5" TYPE="vfat"


But the ls -l /media/ gives back



drwx------ 4 admin admin 8192 1969-12-31 16:00 002A-0AA5


It seems that above rule from 99-test.rules is getting applied but getting overwritten afterwards, thus changing group and permissions back to some default value. What is it I am missing here? Do I have to change anything else?










share|improve this question














I am using ubuntu 10.04 LTS - Locid Lynx. I have a requirement to set specific group and permissions for any usb stick file/directories on mount. I have tried overwriting the udev rules. Here is what I have done:




  1. Created 99-test.rules under /etc/udev/rules.d/ directory with content as SUBSYSTEMS=="usb",GROUP="tomcat6",MODE="0777",NAME="test"

  2. sudo service udev restart


Now when I mount the usb stick and run 'sudo blkid', it prints



/dev/test: UUID="002A-0AA5" TYPE="vfat"


But the ls -l /media/ gives back



drwx------ 4 admin admin 8192 1969-12-31 16:00 002A-0AA5


It seems that above rule from 99-test.rules is getting applied but getting overwritten afterwards, thus changing group and permissions back to some default value. What is it I am missing here? Do I have to change anything else?







usb permissions udev






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 13 '12 at 9:36









KushalKushal

612




612





bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • An aside: I gather from the name that you are testing this rule, but before you actually put it in place you might want to add something like KERNEL=="sd?1" so it does only apply to USB storage devices (and not cameras, audio devices, etc).

    – John S Gruber
    Aug 13 '12 at 17:36



















  • An aside: I gather from the name that you are testing this rule, but before you actually put it in place you might want to add something like KERNEL=="sd?1" so it does only apply to USB storage devices (and not cameras, audio devices, etc).

    – John S Gruber
    Aug 13 '12 at 17:36

















An aside: I gather from the name that you are testing this rule, but before you actually put it in place you might want to add something like KERNEL=="sd?1" so it does only apply to USB storage devices (and not cameras, audio devices, etc).

– John S Gruber
Aug 13 '12 at 17:36





An aside: I gather from the name that you are testing this rule, but before you actually put it in place you might want to add something like KERNEL=="sd?1" so it does only apply to USB storage devices (and not cameras, audio devices, etc).

– John S Gruber
Aug 13 '12 at 17:36










2 Answers
2






active

oldest

votes


















0














This works for me:



SUBSYSTEMS=="usb",KERNEL=="sd?1",GROUP="adm",MODE="0777",SYMLINK+="test"



  • I don't know why, but ACTION== stopped the rule from working at all.


  • The kernel rule was necessary to avoid a conflict between the stick and the stick's partition, I suspect that was the problem you were seeing.


  • The symlink is to get rid of an error message about a conflict between the kernel device name and the rule device name. You get a /dev/test that has a symlink to /dev/sdb1, or such.



On 12.04 restarting udev wasn't necessary when testing the rule. Error messages were logged at /var/log/syslog, so I used tail -f /var/log/syslog as I mounted the USB drive to watch for them.



You may wish to add more tests so you can limit your rule to just the drive(s) you want /dev/test to map to in case you might plug a camera or other device in simultaneously with you memory stick.






share|improve this answer

































    0














    Try to add ACTION=="add" as trigger for that rule.






    share|improve this answer

























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f175245%2fudev-not-updating-usb-permissions-and-group%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      This works for me:



      SUBSYSTEMS=="usb",KERNEL=="sd?1",GROUP="adm",MODE="0777",SYMLINK+="test"



      • I don't know why, but ACTION== stopped the rule from working at all.


      • The kernel rule was necessary to avoid a conflict between the stick and the stick's partition, I suspect that was the problem you were seeing.


      • The symlink is to get rid of an error message about a conflict between the kernel device name and the rule device name. You get a /dev/test that has a symlink to /dev/sdb1, or such.



      On 12.04 restarting udev wasn't necessary when testing the rule. Error messages were logged at /var/log/syslog, so I used tail -f /var/log/syslog as I mounted the USB drive to watch for them.



      You may wish to add more tests so you can limit your rule to just the drive(s) you want /dev/test to map to in case you might plug a camera or other device in simultaneously with you memory stick.






      share|improve this answer






























        0














        This works for me:



        SUBSYSTEMS=="usb",KERNEL=="sd?1",GROUP="adm",MODE="0777",SYMLINK+="test"



        • I don't know why, but ACTION== stopped the rule from working at all.


        • The kernel rule was necessary to avoid a conflict between the stick and the stick's partition, I suspect that was the problem you were seeing.


        • The symlink is to get rid of an error message about a conflict between the kernel device name and the rule device name. You get a /dev/test that has a symlink to /dev/sdb1, or such.



        On 12.04 restarting udev wasn't necessary when testing the rule. Error messages were logged at /var/log/syslog, so I used tail -f /var/log/syslog as I mounted the USB drive to watch for them.



        You may wish to add more tests so you can limit your rule to just the drive(s) you want /dev/test to map to in case you might plug a camera or other device in simultaneously with you memory stick.






        share|improve this answer




























          0












          0








          0







          This works for me:



          SUBSYSTEMS=="usb",KERNEL=="sd?1",GROUP="adm",MODE="0777",SYMLINK+="test"



          • I don't know why, but ACTION== stopped the rule from working at all.


          • The kernel rule was necessary to avoid a conflict between the stick and the stick's partition, I suspect that was the problem you were seeing.


          • The symlink is to get rid of an error message about a conflict between the kernel device name and the rule device name. You get a /dev/test that has a symlink to /dev/sdb1, or such.



          On 12.04 restarting udev wasn't necessary when testing the rule. Error messages were logged at /var/log/syslog, so I used tail -f /var/log/syslog as I mounted the USB drive to watch for them.



          You may wish to add more tests so you can limit your rule to just the drive(s) you want /dev/test to map to in case you might plug a camera or other device in simultaneously with you memory stick.






          share|improve this answer















          This works for me:



          SUBSYSTEMS=="usb",KERNEL=="sd?1",GROUP="adm",MODE="0777",SYMLINK+="test"



          • I don't know why, but ACTION== stopped the rule from working at all.


          • The kernel rule was necessary to avoid a conflict between the stick and the stick's partition, I suspect that was the problem you were seeing.


          • The symlink is to get rid of an error message about a conflict between the kernel device name and the rule device name. You get a /dev/test that has a symlink to /dev/sdb1, or such.



          On 12.04 restarting udev wasn't necessary when testing the rule. Error messages were logged at /var/log/syslog, so I used tail -f /var/log/syslog as I mounted the USB drive to watch for them.



          You may wish to add more tests so you can limit your rule to just the drive(s) you want /dev/test to map to in case you might plug a camera or other device in simultaneously with you memory stick.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 14 '12 at 2:33

























          answered Aug 13 '12 at 18:47









          John S GruberJohn S Gruber

          11.6k32959




          11.6k32959

























              0














              Try to add ACTION=="add" as trigger for that rule.






              share|improve this answer






























                0














                Try to add ACTION=="add" as trigger for that rule.






                share|improve this answer




























                  0












                  0








                  0







                  Try to add ACTION=="add" as trigger for that rule.






                  share|improve this answer















                  Try to add ACTION=="add" as trigger for that rule.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Sep 19 '12 at 13:30









                  Peachy

                  5,03672843




                  5,03672843










                  answered Aug 13 '12 at 13:01









                  Thomas SchmittThomas Schmitt

                  684




                  684






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f175245%2fudev-not-updating-usb-permissions-and-group%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How did Captain America manage to do this?

                      迪纳利

                      南乌拉尔铁路局