public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Walter Dnes" <waltdnes@waltdnes.org>
To: Gentoo Users List <gentoo-user@lists.gentoo.org>
Subject: [gentoo-user] OT: mount so that other users can write to mounted dir?
Date: Tue, 22 May 2012 20:26:03 -0400	[thread overview]
Message-ID: <20120523002603.GA4469@waltdnes.org> (raw)

  I'm not really a fan of automount, but I understand that lots of
people are.  I'm trying to get it fully functional under mdev, and then
do a write-up on the wiki page.  A Google search turns up lots of
examples of code.  However, the examples are for embedded devices, and
they assume the only user is root.  I've got the automounting and
autounmounting working.  Everybody can read the mounted USB stick, but
only root can write.  I've tried pmount with the umask option, but it
doesn't help.  Assume the scrpt gets passed MDEV="sdb1"

#
# Create the directory in /media
   mkdir -p /media/${MDEV}
#
# Change permissions to allow read+write by all
   chmod 777 /media/${MDEV}
#
# Mount the directory in /media
   pmount  --noatime --umask 000 /dev/${MDEV}

  But after the mount...
user2@aa1 /media $ ll
total 3
drwxr-xr-x  3 root root 1024 May 22 19:02 .
drwxr-xr-x 19 root root 1024 May 21 20:41 ..
drwxr-xr-x  5 root root 1024 May 16 01:42 sdb1

  Every directory and file belongs to user:group root:root.  On the USB
stick all directories are 755 and files are 744.  As a heavy-handed ugly
hack, I could...

chgrp -R users /media/${MDEV}
chmod -R g+w /media/${MDEV}

to a USB stick.  I obviously don't wnt to do that on the external USB
drive that I rsync my system to every few weeks.  Any ideas?  And oh
yes, I do realize I'm trying to re-invent the wheel.  The old one has
a broken udev :(

-- 
Walter Dnes <waltdnes@waltdnes.org>



             reply	other threads:[~2012-05-23  3:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23  0:26 Walter Dnes [this message]
2012-05-23  0:42 ` [gentoo-user] OT: mount so that other users can write to mounted dir? Alan McKinnon
2012-05-23 23:25   ` Walter Dnes
2012-05-24  7:41   ` Walter Dnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120523002603.GA4469@waltdnes.org \
    --to=waltdnes@waltdnes.org \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox