How to mount LVM Volumes with myself as owner in fstab

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite
1












I have two LVM volumes that I'm trying to add to /etc/fstab. I am able to make it work with defaults option, but with that I end up with the mounts being owned by root. I want to mount them so that I'm the owner and don't have to use sudo anytime I'm changing them.



If I try to add uid and gid flags to the fstab entries, I get the following error:



mount: /home/hooda/code: wrong fs type, bad option, bad superblock on /dev/mapper/vg_kdata-kcode, missing codepage or helper program, or other error.


Here are the contents of my /etc/fstab file (note that I already use similar options for regular Windows NTFS volumes, and those are working as expected)



# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p5 during installation
UUID=66e020ab-aa78-4bb9-a625-398f3f8b53b1 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p2 during installation
UUID=28E7-8A33 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
UUID=50F80317F802FACC /media/Games ntfs-3g defaults,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
UUID=5A243C15243BF31D /media/Stuff ntfs-3g defaults,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
UUID=0C640848640836CC /media/Windows ntfs defaults,umask=222,ro,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
/dev/vg_kdata/kcode /home/hooda/code ext4 defaults,uid=1000,gid=1000 0 0
/dev/vg_kdata/kdata /home/hooda/kdata ext4 defaults,uid=1000,gid=1000 0 0


I'm using Kubuntu 18.04.







share|improve this question
























    up vote
    1
    down vote

    favorite
    1












    I have two LVM volumes that I'm trying to add to /etc/fstab. I am able to make it work with defaults option, but with that I end up with the mounts being owned by root. I want to mount them so that I'm the owner and don't have to use sudo anytime I'm changing them.



    If I try to add uid and gid flags to the fstab entries, I get the following error:



    mount: /home/hooda/code: wrong fs type, bad option, bad superblock on /dev/mapper/vg_kdata-kcode, missing codepage or helper program, or other error.


    Here are the contents of my /etc/fstab file (note that I already use similar options for regular Windows NTFS volumes, and those are working as expected)



    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    # / was on /dev/nvme0n1p5 during installation
    UUID=66e020ab-aa78-4bb9-a625-398f3f8b53b1 / ext4 errors=remount-ro 0 1
    # /boot/efi was on /dev/nvme0n1p2 during installation
    UUID=28E7-8A33 /boot/efi vfat umask=0077 0 1
    /swapfile none swap sw 0 0
    UUID=50F80317F802FACC /media/Games ntfs-3g defaults,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
    UUID=5A243C15243BF31D /media/Stuff ntfs-3g defaults,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
    UUID=0C640848640836CC /media/Windows ntfs defaults,umask=222,ro,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
    /dev/vg_kdata/kcode /home/hooda/code ext4 defaults,uid=1000,gid=1000 0 0
    /dev/vg_kdata/kdata /home/hooda/kdata ext4 defaults,uid=1000,gid=1000 0 0


    I'm using Kubuntu 18.04.







    share|improve this question






















      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      I have two LVM volumes that I'm trying to add to /etc/fstab. I am able to make it work with defaults option, but with that I end up with the mounts being owned by root. I want to mount them so that I'm the owner and don't have to use sudo anytime I'm changing them.



      If I try to add uid and gid flags to the fstab entries, I get the following error:



      mount: /home/hooda/code: wrong fs type, bad option, bad superblock on /dev/mapper/vg_kdata-kcode, missing codepage or helper program, or other error.


      Here are the contents of my /etc/fstab file (note that I already use similar options for regular Windows NTFS volumes, and those are working as expected)



      # /etc/fstab: static file system information.
      #
      # Use 'blkid' to print the universally unique identifier for a
      # device; this may be used with UUID= as a more robust way to name devices
      # that works even if disks are added and removed. See fstab(5).
      #
      # <file system> <mount point> <type> <options> <dump> <pass>
      # / was on /dev/nvme0n1p5 during installation
      UUID=66e020ab-aa78-4bb9-a625-398f3f8b53b1 / ext4 errors=remount-ro 0 1
      # /boot/efi was on /dev/nvme0n1p2 during installation
      UUID=28E7-8A33 /boot/efi vfat umask=0077 0 1
      /swapfile none swap sw 0 0
      UUID=50F80317F802FACC /media/Games ntfs-3g defaults,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
      UUID=5A243C15243BF31D /media/Stuff ntfs-3g defaults,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
      UUID=0C640848640836CC /media/Windows ntfs defaults,umask=222,ro,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
      /dev/vg_kdata/kcode /home/hooda/code ext4 defaults,uid=1000,gid=1000 0 0
      /dev/vg_kdata/kdata /home/hooda/kdata ext4 defaults,uid=1000,gid=1000 0 0


      I'm using Kubuntu 18.04.







      share|improve this question












      I have two LVM volumes that I'm trying to add to /etc/fstab. I am able to make it work with defaults option, but with that I end up with the mounts being owned by root. I want to mount them so that I'm the owner and don't have to use sudo anytime I'm changing them.



      If I try to add uid and gid flags to the fstab entries, I get the following error:



      mount: /home/hooda/code: wrong fs type, bad option, bad superblock on /dev/mapper/vg_kdata-kcode, missing codepage or helper program, or other error.


      Here are the contents of my /etc/fstab file (note that I already use similar options for regular Windows NTFS volumes, and those are working as expected)



      # /etc/fstab: static file system information.
      #
      # Use 'blkid' to print the universally unique identifier for a
      # device; this may be used with UUID= as a more robust way to name devices
      # that works even if disks are added and removed. See fstab(5).
      #
      # <file system> <mount point> <type> <options> <dump> <pass>
      # / was on /dev/nvme0n1p5 during installation
      UUID=66e020ab-aa78-4bb9-a625-398f3f8b53b1 / ext4 errors=remount-ro 0 1
      # /boot/efi was on /dev/nvme0n1p2 during installation
      UUID=28E7-8A33 /boot/efi vfat umask=0077 0 1
      /swapfile none swap sw 0 0
      UUID=50F80317F802FACC /media/Games ntfs-3g defaults,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
      UUID=5A243C15243BF31D /media/Stuff ntfs-3g defaults,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
      UUID=0C640848640836CC /media/Windows ntfs defaults,umask=222,ro,windows_names,locale=en_IN.utf8,uid=1000,gid=1000,dmask=027,fmask=137 0 0
      /dev/vg_kdata/kcode /home/hooda/code ext4 defaults,uid=1000,gid=1000 0 0
      /dev/vg_kdata/kdata /home/hooda/kdata ext4 defaults,uid=1000,gid=1000 0 0


      I'm using Kubuntu 18.04.









      share|improve this question











      share|improve this question




      share|improve this question










      asked May 17 at 12:28









      hoodakaushal

      198215




      198215




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          FWIW, I removed the uid and gid options for the LVM volumes, then I tried to do chown on the mount points:



          sudo chown -R hooda:hooda /home/hooda/code


          And so far it seems to be working across mounts.
          Though I'm sure there's a better way to do it. Good enough for me though.






          share|improve this answer
















          • 1




            That is how you do it. uid ang gid is for fat/ntfs . use the user or users option in fstab to allow users (rather than just root) to mount / unmount
            – Panther
            May 17 at 15:09







          • 1




            see manpages.ubuntu.com/manpages/xenial/man5/fstab.5.html and help.ubuntu.com/community/Fstab . For file system specific options see linux.die.net/man/8/mount . It is a long page, scroll down, there are "Filesystem Independent Mount Options" and then "Filesystem Specific Mount Options" by file system (ext2/3/4 , vfat, ntfs, etc). You can use those mount options in the fstab options field per file system
            – Panther
            May 17 at 15:18










          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',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          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%2f1037389%2fhow-to-mount-lvm-volumes-with-myself-as-owner-in-fstab%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote



          accepted










          FWIW, I removed the uid and gid options for the LVM volumes, then I tried to do chown on the mount points:



          sudo chown -R hooda:hooda /home/hooda/code


          And so far it seems to be working across mounts.
          Though I'm sure there's a better way to do it. Good enough for me though.






          share|improve this answer
















          • 1




            That is how you do it. uid ang gid is for fat/ntfs . use the user or users option in fstab to allow users (rather than just root) to mount / unmount
            – Panther
            May 17 at 15:09







          • 1




            see manpages.ubuntu.com/manpages/xenial/man5/fstab.5.html and help.ubuntu.com/community/Fstab . For file system specific options see linux.die.net/man/8/mount . It is a long page, scroll down, there are "Filesystem Independent Mount Options" and then "Filesystem Specific Mount Options" by file system (ext2/3/4 , vfat, ntfs, etc). You can use those mount options in the fstab options field per file system
            – Panther
            May 17 at 15:18














          up vote
          0
          down vote



          accepted










          FWIW, I removed the uid and gid options for the LVM volumes, then I tried to do chown on the mount points:



          sudo chown -R hooda:hooda /home/hooda/code


          And so far it seems to be working across mounts.
          Though I'm sure there's a better way to do it. Good enough for me though.






          share|improve this answer
















          • 1




            That is how you do it. uid ang gid is for fat/ntfs . use the user or users option in fstab to allow users (rather than just root) to mount / unmount
            – Panther
            May 17 at 15:09







          • 1




            see manpages.ubuntu.com/manpages/xenial/man5/fstab.5.html and help.ubuntu.com/community/Fstab . For file system specific options see linux.die.net/man/8/mount . It is a long page, scroll down, there are "Filesystem Independent Mount Options" and then "Filesystem Specific Mount Options" by file system (ext2/3/4 , vfat, ntfs, etc). You can use those mount options in the fstab options field per file system
            – Panther
            May 17 at 15:18












          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          FWIW, I removed the uid and gid options for the LVM volumes, then I tried to do chown on the mount points:



          sudo chown -R hooda:hooda /home/hooda/code


          And so far it seems to be working across mounts.
          Though I'm sure there's a better way to do it. Good enough for me though.






          share|improve this answer












          FWIW, I removed the uid and gid options for the LVM volumes, then I tried to do chown on the mount points:



          sudo chown -R hooda:hooda /home/hooda/code


          And so far it seems to be working across mounts.
          Though I'm sure there's a better way to do it. Good enough for me though.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 17 at 12:39









          hoodakaushal

          198215




          198215







          • 1




            That is how you do it. uid ang gid is for fat/ntfs . use the user or users option in fstab to allow users (rather than just root) to mount / unmount
            – Panther
            May 17 at 15:09







          • 1




            see manpages.ubuntu.com/manpages/xenial/man5/fstab.5.html and help.ubuntu.com/community/Fstab . For file system specific options see linux.die.net/man/8/mount . It is a long page, scroll down, there are "Filesystem Independent Mount Options" and then "Filesystem Specific Mount Options" by file system (ext2/3/4 , vfat, ntfs, etc). You can use those mount options in the fstab options field per file system
            – Panther
            May 17 at 15:18












          • 1




            That is how you do it. uid ang gid is for fat/ntfs . use the user or users option in fstab to allow users (rather than just root) to mount / unmount
            – Panther
            May 17 at 15:09







          • 1




            see manpages.ubuntu.com/manpages/xenial/man5/fstab.5.html and help.ubuntu.com/community/Fstab . For file system specific options see linux.die.net/man/8/mount . It is a long page, scroll down, there are "Filesystem Independent Mount Options" and then "Filesystem Specific Mount Options" by file system (ext2/3/4 , vfat, ntfs, etc). You can use those mount options in the fstab options field per file system
            – Panther
            May 17 at 15:18







          1




          1




          That is how you do it. uid ang gid is for fat/ntfs . use the user or users option in fstab to allow users (rather than just root) to mount / unmount
          – Panther
          May 17 at 15:09





          That is how you do it. uid ang gid is for fat/ntfs . use the user or users option in fstab to allow users (rather than just root) to mount / unmount
          – Panther
          May 17 at 15:09





          1




          1




          see manpages.ubuntu.com/manpages/xenial/man5/fstab.5.html and help.ubuntu.com/community/Fstab . For file system specific options see linux.die.net/man/8/mount . It is a long page, scroll down, there are "Filesystem Independent Mount Options" and then "Filesystem Specific Mount Options" by file system (ext2/3/4 , vfat, ntfs, etc). You can use those mount options in the fstab options field per file system
          – Panther
          May 17 at 15:18




          see manpages.ubuntu.com/manpages/xenial/man5/fstab.5.html and help.ubuntu.com/community/Fstab . For file system specific options see linux.die.net/man/8/mount . It is a long page, scroll down, there are "Filesystem Independent Mount Options" and then "Filesystem Specific Mount Options" by file system (ext2/3/4 , vfat, ntfs, etc). You can use those mount options in the fstab options field per file system
          – Panther
          May 17 at 15:18












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1037389%2fhow-to-mount-lvm-volumes-with-myself-as-owner-in-fstab%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Which professions warranted travel in Medieval times?

          How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

          Trouble downloading packages list due to a “Hash sum mismatch” error