6

I have a dual-boot Windows 10/Xubuntu 16.04 set up. Both share the small SSD for boot, and both have home directories on the data drives.

For Xubuntu, /dev/sdc is the data drive, and it's mounted at /mnt/archives. When I ran usermod -d /mnt/archives/mike mike against my user to move my home drive to the data drive, it worked just fine after a reboot. When I originally changed my home directory, I had /dev/sdc mount under id=0,gid=0, which was mounting everything as root. I changed the mount to id=mike,gid=mount_group, and rebooted my computer. However, when I go to run sudo chown -R mike:mount_group /mnt/archives/mike/*, it doesn't actually change any of the permissions. :/

Here is my /etc/fstab file:

# cat /etc/fstab
# /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/sdd3 during installation
UUID=8db38c8f-87b6-4174-a439-fd60dbb7b313 /               ext4    errors=remount-ro 0       1
/dev/sdc /mnt/archives auto rw,relatime,user_id=mike,group_id=mount_group,allow_other,blksize=4096

Here is a sample of the directory:

# ls -lah /mnt/archives/mike/
total 88K
drwxrwxrwx 1 root root 8.0K Oct 23 15:50 .
drwxrwxrwx 1 root root 4.0K Oct 23 14:30 ..
drwxrwxrwx 1 root root    0 Oct  3 23:05 .adobe
drwxrwxrwx 1 root root 4.0K Oct  3 23:36 anaconda2
drwxrwxrwx 1 root root    0 Oct  9 00:14 .astropy
drwxrwxrwx 1 root root    0 Oct  9 00:19 .aws
-rwxrwxrwx 1 root root 6.5K Oct 23 15:49 .bash_history
-rwxrwxrwx 1 root root  220 Oct  3 22:24 .bash_logout
-rwxrwxrwx 1 root root  948 Oct 23 14:33 .bash_profile
-rwxrwxrwx 1 root root 3.8K Oct 23 14:34 .bashrc
-rwxrwxrwx 1 root root 3.7K Oct  3 23:36 .bashrc-anaconda2.bak
drwxrwxrwx 1 root root 4.0K Oct 23 16:01 .cache
drwxrwxrwx 1 root root    0 Oct  8 17:21 .conda
...

How can I fix this odd permissions issue?

1
  • sdc is a drive, not a partition, is this drive not partitioned? What is the used file-system?
    – mook765
    Oct 24 '16 at 5:03
3

The problem is in your chmod -R command. The * in the command is excluding the actual mike/ portion of your space. By default the * doesn't see the dot . in the intended immediate directory.

These are commands that will achieve what you are looking for. First, it's common for users to mistakenly change owner of their home's root director or some of the files and folders in their space. This can be corrected with:

$ sudo chown -R $USER:$USER ~/

or in the case of the command in your question, use this:

$ sudo chown -R mike:mount_group /mnt/archives/mike/
5
  • I would user $USER instead of $(whoami)
    – Rinzwind
    Oct 24 '16 at 14:17
  • @Rinzwind Thanks. I was aware of the USER variable, but wasn't sure if all the shells used the same specification ("$USER" OR "$LOGNAME"). I know they will all have the /usr/bin/whoami. I checked and tested popular shells and find the as suggested $USER is set in all of them. Thanks for adding to my experience! I updated my answer with your suggestion. Oct 24 '16 at 14:44
  • hehehe.Well I have several systems where whoami does not work ;-)
    – Rinzwind
    Oct 24 '16 at 14:46
  • Oh, so basically it was the globbing that was messing it up?
    – mxplusb
    Oct 25 '16 at 21:28
  • @Rinzwind Will you respond to mynameismevin's comment concerning globbing? Thanks! Oct 26 '16 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.