luks filesystem on USB device changes ownership between computers

Adam Funk a24061 at ducksburg.com
Mon Aug 9 21:37:02 UTC 2010


On 2010-08-09, Martin Webster wrote:

> On Mon, 2010-08-09 at 15:17 +0100, Adam Funk wrote:
>
>> I have a USB device with two partitions, one of which is a LUKS
>> filesystem, and I use it on two different computers.  Wherever I plug
>> it in, the passphrase works correctly and the device appears with the
>> same /media/$uuid name, but the ownership changes and I have to run
>> 'sudo chmod -R adam' on it.  I assume this is because my account has
>> number 1000 on one machine and 1001 on the other.  Is there any way to
>> configure the device, or the hal rules on the machines, to mount it
>> automatically all owned by me? 
>
> The problem has arisen because the file system you've used for your pen
> drive stores the UID/GID (ownership/permissions.) LUKS isn't responsible
> for the problem.

I agree.

> I don't believe there is a solution... just workarounds. If file size
> isn't important you could format the drive with fat32 (maximum file size
> for fat32 is 4GB.) 

File size isn't important, but security (in case the drive is lost) is
important: that's why I'm using LUKS.

> Alternatively, change the UID on one machine using
> usermod:
>
> usermod -u <new UID> <user name>

Won't that screw up the file ownership of all sorts of things on the
computer on which I run it?





More information about the ubuntu-users mailing list