M
M
mx60012014-05-05 20:42:18
linux
mx6001, 2014-05-05 20:42:18

How to mount to the root, several directories on one partition?

Here I have a section sda1 "/". I create another sda2, and I want 3 directories A, B, C to be located on it, is it possible to mount this partition to the root so that it turns out / A, / B, / C (each directory / A, / B, / C corresponds to its own A, B, C on sda2 - i.e. not the same partition in 3 directories), and at the same time these directories remained on the same partition (sda2), it is natural to be able to register this in fstab, so that everything will be on boot already mounted?
Or will each directory have to create its own logical partition and then mount each one individually to the root?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
Igor, 2014-05-05
@mx6001

Each mount point /A, /B, /C must have its own device that will be mounted to it, i.e. /dev/sda2, /dev/sda3, etc.
But you can still mount "directories to directories".
Let's say you have a device /dev/sda3 on the file system of which 3 directories with files A, B and C are created.
We can mount the device to one mount point, for example, in / mnt and we will already see directories from the file system as / mnt/A, /mnt/B, /mnt/C. And they, in turn, mount in / A, / B and / C. The mount command uses the --bind option to mount "directory to directory".

M
Melkij, 2014-05-05
@melkij

Same partition in 3 directories?
Rummage towards mount --bind
Or symlinks.

K
kenny_opennix, 2014-05-05
@kenny_opennix

Aufs to help you

K
kipishio kipishio, 2018-08-08
@kipishio

I would also like Linux to access the /home and /user folders and have them together but in one separate directory. and not in the directory where the Linux root is accessing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question