From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SHM42-0003LZ-7r for garchives@archives.gentoo.org; Mon, 09 Apr 2012 21:23:54 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 705E3E0D55; Mon, 9 Apr 2012 21:23:25 +0000 (UTC) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 5C75DE0D49 for ; Mon, 9 Apr 2012 21:22:03 +0000 (UTC) Received: by vbbfc26 with SMTP id fc26so3247422vbb.40 for ; Mon, 09 Apr 2012 14:22:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=zjCox5+GpZQzGffEJkbX0wflasHs/OtyShtm3oAc92A=; b=RC+bT7LVbZoBFcJN488Bi9xSYymyh4oUBGsM9B+NPqFIWrF6l9fzuNAsnPHSu8ZXVl o9SF5eeNs7/qPmuNmj2jZXE9XJ837O7iixKibHC0iae3mX0RuWu77AMVVkJvQVpyfrHQ pWFtiSUOX/hGAxVmC9/kV0bTW1tYfQ+PcJ2yGgKd2nvrjXsQbcY7lJ09UAJtCqybSXEe oU+dEQisbgFaJe8/MuEww/Q3UbmLqWlRERciZpHTJm7TzTY4R+k606JiImNUCP/seUBT HynQZpBOds2+dQpCNPt9xAugOI39oTUX3JyG4j/csNXm693eocL3tnVlxdaCzAiVZv0n 96TQ== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.52.90.20 with SMTP id bs20mr3521556vdb.98.1334006522795; Mon, 09 Apr 2012 14:22:02 -0700 (PDT) Received: by 10.220.193.8 with HTTP; Mon, 9 Apr 2012 14:22:02 -0700 (PDT) In-Reply-To: References: Date: Mon, 9 Apr 2012 14:22:02 -0700 Message-ID: Subject: Re: [gentoo-user] User can mount/umount but not write to top the new drive From: Mark Knecht To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 95cb2f9d-d08e-46c9-baf2-c68734cadb50 X-Archives-Hash: a8d66c9be94b75561078f9f95418aa36 On Mon, Apr 9, 2012 at 1:38 PM, Canek Pel=C3=A1ez Vald=C3=A9s wrote: > On Mon, Apr 9, 2012 at 2:59 PM, Mark Knecht wrote: >> Hi, >> =C2=A0 This has long been a sort of hack area of me in terms of sys admi= n >> at home - giving a user account access to the top of a new external >> drive. I'd like to learn to do this right. Maybe someone can set me >> straight about what root needs to do to make this work. >> >> =C2=A0 OK, so as root I partition & format the USB drive to get it ready= , >> and then I modify fstab with the following addition: >> >> c2stable ~ # cat /etc/fstab | grep VideoLib >> LABEL=3DVideoLib =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/mnt/VideoLib =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 ext3 >> auto,rw,users 0 0 >> c2stable ~ # >> >> =C2=A0 Having done that, as well as making the /mnt/VideoLib mount point= , >> my user account can now mount & umount the drive: >> >> mark@c2stable ~ $ mount /mnt/VideoLib/ >> mark@c2stable ~ $ df -h | grep VideoLib >> /dev/sdf1 =C2=A0 =C2=A0 =C2=A0 458G =C2=A0199M =C2=A0435G =C2=A0 1% /mnt= /VideoLib >> mark@c2stable ~ $ umount /mnt/VideoLib/ >> mark@c2stable ~ $ df -h | grep VideoLib >> mark@c2stable ~ $ >> >> =C2=A0 The problem is that at this point my user account cannot create a >> new directory on that drive: >> >> mark@c2stable ~ $ mount /mnt/VideoLib/ >> mark@c2stable ~ $ df -h | grep VideoLib >> /dev/sdf1 =C2=A0 =C2=A0 =C2=A0 458G =C2=A0199M =C2=A0435G =C2=A0 1% /mnt= /VideoLib >> mark@c2stable ~ $ mkdir /mnt/VideoLib/Video >> mkdir: cannot create directory `/mnt/VideoLib/Video': Permission denied >> mark@c2stable ~ $ >> >> =C2=A0 In the past I've gotten around this by having root mount the driv= e >> and then change ownership to mark:users once it's mounted. Linux >> remembers I've done that once and no longer requires me to do anything >> else as root. >> >> =C2=A0 Is that truly required or is there a way to give the user access = to >> the top of the new mount point without roots' involvement? > > Have you tried: > > # cat /etc/fstab | grep VideoLib > LABEL=3DVideoLib =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/mnt/VideoLib =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 ext3 > auto,rw,users,uid=3DX,gid=3DY 0 0 > > where X is mark's user id, and Y is users' group id? > > On the other hand, do you use a desktop environment? Because GNOME > does everything you want for you, and I suppose KDE does the same. > > Regards. > -- > Canek Pel=C3=A1ez Vald=C3=A9s > Posgrado en Ciencia e Ingenier=C3=ADa de la Computaci=C3=B3n > Universidad Nacional Aut=C3=B3noma de M=C3=A9xico > I had not tried those but they seem to cause problems so clearly I don't have it right yet: c2stable ~ # cat /etc/fstab | grep VideoLib LABEL=3DVideoLib /mnt/VideoLib ext3 auto,rw,users,uid=3D1000,gid=3D100 0 0 c2stable ~ # mark@c2stable ~ $ mount /mnt/VideoLib/ mount: wrong fs type, bad option, bad superblock on /dev/sdf1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so mark@c2stable ~ $ I tried both uid=3DX,gid=3DY and setuid=3DX,setgid=3DY Same results. The man page sure reads like that should work but it didn't. Thanks, Mark