0

I'd like to set up one external hard drive that would serve as the backup drive for two different laptops, both running Linux. I understand this is problematic b/c each machine will have its own set of user IDs, which can cause permission conflicts/general chaos.

I'm just wondering if there are any solutions I haven't considered. I would use ext4, but for the permissions issue. I thought about using NFS and sharing the drive over the network, but that's not really the use case I want -- I want each laptop to be able to plug into the drive and use it. I would also like the file system to be encrypted.

So is there a graceful way to do this, or is it just not in the cards? Is there another file system designed for this use case? Should I just use NTFS or HFS+?

UPDATE: As requested below, updating to add: there is no trust issue, as the two laptops are just mine and my wife's. And there is no specific problem that I foresee -- rather, it just feels sketchy, since I don't think ext4 was designed to be used this way.

With that said, I think I'll just stick with a single ext4 encrypted partition, keeping each backup in separate directories, and not worry about it. :) Thanks!

6
  • Would each laptop have its own encrypted partition on the drive? Or would the drive be encrypted and the laptops share the key? Have you considered built-in encryption such as that offered by Disk Genie and other suppliers? Feb 5, 2019 at 13:39
  • I see where you're going -- multiple partitions would work. But I would prefer to keep one partition, so as not to artificially limit the space available to each user. Feb 5, 2019 at 13:42
  • I have not considered Disk Genie. This is the first I've heard of it. Feb 5, 2019 at 13:43
  • Ok, so Disk Genie looks pretty cool, but that's not my solution. The hard drive I'm using already exists, so I'm not buying anything new for this. Thanks for the suggestion! Feb 5, 2019 at 13:45
  • Provided you keep each laptop to its own backup "area" (directory, partition, LV, whatever) there will be no clash of UID/GID values. Just because john in one is UID 1000 won't bother sally in the other with the same UID. Unless it's a trust issue where you don't want sally deleting john's files, in which case I'd suggest separately encrypted partitions (or LVs). Feb 5, 2019 at 14:10

1 Answer 1

0

No, it is not a problem. Use a normal Linux filesystem.

I would recommend that you use one directory for one computer backup and an other for the second computer. Create the directory as root, and give the expected owner/group to the directory (or just keep root, if you want to backup all system). So mkdir and chown. Just do it on every system, so that the directory which need to be accesses from one system has the correct permission of that system.

The problem could arise if you try to access data of the other computer, with one computer. Just do it as root (and set the user/group when copying file to the "other" computer).

Note: If you are root on a computer (any computer), you may read all files on a disk that you can physically attach to that computer. The only exception are encrypted files/filesystems. So careful with external disks (especially on moving them out of house).

2
  • Ok, this makes sense. I updated my question to reflect that it was more a feeling that I wasn't doing this the best way, rather than a specific problem I'm trying to avoid. Thanks for your help! Feb 5, 2019 at 14:58
  • In newer kernels (3.4 and later it seems) it is possible to configure a UID/GID map for filesystems to allow remapping ownership of e.g. filesystem images. I don't know the exact details, but it relates to "userns" (userspace namespace).
    – LustreOne
    Feb 6, 2019 at 21:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .