[Swlug] Automounting problem

Mark Summerfield mark at qtrac.eu
Sat May 28 11:49:59 UTC 2016


Hi Colin,

Thanks for sharing your expertise!

It mostly worked like a charm;-)

On Sat, 28 May 2016 11:44:29 +0100
Colin Law <clanlaw at gmail.com> wrote:
[snip]
> Ah, you did not tell us that.  As Huw suggests this means that the
> user ids on the two machines do not match.  On the machine with the
> andreas user that user probably has the uid 1000 and the mark user has
> the uid 1001.  You can check that by running
> id -u mark
> id -u andreas
> 
> You want to have the uid for mark as 1000.  I suggest first changing
> the uid of andreas to 1002 (to free up 1000).  Logon as mark then
> sudo usermod -u 1002 andreas
> sudo groupmod -u -1002 andreas

I had to use -g rather than -u

> The above automatically changes the uid (but not gid on home directory
> files, but to find any others and to change group ids on files
> sudo find / -uid 1000 -exec sudo chown -h 1002 {} +
> sudo find / -gid 1000 -exec sudo chgrp -h 1002 {} +

These worked find (which makes it strange that the chgrp didn't work
fine in the next bit).
 
> Then logon as andreas and change the uid for mark to 1000
> sudo usermod -u 1000 mark
> sudo groupmod -u 1000 mark

I had to use -g rather than -u

> and again, to correct ids
> sudo find / -uid 1001 -exec sudo chown -h 1000 {} +
> sudo find / -gid 1001 -exec sudo chgrp -h 1000 {} +

In the end I did chown -R mark.mark /home/mark 'cos I got an error about
too many arguments for chgrp.

Anyway, mark is user and group 1000 and the memory sticks now work as
wanted.

Thank you:-D
-- 
Mark Summerfield, Qtrac Ltd.
    "Programming in Python 3" - ISBN 0321680561
        http://www.qtrac.eu/py3book.html



More information about the Swlug mailing list