partitioning /home for desktop workstation
I just shifted my wife's home computer to Ubuntu 18.04.1 from Win10, and she's liking the transition so far. It's an Ubuntu-only machine (no dual-boot, only one OS distro, may need to set up a VM for certain Windows-specific applications).
One last thing to figure out and set up is how to handle the two drives (480gb ssd, 1tb hdd). Tried installing with LVM enabled, but ran into the lvmetad
issue and had to go with standard ext4
partitions (i.e., just /efi
and /
on ssd, single unmounted ext4
partition on hdd that has the archive of her user data). She has almost 500gb of archaeological research data (many confidential/proprietary photos, .pdf's, and other data files) that would obviously overwhelm the ssd.
I'm trying to figure out how to set up so that /home
stays on the ssd (for speed, etc), with the bulk of the archival on the hdd. I'm not sure I want to just mount the hdd (e.g., as /archive
) with links to /home
, though, since I want whatever is pushed off to the hdd to also be exclusively part of her user space (i.e., not just generic storage accessible/visible to any other user account). Ideally, what I want is to create a subspace of ~/home
on the hdd and have it usable and understandable to someone that has no interest in filesystem management and needs it to "just work" so that she can get to her data.
So far, all of the two+ drive solutions I've seen just mount the hdd as bulk storage sym-linked under /home
, sets up /home
as an LVM pseudo-RAID across the two (opinions vary whether that is a good idea, and lvmetad
prevents it for now anyway), or sets up an actual RAID (which I don't want to get into).
Unfortunately, all of this a hair beyond my understanding of linux filesytems and it is very possible that I'm just not understanding this all correctly.
Desired Setup
- Allow setup of muli-user system, with
home
on the sdd and individual user access to large-file storage on the hdd - user files and directories on hdd accessible only to that user, and linked under the user's
/home
/home/[user]/[extra storage]
on ssd linked to[hdd mount point]/[user]
visible/accessible only to [user] as as~/[extra storage]
- quotas not necessary but possible storage for space on hdd
Basically, separate and secure individual user shares on the bulk storage device -- extending the user's home directory -- without pushing all of /home
to that second device.
My question -- is there a way to set up what I'm describing, or can someone please point out where my thinking about the user filesystem structure is off-base?
partitioning mount filesystem home-directory user-management
|
show 1 more comment
I just shifted my wife's home computer to Ubuntu 18.04.1 from Win10, and she's liking the transition so far. It's an Ubuntu-only machine (no dual-boot, only one OS distro, may need to set up a VM for certain Windows-specific applications).
One last thing to figure out and set up is how to handle the two drives (480gb ssd, 1tb hdd). Tried installing with LVM enabled, but ran into the lvmetad
issue and had to go with standard ext4
partitions (i.e., just /efi
and /
on ssd, single unmounted ext4
partition on hdd that has the archive of her user data). She has almost 500gb of archaeological research data (many confidential/proprietary photos, .pdf's, and other data files) that would obviously overwhelm the ssd.
I'm trying to figure out how to set up so that /home
stays on the ssd (for speed, etc), with the bulk of the archival on the hdd. I'm not sure I want to just mount the hdd (e.g., as /archive
) with links to /home
, though, since I want whatever is pushed off to the hdd to also be exclusively part of her user space (i.e., not just generic storage accessible/visible to any other user account). Ideally, what I want is to create a subspace of ~/home
on the hdd and have it usable and understandable to someone that has no interest in filesystem management and needs it to "just work" so that she can get to her data.
So far, all of the two+ drive solutions I've seen just mount the hdd as bulk storage sym-linked under /home
, sets up /home
as an LVM pseudo-RAID across the two (opinions vary whether that is a good idea, and lvmetad
prevents it for now anyway), or sets up an actual RAID (which I don't want to get into).
Unfortunately, all of this a hair beyond my understanding of linux filesytems and it is very possible that I'm just not understanding this all correctly.
Desired Setup
- Allow setup of muli-user system, with
home
on the sdd and individual user access to large-file storage on the hdd - user files and directories on hdd accessible only to that user, and linked under the user's
/home
/home/[user]/[extra storage]
on ssd linked to[hdd mount point]/[user]
visible/accessible only to [user] as as~/[extra storage]
- quotas not necessary but possible storage for space on hdd
Basically, separate and secure individual user shares on the bulk storage device -- extending the user's home directory -- without pushing all of /home
to that second device.
My question -- is there a way to set up what I'm describing, or can someone please point out where my thinking about the user filesystem structure is off-base?
partitioning mount filesystem home-directory user-management
1
Is this then a multiple user system? I am not familiar with that as my wife & I just share one /home. If so then you need to get into separate ownership & permission settings and oir groups. Standard linking: askubuntu.com/questions/1013677/… & askubuntu.com/questions/1058756/… Some info on groups: ubuntuforums.org/showthread.php?t=2138476
– oldfred
Jan 24 at 18:32
@oldfred I'm approaching it as a multi-user setup just in case, and to incorporate user account security since much of it is confidential data.
– Scard
Jan 24 at 19:27
@PerlDuck that might work, but does that fix the whole drive to just her account or can it be a share on the physical drive for multi-user setup?
– Scard
Jan 24 at 19:27
@PerlDuck would or could that make each user's sub-directories and access separate within the shared drive? Maybe that's a better way to describe what I'm aiming at... individual user shares within a bulk storage mount point? If so, could you post an answer on how to go about setting that up? This is new territory for me... never had to deal with multiple physical drives before.
– Scard
Jan 24 at 19:37
1
@user68186 I've edited the question... does that match what is preferred?
– Scard
Jan 25 at 16:26
|
show 1 more comment
I just shifted my wife's home computer to Ubuntu 18.04.1 from Win10, and she's liking the transition so far. It's an Ubuntu-only machine (no dual-boot, only one OS distro, may need to set up a VM for certain Windows-specific applications).
One last thing to figure out and set up is how to handle the two drives (480gb ssd, 1tb hdd). Tried installing with LVM enabled, but ran into the lvmetad
issue and had to go with standard ext4
partitions (i.e., just /efi
and /
on ssd, single unmounted ext4
partition on hdd that has the archive of her user data). She has almost 500gb of archaeological research data (many confidential/proprietary photos, .pdf's, and other data files) that would obviously overwhelm the ssd.
I'm trying to figure out how to set up so that /home
stays on the ssd (for speed, etc), with the bulk of the archival on the hdd. I'm not sure I want to just mount the hdd (e.g., as /archive
) with links to /home
, though, since I want whatever is pushed off to the hdd to also be exclusively part of her user space (i.e., not just generic storage accessible/visible to any other user account). Ideally, what I want is to create a subspace of ~/home
on the hdd and have it usable and understandable to someone that has no interest in filesystem management and needs it to "just work" so that she can get to her data.
So far, all of the two+ drive solutions I've seen just mount the hdd as bulk storage sym-linked under /home
, sets up /home
as an LVM pseudo-RAID across the two (opinions vary whether that is a good idea, and lvmetad
prevents it for now anyway), or sets up an actual RAID (which I don't want to get into).
Unfortunately, all of this a hair beyond my understanding of linux filesytems and it is very possible that I'm just not understanding this all correctly.
Desired Setup
- Allow setup of muli-user system, with
home
on the sdd and individual user access to large-file storage on the hdd - user files and directories on hdd accessible only to that user, and linked under the user's
/home
/home/[user]/[extra storage]
on ssd linked to[hdd mount point]/[user]
visible/accessible only to [user] as as~/[extra storage]
- quotas not necessary but possible storage for space on hdd
Basically, separate and secure individual user shares on the bulk storage device -- extending the user's home directory -- without pushing all of /home
to that second device.
My question -- is there a way to set up what I'm describing, or can someone please point out where my thinking about the user filesystem structure is off-base?
partitioning mount filesystem home-directory user-management
I just shifted my wife's home computer to Ubuntu 18.04.1 from Win10, and she's liking the transition so far. It's an Ubuntu-only machine (no dual-boot, only one OS distro, may need to set up a VM for certain Windows-specific applications).
One last thing to figure out and set up is how to handle the two drives (480gb ssd, 1tb hdd). Tried installing with LVM enabled, but ran into the lvmetad
issue and had to go with standard ext4
partitions (i.e., just /efi
and /
on ssd, single unmounted ext4
partition on hdd that has the archive of her user data). She has almost 500gb of archaeological research data (many confidential/proprietary photos, .pdf's, and other data files) that would obviously overwhelm the ssd.
I'm trying to figure out how to set up so that /home
stays on the ssd (for speed, etc), with the bulk of the archival on the hdd. I'm not sure I want to just mount the hdd (e.g., as /archive
) with links to /home
, though, since I want whatever is pushed off to the hdd to also be exclusively part of her user space (i.e., not just generic storage accessible/visible to any other user account). Ideally, what I want is to create a subspace of ~/home
on the hdd and have it usable and understandable to someone that has no interest in filesystem management and needs it to "just work" so that she can get to her data.
So far, all of the two+ drive solutions I've seen just mount the hdd as bulk storage sym-linked under /home
, sets up /home
as an LVM pseudo-RAID across the two (opinions vary whether that is a good idea, and lvmetad
prevents it for now anyway), or sets up an actual RAID (which I don't want to get into).
Unfortunately, all of this a hair beyond my understanding of linux filesytems and it is very possible that I'm just not understanding this all correctly.
Desired Setup
- Allow setup of muli-user system, with
home
on the sdd and individual user access to large-file storage on the hdd - user files and directories on hdd accessible only to that user, and linked under the user's
/home
/home/[user]/[extra storage]
on ssd linked to[hdd mount point]/[user]
visible/accessible only to [user] as as~/[extra storage]
- quotas not necessary but possible storage for space on hdd
Basically, separate and secure individual user shares on the bulk storage device -- extending the user's home directory -- without pushing all of /home
to that second device.
My question -- is there a way to set up what I'm describing, or can someone please point out where my thinking about the user filesystem structure is off-base?
partitioning mount filesystem home-directory user-management
partitioning mount filesystem home-directory user-management
edited Jan 25 at 16:24
Scard
asked Jan 24 at 18:13
ScardScard
1086
1086
1
Is this then a multiple user system? I am not familiar with that as my wife & I just share one /home. If so then you need to get into separate ownership & permission settings and oir groups. Standard linking: askubuntu.com/questions/1013677/… & askubuntu.com/questions/1058756/… Some info on groups: ubuntuforums.org/showthread.php?t=2138476
– oldfred
Jan 24 at 18:32
@oldfred I'm approaching it as a multi-user setup just in case, and to incorporate user account security since much of it is confidential data.
– Scard
Jan 24 at 19:27
@PerlDuck that might work, but does that fix the whole drive to just her account or can it be a share on the physical drive for multi-user setup?
– Scard
Jan 24 at 19:27
@PerlDuck would or could that make each user's sub-directories and access separate within the shared drive? Maybe that's a better way to describe what I'm aiming at... individual user shares within a bulk storage mount point? If so, could you post an answer on how to go about setting that up? This is new territory for me... never had to deal with multiple physical drives before.
– Scard
Jan 24 at 19:37
1
@user68186 I've edited the question... does that match what is preferred?
– Scard
Jan 25 at 16:26
|
show 1 more comment
1
Is this then a multiple user system? I am not familiar with that as my wife & I just share one /home. If so then you need to get into separate ownership & permission settings and oir groups. Standard linking: askubuntu.com/questions/1013677/… & askubuntu.com/questions/1058756/… Some info on groups: ubuntuforums.org/showthread.php?t=2138476
– oldfred
Jan 24 at 18:32
@oldfred I'm approaching it as a multi-user setup just in case, and to incorporate user account security since much of it is confidential data.
– Scard
Jan 24 at 19:27
@PerlDuck that might work, but does that fix the whole drive to just her account or can it be a share on the physical drive for multi-user setup?
– Scard
Jan 24 at 19:27
@PerlDuck would or could that make each user's sub-directories and access separate within the shared drive? Maybe that's a better way to describe what I'm aiming at... individual user shares within a bulk storage mount point? If so, could you post an answer on how to go about setting that up? This is new territory for me... never had to deal with multiple physical drives before.
– Scard
Jan 24 at 19:37
1
@user68186 I've edited the question... does that match what is preferred?
– Scard
Jan 25 at 16:26
1
1
Is this then a multiple user system? I am not familiar with that as my wife & I just share one /home. If so then you need to get into separate ownership & permission settings and oir groups. Standard linking: askubuntu.com/questions/1013677/… & askubuntu.com/questions/1058756/… Some info on groups: ubuntuforums.org/showthread.php?t=2138476
– oldfred
Jan 24 at 18:32
Is this then a multiple user system? I am not familiar with that as my wife & I just share one /home. If so then you need to get into separate ownership & permission settings and oir groups. Standard linking: askubuntu.com/questions/1013677/… & askubuntu.com/questions/1058756/… Some info on groups: ubuntuforums.org/showthread.php?t=2138476
– oldfred
Jan 24 at 18:32
@oldfred I'm approaching it as a multi-user setup just in case, and to incorporate user account security since much of it is confidential data.
– Scard
Jan 24 at 19:27
@oldfred I'm approaching it as a multi-user setup just in case, and to incorporate user account security since much of it is confidential data.
– Scard
Jan 24 at 19:27
@PerlDuck that might work, but does that fix the whole drive to just her account or can it be a share on the physical drive for multi-user setup?
– Scard
Jan 24 at 19:27
@PerlDuck that might work, but does that fix the whole drive to just her account or can it be a share on the physical drive for multi-user setup?
– Scard
Jan 24 at 19:27
@PerlDuck would or could that make each user's sub-directories and access separate within the shared drive? Maybe that's a better way to describe what I'm aiming at... individual user shares within a bulk storage mount point? If so, could you post an answer on how to go about setting that up? This is new territory for me... never had to deal with multiple physical drives before.
– Scard
Jan 24 at 19:37
@PerlDuck would or could that make each user's sub-directories and access separate within the shared drive? Maybe that's a better way to describe what I'm aiming at... individual user shares within a bulk storage mount point? If so, could you post an answer on how to go about setting that up? This is new territory for me... never had to deal with multiple physical drives before.
– Scard
Jan 24 at 19:37
1
1
@user68186 I've edited the question... does that match what is preferred?
– Scard
Jan 25 at 16:26
@user68186 I've edited the question... does that match what is preferred?
– Scard
Jan 25 at 16:26
|
show 1 more comment
1 Answer
1
active
oldest
votes
The following steps describe how to mount the partition on your HDD
below /mnt/archive
and then add bind mounts to the home directories
of two users, alice and bob. The home directories themselves are
still on another partition.
All commands must be issued as user root
.
Determine UUID of
archive
partition:
lsblk -fs
NAME FSTYPE LABEL UUID MOUNTPOINT
sda5 ext4 slash 467ddc36-vvvv-xxxx-yyyy-zzzzzzzzzzzz /
└─sda
sda6 ext4 home a87c2c2d-vvvv-xxxx-yyyy-zzzzzzzzzzzz /home
└─sda
sdb8 ext4 archive 291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz
└─sdb
...
In my case, I have
/
and/home
onsda
and an unmounted
partition labelledarchive
onsdb8
. For the purpose of this post
we assumesda
is an SSD andsdb
is an HDD.
Mount the archive partition into an empty directory, say
/mnt/archive
:
mkdir /mnt/archive
mount UUID=291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz /mnt/archive
chown root:root /mnt/archive
chmod 750 /mnt/archive
Create user specific folders below
/mnt/archive
(i.e. on the HDD)
for users alice and bob and adjust the permissions so that only
they can access these directories. Note that the directories are now
on the partitionarchive
on the HDD:
mkdir /mnt/archive/alice
chown alice:alice /mnt/archive/alice
chmod 750 /mnt/archive/alice
mkdir /mnt/archive/bob
chown bob:bob /mnt/archive/bob
chmod 750 /mnt/archive/bob
Create
archive
folders in their home directories. Don't worry
because the directories are owned byroot
. This does not hurt
because alice isnt't supposed to put anything in that directory.
The directory/home/alice/archive
only serves as a location where
to bind-mount the actual/mnt/archive/alice
to and when it is mounted,
the permissions and ownership of/mnt/archive/alice
apply.
mkdir /home/alice/archive
mkdir /home/bob/archive
bind mount
/mnt/archive/alice
to/home/alice/archive
:
mount -o bind /mnt/archive/alice /home/alice/archive
mount -o bind /mnt/archive/bob /home/bob/archive
When satified, add the following lines to
/etc/fstab
to mount the
partition automatically upon boot:
# The /archive partition
UUID=291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz /mnt/archive ext4 defaults 0 2
# bind mounts for alice and bob:
/mnt/archive/alice /home/alice/archive none bind 0 0
/mnt/archive/bob /home/bob/archive none bind 0 0
Before the bind mount is done, alice will just see a directory owned by
root in her home directory. The directory is empty and she cannot (and
should not) put files in there:
alice@ubuntu:~$ ll
total 16
drwxr-xr-x 2 root root 4096 Jan 25 12:51 archive
-rw-r--r-- 1 alice alice 8980 Jan 25 12:43 examples.desktop
After the bind mount is done (mount -o bind /mnt/archive/alice /home/alice/archive
),
alice will see the directory /mnt/archive/alice
in her home directory instead, including
the permissions of /mnt/archive/alice
:
alice@ubuntu:~$ ll
total 16
drwxr-x--- 2 alice alice 4096 Jan 25 13:06 archive
-rw-r--r-- 1 alice alice 8980 Jan 25 12:43 examples.desktop
She can do whatever she likes in and with that archive
directory and everything
will happen on the partition on the HDD.
To undo the above steps, use the following commands:
# undo bind-mounts:
umount /home/alice/archive
umount /home/bob/archive
# unmount actual partition:
umount /mnt/archive
+1 for a general solution for multiple users. For a new user it may be useful to addsudo
to those commands that need root privileges.
– user68186
Jan 25 at 15:23
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112586%2fpartitioning-home-for-desktop-workstation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The following steps describe how to mount the partition on your HDD
below /mnt/archive
and then add bind mounts to the home directories
of two users, alice and bob. The home directories themselves are
still on another partition.
All commands must be issued as user root
.
Determine UUID of
archive
partition:
lsblk -fs
NAME FSTYPE LABEL UUID MOUNTPOINT
sda5 ext4 slash 467ddc36-vvvv-xxxx-yyyy-zzzzzzzzzzzz /
└─sda
sda6 ext4 home a87c2c2d-vvvv-xxxx-yyyy-zzzzzzzzzzzz /home
└─sda
sdb8 ext4 archive 291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz
└─sdb
...
In my case, I have
/
and/home
onsda
and an unmounted
partition labelledarchive
onsdb8
. For the purpose of this post
we assumesda
is an SSD andsdb
is an HDD.
Mount the archive partition into an empty directory, say
/mnt/archive
:
mkdir /mnt/archive
mount UUID=291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz /mnt/archive
chown root:root /mnt/archive
chmod 750 /mnt/archive
Create user specific folders below
/mnt/archive
(i.e. on the HDD)
for users alice and bob and adjust the permissions so that only
they can access these directories. Note that the directories are now
on the partitionarchive
on the HDD:
mkdir /mnt/archive/alice
chown alice:alice /mnt/archive/alice
chmod 750 /mnt/archive/alice
mkdir /mnt/archive/bob
chown bob:bob /mnt/archive/bob
chmod 750 /mnt/archive/bob
Create
archive
folders in their home directories. Don't worry
because the directories are owned byroot
. This does not hurt
because alice isnt't supposed to put anything in that directory.
The directory/home/alice/archive
only serves as a location where
to bind-mount the actual/mnt/archive/alice
to and when it is mounted,
the permissions and ownership of/mnt/archive/alice
apply.
mkdir /home/alice/archive
mkdir /home/bob/archive
bind mount
/mnt/archive/alice
to/home/alice/archive
:
mount -o bind /mnt/archive/alice /home/alice/archive
mount -o bind /mnt/archive/bob /home/bob/archive
When satified, add the following lines to
/etc/fstab
to mount the
partition automatically upon boot:
# The /archive partition
UUID=291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz /mnt/archive ext4 defaults 0 2
# bind mounts for alice and bob:
/mnt/archive/alice /home/alice/archive none bind 0 0
/mnt/archive/bob /home/bob/archive none bind 0 0
Before the bind mount is done, alice will just see a directory owned by
root in her home directory. The directory is empty and she cannot (and
should not) put files in there:
alice@ubuntu:~$ ll
total 16
drwxr-xr-x 2 root root 4096 Jan 25 12:51 archive
-rw-r--r-- 1 alice alice 8980 Jan 25 12:43 examples.desktop
After the bind mount is done (mount -o bind /mnt/archive/alice /home/alice/archive
),
alice will see the directory /mnt/archive/alice
in her home directory instead, including
the permissions of /mnt/archive/alice
:
alice@ubuntu:~$ ll
total 16
drwxr-x--- 2 alice alice 4096 Jan 25 13:06 archive
-rw-r--r-- 1 alice alice 8980 Jan 25 12:43 examples.desktop
She can do whatever she likes in and with that archive
directory and everything
will happen on the partition on the HDD.
To undo the above steps, use the following commands:
# undo bind-mounts:
umount /home/alice/archive
umount /home/bob/archive
# unmount actual partition:
umount /mnt/archive
+1 for a general solution for multiple users. For a new user it may be useful to addsudo
to those commands that need root privileges.
– user68186
Jan 25 at 15:23
add a comment |
The following steps describe how to mount the partition on your HDD
below /mnt/archive
and then add bind mounts to the home directories
of two users, alice and bob. The home directories themselves are
still on another partition.
All commands must be issued as user root
.
Determine UUID of
archive
partition:
lsblk -fs
NAME FSTYPE LABEL UUID MOUNTPOINT
sda5 ext4 slash 467ddc36-vvvv-xxxx-yyyy-zzzzzzzzzzzz /
└─sda
sda6 ext4 home a87c2c2d-vvvv-xxxx-yyyy-zzzzzzzzzzzz /home
└─sda
sdb8 ext4 archive 291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz
└─sdb
...
In my case, I have
/
and/home
onsda
and an unmounted
partition labelledarchive
onsdb8
. For the purpose of this post
we assumesda
is an SSD andsdb
is an HDD.
Mount the archive partition into an empty directory, say
/mnt/archive
:
mkdir /mnt/archive
mount UUID=291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz /mnt/archive
chown root:root /mnt/archive
chmod 750 /mnt/archive
Create user specific folders below
/mnt/archive
(i.e. on the HDD)
for users alice and bob and adjust the permissions so that only
they can access these directories. Note that the directories are now
on the partitionarchive
on the HDD:
mkdir /mnt/archive/alice
chown alice:alice /mnt/archive/alice
chmod 750 /mnt/archive/alice
mkdir /mnt/archive/bob
chown bob:bob /mnt/archive/bob
chmod 750 /mnt/archive/bob
Create
archive
folders in their home directories. Don't worry
because the directories are owned byroot
. This does not hurt
because alice isnt't supposed to put anything in that directory.
The directory/home/alice/archive
only serves as a location where
to bind-mount the actual/mnt/archive/alice
to and when it is mounted,
the permissions and ownership of/mnt/archive/alice
apply.
mkdir /home/alice/archive
mkdir /home/bob/archive
bind mount
/mnt/archive/alice
to/home/alice/archive
:
mount -o bind /mnt/archive/alice /home/alice/archive
mount -o bind /mnt/archive/bob /home/bob/archive
When satified, add the following lines to
/etc/fstab
to mount the
partition automatically upon boot:
# The /archive partition
UUID=291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz /mnt/archive ext4 defaults 0 2
# bind mounts for alice and bob:
/mnt/archive/alice /home/alice/archive none bind 0 0
/mnt/archive/bob /home/bob/archive none bind 0 0
Before the bind mount is done, alice will just see a directory owned by
root in her home directory. The directory is empty and she cannot (and
should not) put files in there:
alice@ubuntu:~$ ll
total 16
drwxr-xr-x 2 root root 4096 Jan 25 12:51 archive
-rw-r--r-- 1 alice alice 8980 Jan 25 12:43 examples.desktop
After the bind mount is done (mount -o bind /mnt/archive/alice /home/alice/archive
),
alice will see the directory /mnt/archive/alice
in her home directory instead, including
the permissions of /mnt/archive/alice
:
alice@ubuntu:~$ ll
total 16
drwxr-x--- 2 alice alice 4096 Jan 25 13:06 archive
-rw-r--r-- 1 alice alice 8980 Jan 25 12:43 examples.desktop
She can do whatever she likes in and with that archive
directory and everything
will happen on the partition on the HDD.
To undo the above steps, use the following commands:
# undo bind-mounts:
umount /home/alice/archive
umount /home/bob/archive
# unmount actual partition:
umount /mnt/archive
+1 for a general solution for multiple users. For a new user it may be useful to addsudo
to those commands that need root privileges.
– user68186
Jan 25 at 15:23
add a comment |
The following steps describe how to mount the partition on your HDD
below /mnt/archive
and then add bind mounts to the home directories
of two users, alice and bob. The home directories themselves are
still on another partition.
All commands must be issued as user root
.
Determine UUID of
archive
partition:
lsblk -fs
NAME FSTYPE LABEL UUID MOUNTPOINT
sda5 ext4 slash 467ddc36-vvvv-xxxx-yyyy-zzzzzzzzzzzz /
└─sda
sda6 ext4 home a87c2c2d-vvvv-xxxx-yyyy-zzzzzzzzzzzz /home
└─sda
sdb8 ext4 archive 291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz
└─sdb
...
In my case, I have
/
and/home
onsda
and an unmounted
partition labelledarchive
onsdb8
. For the purpose of this post
we assumesda
is an SSD andsdb
is an HDD.
Mount the archive partition into an empty directory, say
/mnt/archive
:
mkdir /mnt/archive
mount UUID=291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz /mnt/archive
chown root:root /mnt/archive
chmod 750 /mnt/archive
Create user specific folders below
/mnt/archive
(i.e. on the HDD)
for users alice and bob and adjust the permissions so that only
they can access these directories. Note that the directories are now
on the partitionarchive
on the HDD:
mkdir /mnt/archive/alice
chown alice:alice /mnt/archive/alice
chmod 750 /mnt/archive/alice
mkdir /mnt/archive/bob
chown bob:bob /mnt/archive/bob
chmod 750 /mnt/archive/bob
Create
archive
folders in their home directories. Don't worry
because the directories are owned byroot
. This does not hurt
because alice isnt't supposed to put anything in that directory.
The directory/home/alice/archive
only serves as a location where
to bind-mount the actual/mnt/archive/alice
to and when it is mounted,
the permissions and ownership of/mnt/archive/alice
apply.
mkdir /home/alice/archive
mkdir /home/bob/archive
bind mount
/mnt/archive/alice
to/home/alice/archive
:
mount -o bind /mnt/archive/alice /home/alice/archive
mount -o bind /mnt/archive/bob /home/bob/archive
When satified, add the following lines to
/etc/fstab
to mount the
partition automatically upon boot:
# The /archive partition
UUID=291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz /mnt/archive ext4 defaults 0 2
# bind mounts for alice and bob:
/mnt/archive/alice /home/alice/archive none bind 0 0
/mnt/archive/bob /home/bob/archive none bind 0 0
Before the bind mount is done, alice will just see a directory owned by
root in her home directory. The directory is empty and she cannot (and
should not) put files in there:
alice@ubuntu:~$ ll
total 16
drwxr-xr-x 2 root root 4096 Jan 25 12:51 archive
-rw-r--r-- 1 alice alice 8980 Jan 25 12:43 examples.desktop
After the bind mount is done (mount -o bind /mnt/archive/alice /home/alice/archive
),
alice will see the directory /mnt/archive/alice
in her home directory instead, including
the permissions of /mnt/archive/alice
:
alice@ubuntu:~$ ll
total 16
drwxr-x--- 2 alice alice 4096 Jan 25 13:06 archive
-rw-r--r-- 1 alice alice 8980 Jan 25 12:43 examples.desktop
She can do whatever she likes in and with that archive
directory and everything
will happen on the partition on the HDD.
To undo the above steps, use the following commands:
# undo bind-mounts:
umount /home/alice/archive
umount /home/bob/archive
# unmount actual partition:
umount /mnt/archive
The following steps describe how to mount the partition on your HDD
below /mnt/archive
and then add bind mounts to the home directories
of two users, alice and bob. The home directories themselves are
still on another partition.
All commands must be issued as user root
.
Determine UUID of
archive
partition:
lsblk -fs
NAME FSTYPE LABEL UUID MOUNTPOINT
sda5 ext4 slash 467ddc36-vvvv-xxxx-yyyy-zzzzzzzzzzzz /
└─sda
sda6 ext4 home a87c2c2d-vvvv-xxxx-yyyy-zzzzzzzzzzzz /home
└─sda
sdb8 ext4 archive 291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz
└─sdb
...
In my case, I have
/
and/home
onsda
and an unmounted
partition labelledarchive
onsdb8
. For the purpose of this post
we assumesda
is an SSD andsdb
is an HDD.
Mount the archive partition into an empty directory, say
/mnt/archive
:
mkdir /mnt/archive
mount UUID=291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz /mnt/archive
chown root:root /mnt/archive
chmod 750 /mnt/archive
Create user specific folders below
/mnt/archive
(i.e. on the HDD)
for users alice and bob and adjust the permissions so that only
they can access these directories. Note that the directories are now
on the partitionarchive
on the HDD:
mkdir /mnt/archive/alice
chown alice:alice /mnt/archive/alice
chmod 750 /mnt/archive/alice
mkdir /mnt/archive/bob
chown bob:bob /mnt/archive/bob
chmod 750 /mnt/archive/bob
Create
archive
folders in their home directories. Don't worry
because the directories are owned byroot
. This does not hurt
because alice isnt't supposed to put anything in that directory.
The directory/home/alice/archive
only serves as a location where
to bind-mount the actual/mnt/archive/alice
to and when it is mounted,
the permissions and ownership of/mnt/archive/alice
apply.
mkdir /home/alice/archive
mkdir /home/bob/archive
bind mount
/mnt/archive/alice
to/home/alice/archive
:
mount -o bind /mnt/archive/alice /home/alice/archive
mount -o bind /mnt/archive/bob /home/bob/archive
When satified, add the following lines to
/etc/fstab
to mount the
partition automatically upon boot:
# The /archive partition
UUID=291bd44c-vvvv-xxxx-yyyy-zzzzzzzzzzzz /mnt/archive ext4 defaults 0 2
# bind mounts for alice and bob:
/mnt/archive/alice /home/alice/archive none bind 0 0
/mnt/archive/bob /home/bob/archive none bind 0 0
Before the bind mount is done, alice will just see a directory owned by
root in her home directory. The directory is empty and she cannot (and
should not) put files in there:
alice@ubuntu:~$ ll
total 16
drwxr-xr-x 2 root root 4096 Jan 25 12:51 archive
-rw-r--r-- 1 alice alice 8980 Jan 25 12:43 examples.desktop
After the bind mount is done (mount -o bind /mnt/archive/alice /home/alice/archive
),
alice will see the directory /mnt/archive/alice
in her home directory instead, including
the permissions of /mnt/archive/alice
:
alice@ubuntu:~$ ll
total 16
drwxr-x--- 2 alice alice 4096 Jan 25 13:06 archive
-rw-r--r-- 1 alice alice 8980 Jan 25 12:43 examples.desktop
She can do whatever she likes in and with that archive
directory and everything
will happen on the partition on the HDD.
To undo the above steps, use the following commands:
# undo bind-mounts:
umount /home/alice/archive
umount /home/bob/archive
# unmount actual partition:
umount /mnt/archive
answered Jan 25 at 15:05
PerlDuckPerlDuck
6,84111535
6,84111535
+1 for a general solution for multiple users. For a new user it may be useful to addsudo
to those commands that need root privileges.
– user68186
Jan 25 at 15:23
add a comment |
+1 for a general solution for multiple users. For a new user it may be useful to addsudo
to those commands that need root privileges.
– user68186
Jan 25 at 15:23
+1 for a general solution for multiple users. For a new user it may be useful to add
sudo
to those commands that need root privileges.– user68186
Jan 25 at 15:23
+1 for a general solution for multiple users. For a new user it may be useful to add
sudo
to those commands that need root privileges.– user68186
Jan 25 at 15:23
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112586%2fpartitioning-home-for-desktop-workstation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Is this then a multiple user system? I am not familiar with that as my wife & I just share one /home. If so then you need to get into separate ownership & permission settings and oir groups. Standard linking: askubuntu.com/questions/1013677/… & askubuntu.com/questions/1058756/… Some info on groups: ubuntuforums.org/showthread.php?t=2138476
– oldfred
Jan 24 at 18:32
@oldfred I'm approaching it as a multi-user setup just in case, and to incorporate user account security since much of it is confidential data.
– Scard
Jan 24 at 19:27
@PerlDuck that might work, but does that fix the whole drive to just her account or can it be a share on the physical drive for multi-user setup?
– Scard
Jan 24 at 19:27
@PerlDuck would or could that make each user's sub-directories and access separate within the shared drive? Maybe that's a better way to describe what I'm aiming at... individual user shares within a bulk storage mount point? If so, could you post an answer on how to go about setting that up? This is new territory for me... never had to deal with multiple physical drives before.
– Scard
Jan 24 at 19:37
1
@user68186 I've edited the question... does that match what is preferred?
– Scard
Jan 25 at 16:26