Sunday, May 5, 2024
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 25758  / 2 Years ago, thu, february 17, 2022, 6:48:18

is it possible to mount the root file system '/' on one hard drive (where folders like /usr, /boot, etc will be stored) and mount /tmp and /home to another hard drive on the same partition?



Something like this:



HDD1:

/
/usr
/bin
/boot
/var


HDD2:

/tmp
/home


I know LVM is possible for creating a single large volume but that is not what I want


More From » partitioning

 Answers
6

To have /tmp and /home on the same partition as each other but a different partition from /, you'll need to do this:



  1. Make tmp and home the two top-level directories on the partition you want to contain them. So if right now that partition is itself /tmp, you'll need to move its entire contents to a tmp directory in its root.



  2. Give the partition that contains tmp and home its own mount point. A reasonable name for this is tmp+home (unless you plan to use that partition for other stuff too) and reasonable locations for it are /, /mnt, and /media. I recommend putting it directly in / and the rest of this answer assumes that's where it is.



  3. Give /tmp+home its own entry in /etc/fstab. (You will see /tmp has its own entry.)



  4. Make /tmp and /home symbolic links to /tmp+home/tmp and /tmp+home/home.




Please note that this will not involve using these instructions for creating a separate /home partition, because in this configuration, /home will be a symbolic link into a separate partition, rather than a mount point for a separate partition.


Furthermore, you'll have to unconfigure your separate /tmp directory (including removing or, better, commenting out its entry in /etc/fstab), since /tmp will no longer be a mount point for a separate partition, but will instead be a symbolic link into a separate partition.


This answer doesn't provide extremely specific instructions (though it should be sufficient, combined with the available documentation). If someone who has experience moving /tmp can weigh in on whether or not it's possible/safe to move /tmp while in the installed system, that would be helpful. I can give detailed instructions for doing this from the installed system or from a live CD, but I don't want to give directions that are ineffective or unsafe (nor directions that are unnecessarily difficult and time-consuming).


[#37727] Friday, February 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ditery

Total Points: 9
Total Questions: 116
Total Answers: 119

Location: Grenada
Member since Sun, Dec 20, 2020
3 Years ago
;