luks filesystem on USB device changes ownership between computers

Martin Webster lists at martinwebster.eu
Mon Aug 9 16:50:54 UTC 2010


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 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.) Alternatively, change the UID on one machine using
usermod:

usermod -u <new UID> <user name>

-- 
As ever,
.\\artin

Martin Webster • Profile: http://www.linkedin.com/in/martinwebster
AOL: martinjwebster • Wordpress: http://martinwebster.info/
Jabber: martinwebster at xmpp.org.uk • ICQ: 15893823





More information about the ubuntu-users mailing list