Choose style:

Author Topic: Shared /DATA partition permissions.  (Read 2410 times)

0 Members and 1 Guest are viewing this topic.

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4808
  • Karma: 1013
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 8 Respin-2 (64-bit)
Shared /DATA partition permissions.
« on: February 19, 2017, 04:37:08 am »
My System Information
[/color][/b]
Code: [Select]
andy@andy-Latitude-E6410 ~ $ inxi -Fz
System:    Host: andy-Latitude-E6410 Kernel: 4.8.0-36-generic x86_64 (64 bit)
           Desktop: N/A Distro: Peppermint Seven
Machine:   System: Dell (portable) product: Latitude E6410 v: 0001
           Mobo: Dell model: 0667CC v: A03 Bios: Dell v: A16 date: 12/05/2013
CPU:       Dual core Intel Core i5 M 560 (-HT-MCP-) cache: 3072 KB
           clock speeds: max: 2667 MHz 1: 1466 MHz 2: 1333 MHz 3: 1599 MHz
           4: 1333 MHz
Graphics:  Card: Intel Core Processor Integrated Graphics Controller
           Display Server: X.Org 1.18.4 drivers: (unloaded: fbdev,vesa)
           Resolution: 1280x800@60.00hz
           GLX Renderer: Mesa DRI Intel Ironlake Mobile
           GLX Version: 2.1 Mesa 12.0.6
Audio:     Card Intel 5 Series/3400 Series High Definition Audio
           driver: snd_hda_intel
           Sound: Advanced Linux Sound Architecture v: k4.8.0-36-generic
Network:   Card-1: Intel 82577LM Gigabit Network Connection driver: e1000e
           IF: eno1 state: down mac: <filter>
           Card-2: Intel Centrino Advanced-N 6200 driver: iwlwifi
           IF: wlp2s0 state: up mac: <filter>
Drives:    HDD Total Size: 1120.2GB (21.5% used)
           ID-1: /dev/sda model: KINGSTON_SV300S3 size: 120.0GB
           ID-2: /dev/sdb model: WDC_WD10JPVX size: 1000.2GB
Partition: ID-1: / size: 20G used: 5.1G (28%) fs: ext4 dev: /dev/sda5
           ID-2: /home size: 17G used: 4.0G (26%) fs: ext4 dev: /dev/sda6
           ID-3: swap-1 size: 8.59GB used: 0.00GB (0%) fs: swap dev: /dev/sdb2
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 55.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 221 Uptime: 7 min Memory: 973.8/7908.9MB
           Client: Shell (bash) inxi: 2.2.35
andy@andy-Latitude-E6410 ~ $
Hi everyone, how's it going?  I've run into an issue I can't get my head around  :-\.  I'm dual booting Peppermint 7 64-bit alongside the Arch based: OBRevenge OS 64-bit.  I've set up my system with a separate /DATA partition.  I share this with any distro I'm multibooting with Peppermint 7.  I've never had an issue with setting this up.  I've done it so many times, I've lost count.  I always keep the same user name across the distros: "andy".  I always use /mnt/DATA as the mount point for the separate /DATA partition.  I always set up ownership of the partition with:
Code: [Select]
sudo chown -R andy:andy /mnt/DATA
This has always worked flawlessly, until now.  When I boot into either Peppermint 7 or OBRevenge OS.  The first thing I have to do, is re-establish the ownership for: /mnt/DATA.  To say it has me baffled, is an understatement  :-\.  Any ideas are much appreciated - thanks  ;).
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1989
  • Karma: 341
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
Re: Shared /DATA partition permissions.
« Reply #1 on: February 19, 2017, 08:11:02 am »
I think the users are assigned numbers, so could you somehow have a different number on each distro?

Offline ColonelPanic

  • nOOb
  • *
  • Posts: 22
  • Karma: 4
    • View Profile
    • Linux Linx 2016
  • Peppermint version(s): 7
Re: Shared /DATA partition permissions.
« Reply #2 on: February 19, 2017, 08:53:20 am »
I think the users are assigned numbers, so could you somehow have a different number on each distro?
Great idea. It is quite possible.
Andy, in both OS's run the command
Code: [Select]
id
See if "uid" is the same (1000) in both.
AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26103
  • Karma: 2843
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Shared /DATA partition permissions.
« Reply #3 on: February 19, 2017, 12:29:54 pm »
What they said .. check the user ID's are the same.
(not all distros assign uid 1000 to the first user account .. usernames mean sod all if the uid isn't the same)

Or make the mountpoint read/write by everyone.
« Last Edit: February 19, 2017, 12:32:22 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4808
  • Karma: 1013
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 8 Respin-2 (64-bit)
Re: Shared /DATA partition permissions.
« Reply #4 on: February 19, 2017, 06:13:49 pm »
What they said .. check the user ID's are the same.
(not all distros assign uid 1000 to the first user account .. usernames mean sod all if the uid isn't the same)

Or make the mountpoint read/write by everyone.
Yeah it's different in OBRevenge OS
Code: [Select]
[andy@andy-obr ~]$ id
uid=1001(andy) gid=1001(andy) groups=1001(andy),4(adm),7(lp),10(wheel),90(network),91(video),92(audio),94(floppy),95(storage),96(scanner),100(users)
and this is Peppermint 7
Code: [Select]
andy@andy-Latitude-E6410 ~ $ id
uid=1000(andy) gid=1000(andy) groups=1000(andy),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),123(sambashare),124(lpadmin)
andy@andy-Latitude-E6410 ~ $
What would be your suggestion to match them up?

Many thanks: murraymint and ColonelPanic for your assistance.  It makes sense now.  I knew it had to be something simple.  I've just never come across it before  ;).
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26103
  • Karma: 2843
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Shared /DATA partition permissions.
« Reply #5 on: February 19, 2017, 07:13:20 pm »
How are you mounting /mnt/DATA Andy ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4808
  • Karma: 1013
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 8 Respin-2 (64-bit)
Re: Shared /DATA partition permissions.
« Reply #6 on: February 19, 2017, 09:12:34 pm »
How are you mounting /mnt/DATA Andy ?

My /DATA partition is on /dev/sdb1.  I'm using:
Code: [Select]
sudo mount /dev/sdb1 /mnt/DATA
I'm then changing the ownership with:
Code: [Select]
sudo chown -R andy:andy /mnt/DATA
That's it.  I hope that's what you mean  :-\.

Edit:  Sorry, I forgot the /etc/fstab contents:
Code: [Select]
# /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/sda5 during installation
UUID=7a4f8b35-8877-4529-b79a-eab4cd010a85 /               ext4    noatime,errors=remount-ro 0       1
# /home was on /dev/sda6 during installation
UUID=abfcfbd1-881b-46b9-a4b9-1e2e808a1329 /home           ext4    noatime,defaults        0       2
# swap was on /dev/sdb2 during installation
UUID=45ec0c95-914b-47c6-936f-300ce947ee18 none            swap    sw              0       0
# User created /DATA partition.  Mount point /mnt/DATA.
UUID=8a9f41c5-fd91-4895-83df-67207ebe3970 /mnt/DATA ext4 defaults 0 2
« Last Edit: February 19, 2017, 09:29:15 pm by AndyInMokum, Reason: Additional info »
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline ColonelPanic

  • nOOb
  • *
  • Posts: 22
  • Karma: 4
    • View Profile
    • Linux Linx 2016
  • Peppermint version(s): 7
Re: Shared /DATA partition permissions.
« Reply #7 on: February 19, 2017, 11:07:45 pm »
Yeah it's different
What would be your suggestion to match them up?

I assume that on OBRevenge OS you have a different user, not named andy, who has the uid of 1000
Is that correct?
If you do not, you can change that 1001 to 1000.
If you do, then you can change the 1000 on Peppermint 7 to 1001, so that they match.

Here are the commands to run as root to change the UID and GID for a user. Simply change the variables in angled brackets to match your settings:

usermod -u <NEWUID> <LOGIN>   
groupmod -g <NEWGID> <GROUP>
usermod -g <NEWGID> <LOGIN>
usermod and groupmod simply change the UID and GID for their respective named counterpart.
usermod also changes the UID for the files in the homedir but naturally we canít assume the only place files have been created is in the homedir.
The final usermod command changes the login group for the user.

To change the UID on files:
find / -username <OLDUID> -exec chown -h <NEWUID> {} \;
To change the GID:
find / -username <OLDGID> -exec chgrp -h <NEWGID> {} \;
The find command recurses the filesystem from / and changes everything with UID of OLDUID to be owned by NEWUID and them changes the group for the files owned by the OLDGROUP.
AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26103
  • Karma: 2843
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Shared /DATA partition permissions.
« Reply #8 on: February 20, 2017, 12:49:45 pm »
If this is only a storage partition (docs/pics/music/etc.) wouldn't it be simpler to just recursively make it read/write/execute by anyone ?
Code: [Select]
sudo chmod -R 777 /mnt/DATA
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4808
  • Karma: 1013
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 8 Respin-2 (64-bit)
Re: Shared /DATA partition permissions.
« Reply #9 on: February 20, 2017, 05:19:10 pm »
Thanks everyone for the suggestions.  ;).   ColonelPanic, I tried applying:

Quote
usermod -u <NEWUID> <LOGIN>   
groupmod -g <NEWGID> <GROUP>I
usermod -g <NEWGID> <LOGIN>
usermod and groupmod simply change the UID and GID for their respective named counterpart.
usermod also changes the UID for the files in the homedir but naturally we canít assume the only place files have been created is in the homedir.
The final usermod command changes the login group for the user.

in OBRevenge OS, just because I want to keep the UID 1000.  It was having none of it  :-\.  I haven't tried using the instructions on Peppermint 7.

PCNetspec, your blanket permission for everyone seemed like a good idea.  I keep my Dropbox folder on the /DATA partition.  It's simlinked my ~/ folder.   Not a  problem when changing ownership and group to: andy:andy.  Applying 777 and Dropbox freaks out.  It refuses to open and asks for my user password to access it.  It does exactly the same in OBRevenge OS  The only way to access my Dropbox folder is to change the permissions on it back to:
Code: [Select]
sudo chown -R andy:andy /mnt/DATA/Dropbox
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline ColonelPanic

  • nOOb
  • *
  • Posts: 22
  • Karma: 4
    • View Profile
    • Linux Linx 2016
  • Peppermint version(s): 7
Re: Shared /DATA partition permissions.
« Reply #10 on: February 20, 2017, 05:39:51 pm »
ColonelPanic, I tried applying:
usermod -u <NEWUID> <LOGIN>   
groupmod -g <NEWGID> <GROUP>I
usermod -g <NEWGID> <LOGIN>
in OBRevenge OS, just because I want to keep the UID 1000.  It was having none of it.
What command did you use exactly?
Did you note the part about "Here are the commands to run as root"? That means use "sudo" before each command.
Is there another user in OBRevenge OS that might already have the uid of 1000?
AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26103
  • Karma: 2843
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Shared /DATA partition permissions.
« Reply #11 on: February 20, 2017, 06:13:00 pm »
Safest way to do this....

Create a new user on either Peppermint or Arch with the same UID as the other ... then set it up how you like it.
(the next user account you create in Peppermint will likely be 1001 anyway).

There are other ways to map one uid to another but that'd probably be the easiest/safest.

Another method would be to add the user in both distros to a "group" in both distros with the same gid (group ID) .. then set the ownership of /mnt/DATA to that group .. if you get what I mean.

There are multiple ways of achieving this .. all have pluses and minuses except having the same uid.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4808
  • Karma: 1013
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 8 Respin-2 (64-bit)
Re: Shared /DATA partition permissions.
« Reply #12 on: February 20, 2017, 06:18:51 pm »
ColonelPanic, I tried applying:
usermod -u <NEWUID> <LOGIN>   
groupmod -g <NEWGID> <GROUP>I
usermod -g <NEWGID> <LOGIN>
in OBRevenge OS, just because I want to keep the UID 1000.  It was having none of it.
What command did you use exactly?
Did you note the part about "Here are the commands to run as root"? That means use "sudo" before each command.
Is there another user in OBRevenge OS that might already have the uid of 1000?
This is the command I used in OBRevenge OS along with my id and the output:
Code: [Select]
[andy@andy-obr ~]$ id
uid=1001(andy) gid=1001(andy) groups=1001(andy),4(adm),7(lp),10(wheel),90(network),91(video),92(audio),94(floppy),95(storage),96(scanner),100(users)
[andy@andy-obr ~]$ sudo usermod -u 1000 andy
[sudo] password for andy:
usermod: user andy is currently used by process 643
[andy@andy-obr ~]$
I'm the only user.  There are no other accounts  :-\.
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26103
  • Karma: 2843
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Shared /DATA partition permissions.
« Reply #13 on: February 20, 2017, 06:25:12 pm »
You're probably lucky that didn't go through, as it would have meant you no longer owned your own /home/andy folder and config files.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline ColonelPanic

  • nOOb
  • *
  • Posts: 22
  • Karma: 4
    • View Profile
    • Linux Linx 2016
  • Peppermint version(s): 7
Re: Shared /DATA partition permissions.
« Reply #14 on: February 20, 2017, 06:45:19 pm »
You're probably lucky that didn't go through, as it would have meant you no longer owned your own /home/andy folder and config files.
No.

Code: [Select]
man usermod

Quote
   -u, --uid UID
           The new numerical value of the user's ID.


           This value must be unique, unless the -o option is used. The value must be non-negative.


           The user's mailbox, and any files which the user owns and which are located in the user's home directory will have the file user
           ID changed automatically.


           The ownership of files outside of the user's home directory must be fixed manually.

AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI