USB drive - ext4 partitions are mounted as root:root

Hi,

I have a USB stick which holds three partitions

  1. An ext4 partition
  2. An encrypted ext4 partition
  3. A vfat partition

I’m mounting these using KDE ( but the same happened from within Gnome ) and the uid/gid for the ext4 partitions are set to root, making them unusable for me. The vfat one is mounted for my user though:

drwxr-xr-x 4 root root 4096 Jun 14 09:46 6c4601aa-71a4-4bea-b698-5f30dab503ab
drwxr-xr-x 5 root root 1024 Jun 10 16:34 9a51571f-519d-4a18-8b74-5f490f8f25c5
drwx------ 9 rmuntean users 6384 Jan 1 1970 CF64-626F

How can I mount the ext4 partitions and have write access to them?

Thanks,

Robert

As you do not post the complete “prompt-command-output-prompt” sequence we can not see what exactly and from where you show. (and please use CODE tags around copiued/pasted computer text, it is the # button in the tool bar).

Is there something on those file systems? And when yes, who created (and thus owns) those directories/files?

Here’s the complete output, I was simplifying it a bit.


DOMAIN\rmuntean@rmuntean-w7:/var/run/media/DOMAIN\rmuntean> ll
total 21
drwxr-xr-x 4 root              root                   4096 Jun 14 09:46 6c4601aa-71a4-4bea-b698-5f30dab503ab
drwxr-xr-x 5 root              root                   1024 Jun 10 16:34 9a51571f-519d-4a18-8b74-5f490f8f25c5
drwx------ 9 DOMAIN\rmuntean DOMAIN\domain users 16384 Jan  1  1970 CF64-626F

Well, it behaves just like any other ext4 partition. There’s a lost+found directory, and if I use sudo to create directories and assign them back to me it’s fine. But what I want is to be able to create top-level directories without needing to use sudo.


DOMAIN\rmuntean@rmuntean-w7:/var/run/media/DOMAIN\rmuntean/6c4601aa-71a4-4bea-b698-5f30dab503ab> ll
total 920804
drwxr-xr-x 2              1000 root                       4096 Jun 14 09:21 asd
drwxr-xr-x 2 DOMAIN\rmuntean DOMAIN\domain users      4096 Aug  6 12:18 blah
-rw-r--r-- 1 root              root                  942871383 Jun 14 09:49 hoi3.tar.cz
drwx------ 2 root              root                      16384 Jun 14 09:18 lost+found

On 08/06/2013 11:26 AM, robert munteanu wrote:
>
> DOMAIN\rmuntean@rmuntean-w7:/var/run/media/DOMAIN\rmuntean> ll
> total 21

ok, i suspect Henk is as confused as i am because so far what have
showed us make no sense…so, lets begin again:

-what operating system and version are you using

-have you recently run in all of the updates (via YaST Online Update,
zypper or what?)

-if using a desktop environment, please tell us its name and version

-and, if you boot the machine without the USB plugged in…and, then
after the system is completely up and running and then you plug in
the USB, do you find that the system automatically signals you (with
a pop-up) that something has been plugged in and ask what you wanna
do with it (like maybe open in a file manager, or something like that)

-or if that automatic feature does not work, how are you mounting it
(show us the exact command line sequence you use to mount it)

-then (once the USB drive is mounted either automatically or
manually, please show us the terminal output and input, as well as
the beginning prompt and exit prompt, from


df -hlT
cat /etc/mtab
mount
sudo /sbin/fdisk -l
sudo /sbin/blkid
uname -a
lsb_release -sircd

then please copy/paste the input/output back to this thread using the
instructions here: http://goo.gl/i3wnr


dd
http://tinyurl.com/DD-Caveat
http://tinyurl.com/DD-Complaints

Thanks for taking the time to look into this, see below.

OpenSUSE 12.3

Yes, did that today.

KDE 4.10.5 “release 1” - the default from 12.3

Yes

It works

then please copy/paste the input/output back to this thread using the
instructions here: Posting in Code Tags - A Guide


DOMAIN\rmuntean@rmuntean-w7:~> df -hlT
Filesystem              Type      Size  Used Avail Use% Mounted on
devtmpfs                devtmpfs  5.9G   20K  5.9G   1% /dev
tmpfs                   tmpfs     5.9G  2.1M  5.9G   1% /dev/shm
tmpfs                   tmpfs     5.9G  1.1M  5.9G   1% /run
/dev/mapper/system-root ext4      218G  181G   38G  83% /
tmpfs                   tmpfs     5.9G     0  5.9G   0% /sys/fs/cgroup
tmpfs                   tmpfs     5.9G  1.1M  5.9G   1% /var/lock
tmpfs                   tmpfs     5.9G  1.1M  5.9G   1% /var/run
/dev/sda1               ext4      152M  107M   37M  75% /boot
/dev/dm-3               ext4       59M  5.2M   50M  10% /run/media/DOMAIN\rmuntean/9a51571f-519d-4a18-8b74-5f490f8f25c5
/dev/dm-3               ext4       59M  5.2M   50M  10% /var/run/media/DOMAIN\rmuntean/9a51571f-519d-4a18-8b74-5f490f8f25c5
/dev/sdb2               vfat      517M   79M  439M  16% /run/media/DOMAIN\rmuntean/CF64-626F
/dev/sdb2               vfat      517M   79M  439M  16% /var/run/media/DOMAIN\rmuntean/CF64-626F
/dev/sdb3               ext4      6.8G  915M  6.0G  14% /run/media/DOMAIN\rmuntean/6c4601aa-71a4-4bea-b698-5f30dab503ab
/dev/sdb3               ext4      6.8G  915M  6.0G  14% /var/run/media/DOMAIN\rmuntean/6c4601aa-71a4-4bea-b698-5f30dab503ab
DOMAIN\rmuntean@rmuntean-w7:~> cat /etc/mtab
rootfs / rootfs rw 0 0
devtmpfs /dev devtmpfs rw,relatime,size=6124704k,nr_inodes=1531176,mode=755 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
tmpfs /run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600,ptmxmode=000 0 0
/dev/mapper/system-root / ext4 rw,relatime,discard,data=ordered 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0                                 
cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0                                       
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=26,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0        
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0                                                                     
mqueue /dev/mqueue mqueue rw,relatime 0 0                                                                              
tmpfs /var/lock tmpfs rw,nosuid,nodev,relatime,mode=755 0 0                                                            
debugfs /sys/kernel/debug debugfs rw,relatime 0 0                                                                      
tmpfs /var/run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0                                                             
/dev/sda1 /boot ext4 rw,relatime,data=ordered 0 0                                                                      
none /var/lib/ntp/proc proc ro,nosuid,nodev,relatime 0 0                                                               
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
gvfsd-fuse /run/user/10000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=10000,group_id=10000 0 0
gvfsd-fuse /var/run/user/10000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=10000,group_id=10000 0 0
/dev/mapper/luks-d57b9551-4d17-40a6-b72d-05103684c101 /run/media/DOMAIN\134rmuntean/9a51571f-519d-4a18-8b74-5f490f8f25c5 ext4 ro,nosuid,nodev,relatime,data=ordered 0 0
/dev/mapper/luks-d57b9551-4d17-40a6-b72d-05103684c101 /var/run/media/DOMAIN\134rmuntean/9a51571f-519d-4a18-8b74-5f490f8f25c5 ext4 ro,nosuid,nodev,relatime,data=ordered 0 0
/dev/sdb2 /run/media/DOMAIN\134rmuntean/CF64-626F vfat rw,nosuid,nodev,relatime,uid=10000,gid=10000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0
/dev/sdb2 /var/run/media/DOMAIN\134rmuntean/CF64-626F vfat rw,nosuid,nodev,relatime,uid=10000,gid=10000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0
/dev/sdb3 /run/media/DOMAIN\134rmuntean/6c4601aa-71a4-4bea-b698-5f30dab503ab ext4 rw,nosuid,nodev,relatime 0 0
/dev/sdb3 /var/run/media/DOMAIN\134rmuntean/6c4601aa-71a4-4bea-b698-5f30dab503ab ext4 rw,nosuid,nodev,relatime 0 0
DOMAIN\rmuntean@rmuntean-w7:~> mount
devtmpfs on /dev type devtmpfs (rw,relatime,size=6124704k,nr_inodes=1531176,mode=755)
tmpfs on /dev/shm type tmpfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
/dev/mapper/system-root on / type ext4 (rw,relatime,discard,data=ordered)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=26,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
tmpfs on /var/lock type tmpfs (rw,nosuid,nodev,relatime,mode=755)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
tmpfs on /var/run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/sda1 on /boot type ext4 (rw,relatime,data=ordered)
none on /var/lib/ntp/proc type proc (ro,nosuid,nodev,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
gvfsd-fuse on /run/user/10000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=10000,group_id=10000)
gvfsd-fuse on /var/run/user/10000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=10000,group_id=10000)
/dev/mapper/luks-d57b9551-4d17-40a6-b72d-05103684c101 on /run/media/DOMAIN\rmuntean/9a51571f-519d-4a18-8b74-5f490f8f25c5 type ext4 (ro,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
/dev/mapper/luks-d57b9551-4d17-40a6-b72d-05103684c101 on /var/run/media/DOMAIN\rmuntean/9a51571f-519d-4a18-8b74-5f490f8f25c5 type ext4 (ro,nosuid,nodev,relatime,data=ordered)
/dev/sdb2 on /run/media/DOMAIN\rmuntean/CF64-626F type vfat (rw,nosuid,nodev,relatime,uid=10000,gid=10000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
/dev/sdb2 on /var/run/media/DOMAIN\rmuntean/CF64-626F type vfat (rw,nosuid,nodev,relatime,uid=10000,gid=10000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro)
/dev/sdb3 on /run/media/DOMAIN\rmuntean/6c4601aa-71a4-4bea-b698-5f30dab503ab type ext4 (rw,nosuid,nodev,relatime,uhelper=udisks2)
/dev/sdb3 on /var/run/media/DOMAIN\rmuntean/6c4601aa-71a4-4bea-b698-5f30dab503ab type ext4 (rw,nosuid,nodev,relatime)
DOMAIN\rmuntean@rmuntean-w7:~> sudo /sbin/fdisk -l

Disk /dev/sda: 240.1 GB, 240057409536 bytes
255 heads, 63 sectors/track, 29185 cylinders, total 468862128 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x39a69a6c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      321535      159744   83  Linux
/dev/sda2          321536   468860927   234269696   8e  Linux LVM

Disk /dev/mapper/cr_ata-KINGSTON_SH100S3240G_50026B721A240420-part2: 239.9 GB, 239890071552 bytes
255 heads, 63 sectors/track, 29164 cylinders, total 468535296 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/system-root: 237.7 GB, 237741539328 bytes
255 heads, 63 sectors/track, 28903 cylinders, total 464338944 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/system-swap: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders, total 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdb: 8020 MB, 8020557824 bytes
247 heads, 62 sectors/track, 1022 cylinders, total 15665152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      129023       63488   83  Linux
/dev/sdb2          129024     1187839      529408    c  W95 FAT32 (LBA)
/dev/sdb3         1187840    15665151     7238656   83  Linux

Disk /dev/mapper/luks-d57b9551-4d17-40a6-b72d-05103684c101: 62 MB, 62914560 bytes
255 heads, 63 sectors/track, 7 cylinders, total 122880 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

DOMAIN\rmuntean@rmuntean-w7:~> sudo /sbin/blkid
/dev/sda1: UUID="a0f1d3bc-ef4e-44a6-8347-2cc3256a980a" TYPE="ext4" 
/dev/sda2: UUID="f5848fa4-bb7b-4918-ad2e-1fc81f6f7cab" TYPE="crypto_LUKS" 
/dev/mapper/cr_ata-KINGSTON_SH100S3240G_50026B721A240420-part2: UUID="0bo6PA-ewZi-0JEM-4uwP-ogIA-hVif-GarcHj" TYPE="LVM2_member" 
/dev/mapper/system-root: UUID="4e9f336c-8bc2-46f8-b209-84bf6e0eab64" TYPE="ext4" 
/dev/mapper/system-swap: UUID="ee297739-816f-4fd9-8ac3-ac2e60950d45" TYPE="swap" 
/dev/sdb1: UUID="d57b9551-4d17-40a6-b72d-05103684c101" TYPE="crypto_LUKS" 
/dev/sdb2: SEC_TYPE="msdos" UUID="CF64-626F" TYPE="vfat" 
/dev/sdb3: UUID="6c4601aa-71a4-4bea-b698-5f30dab503ab" TYPE="ext4" 
/dev/mapper/luks-d57b9551-4d17-40a6-b72d-05103684c101: UUID="9a51571f-519d-4a18-8b74-5f490f8f25c5" TYPE="ext4" 
DOMAIN\rmuntean@rmuntean-w7:~> uname -a
Linux rmuntean-w7.corp.domain.com 3.7.10-1.16-desktop #1 SMP PREEMPT Fri May 31 20:21:23 UTC 2013 (97c14ba) x86_64 x86_64 x86_64 GNU/Linux
DOMAIN\rmuntean@rmuntean-w7:~> lsb_release -sircd
openSUSE project "openSUSE 12.3 (x86_64)" 12.3 Dartmouth

On 08/06/2013 01:26 PM, robert munteanu wrote:
> /dev/sdb3 ext4 6.8G 915M 6.0G 14% /run/media/DOMAIN\rmuntean/6c4601aa-71a4-4bea-b698-5f30dab503ab
> /dev/sdb3 ext4 6.8G 915M 6.0G 14% /var/run/media/DOMAIN\rmuntean/6c4601aa-71a4-4bea-b698-5f30dab503ab

i’m not thinking i can be much more ‘help’ (having never run a system
with encrypted partitions, and have never encountered a path with
both / and \ in it, but lets try this and see what we learn:


ls -hal /run/media/DOMAIN\rmuntean
ls -hal /var/run/media/DOMAIN\rmuntean

results again between code tags, please…

oh, and Henk asked you and i would also like to know:
-“who created those directories/files?”

and, also i wanna know were they created by your 12.3 system, or some
other

finally, are you being asked for the password/phrase to unlock the
crypto protected portions of the USB drive?

(sorry this is taking so long)


dd
http://tinyurl.com/DD-Caveat
http://tinyurl.com/DD-Complaints

Only one of the partitions is encrypted, I guess the problem is with ext4 being mounted with the root directory ownership root:root.

DOMAIN\rmuntean@rmuntean-w7:~> ls -hal /run/media/DOMAIN\\rmuntean/
total 21K
drwxr-x---+ 5 root              root                   100 Aug  6 12:17 .
drwxr-xr-x  3 root              root                    60 Aug  5 19:10 ..
drwxr-xr-x  5 root              root                  4.0K Aug  6 12:18 6c4601aa-71a4-4bea-b698-5f30dab503ab
drwxr-xr-x  5 root              root                  1.0K Jun 10 16:34 9a51571f-519d-4a18-8b74-5f490f8f25c5
drwx------  9 DOMAIN\rmuntean DOMAIN\domain users  16K Jan  1  1970 CF64-626F


DOMAIN\rmuntean@rmuntean-w7:~> ls -hal /var/run/media/DOMAIN\\rmuntean/
total 21K
drwxr-x---+ 5 root              root                   100 Aug  6 12:17 .
drwxr-xr-x  3 root              root                    60 Aug  5 19:10 ..
drwxr-xr-x  5 root              root                  4.0K Aug  6 12:18 6c4601aa-71a4-4bea-b698-5f30dab503ab
drwxr-xr-x  5 root              root                  1.0K Jun 10 16:34 9a51571f-519d-4a18-8b74-5f490f8f25c5
drwx------  9 DOMAIN\rmuntean DOMAIN\domain users  16K Jan  1  1970 CF64-626F

The directories under /var/run and /run are automatically created/destroyed when I mount/unmount the USB stick.

Yes, that works just fine.

Don’t worry, it’s great to get some help with this issue :slight_smile:

It may be stupid but,

Why don’t you just change the ext4 partitions owner using chown -R? You say you can sudo, so (hopefully) you can change the ownership of the filesystem.

The vfat partition is mounted as owned by the user who mouted it because vfat is too dumb to store ownership informations.

Of course, that works and is a step forward

DOMAIN\rmuntean@rmuntean-w7:/run/media/DOMAIN\rmuntean> sudo chown "$(id -u):$(id -g)" 6c4601aa-71a4-4bea-b698-5f30dab503ab

The only catch is that it’s now locked to my local uid, and when I move it to another computer I’ll have the same problem.

robert munteanu wrote:
> The only catch is that it’s now locked to my local uid, and when I move
> it to another computer I’ll have the same problem.

Well, that’s fundamental. Files in Linux filesystems are owned by
whoever created them (meaning by a particular UID). You UID needs to be
the same on all the systems you use if you want to keep ownerships as
you move around.

I was away for a while. The fact that there are no w-bits for group and specialy for others is blocking every non-root user to create anything on the mount point (the root of the device).

That is the same as e.g. /, /usr, /bin, /home, etc. and as such not abnormal. This is of course different from a spontanious mounted non-Linux file system (like NTFS ands VFAT) because they have no owners nor permission bits and the thus they are faked by assuming that the desktop users is the owner and that hey may read/write/execute there.
For a Linux file system that is not a good approach. Afetr all it would be bad when Unix/Linux permissions were so easy to circumvent. This IMHO the designers (of this spontanious mounting on request of a desktop session) have chosen to make root the owner. All directories inside there can then be owned by others and used by the. (when there is a directory owned byy you on the device, you can create there). This is exectly the same as /home:

drwxr-xr-x 10 root   root  4096 13 dec  2012 ./
drwxr-xr-x 24 root   root  4096  6 aug 15:20 ../
drwxr-xr-x 84 henk   wij   4096  6 aug 15:20 henk/
drwx------  2 root   root  4096 25 okt  2009 lost+found/
henk@boven:~>

/home is owned by root and has rwxr-xr-x and my home directory is owned by me and has also rwsr-xr-x, but as I am the owner I can do at will there.

Can this be done differntly. Of course. I can create a directory (e.g. in my /home/… somewhere) and then an Linux file system can be monted there. And then I will be able to create, etc. there same as in all other places I own. The problem here iss that the OP wants this to happen with his mounts, but the spontanious mount does not support it.

Is this a bug or a feature? I realy do not know. I can understand that the solution chosen was arbitrary the best one. Do not forget that these spontanious mounting threw up a lot of very principal problems because Unix/Linux is not realy designed for it. The fact that we are now at solution number x (someone remember HAL? and whatwas before it and waht came after it?) shows that it has some not obvious problems.

Mounting “manualy” (with or without help from an entry in /etc/fstab, is always posisble of course becaus you can then mount whre you want and thus also on a directory that is owned by the user who is apparently the owner. But again, take care, other users then can not go there!

So far for the technical bachground as I understand it.

(I have tested this on 12.2 and 12.3.)

On 08/06/2013 03:06 PM, robert munteanu wrote:

>> and, also i wanna know were they created by your 12.3 system, or some
>> other
>
> The directories under /var/run and /run are automatically
> created/destroyed when I mount/unmount the USB stick.

you misunderstood:

someone put some folders (three of them) on that USB stick…then
when you stick the USB device into the machine then the system
automatically creates mount points for the already created
directories (existing on the UBS) to /var/run and /run…right?

how else would the system know there are three directories there
unless they already existed on the USB device??

so, who created the three directories on the USB device? was that
you? and was it done by using the 12.3 system you are now using…or
were they created by root of this same 12.3 system, or some other system?

so, i think i know how to help you, but i still want that
question answered, please…

oh, and two more: i have never seen a path like either of these
/run/media/DOMAIN\rmuntean/
/run/media/DOMAIN\rmuntean/

  1. how does that happen?

and, gosh i don’t see a /home mounted anywhere…
2. how does that work? (please excuse me for being profoundly confused)


dd
http://tinyurl.com/DD-Caveat
http://tinyurl.com/DD-Complaints

No, you do.

This is not true. As the OP clearly tells in the first post here, there are three partitions on that device. Each holding a file system (different types). Every file system is mounted on it’s own mount point. Independent from the others. It is the same as if three different devices with each only one partition/file system on them are connected.

Doing a chown and or chmod on the mount point is of little use. While it works for the moment, it will not wotk on next connection of the device. Simply because the mount points are created anew for every spontanious (on request from the desktop) mount. You have then to repeat the chown/chmod every time again.

And yes, it is in the principles of Unix/Linux that ownership is by userid (not username btw). And when you move parts of the directory tree to another system, it depends if the same uid is configured there and, whoever (s)he may be. Becaue that user then the owner of the files on the other system. That may not be what you want. On systems that work together a common user/group administration is required. This is not only fort removable mass-storage, but it is the same for NFS mounting. (And thus they invented NIS to go with NFS).

On 2013-08-06 15:46, robert munteanu wrote:

> The only catch is that it’s now locked to my local uid, and when I move
> it to another computer I’ll have the same problem.

It is working exactly as designed and intended, there is nothing wrong.
NO, you can not create files and directories as user on the root of the
device, unless you chown the root directory of the filesystem (the mount
point after mounting); but this will not hold on an external media for
two reasons: the mounting is dynamic, and other computers have no
knowledge of it. Furthermore, it is not user “rmuntean” who is allowed,
but the user that has a certain UID number.

The only solution is that you create a directory belonging to that user,
and use that directory instead of the root of the device.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

The three directories correspond to the three partitions on my USB stick. These are created automatically when the stick is plugged in. Not sure what program does these nowadays, maybe udisks.

/run/media is the path where they should be mounted. Not sure by whose rules, but anyway … And my username is DOMAIN\rmuntean since I have active directory integration.

That I don’t know sorry. Someone takes the USB disk,scans it, decides where to mount it and allow me to do that.