Friday, May 10, 2024
184
rated 0 times [  184] [ 0]  / answers: 1 / hits: 273454  / 2 Years ago, mon, august 22, 2022, 7:18:50

Is there a command to mount a folder from one partition to my main partition?



Example of what I'd like to do, which obviously doesn't work:





mount /media/tc1/folder /home/dvad/home



If not by using a command, is there another way I can do this?


More From » command-line

 Answers
7

Yes but before I go that far, couldn't you just symlink?



ln -s /media/tc1/folder ~/home


This link is just a file that is interpreted. It is automatically permanent (until you delete the file).



Failing that you can use mount as you described but the syntax is slightly different:



mount --bind /media/tc1/folder /home/dvad/home


This is not permanent at all, and will be nuked by a restart. If you want it to persist, you'll need something in your /etc/fstab like this:



/media/tc1/folder    /home/dvad/home    none    bind


If you're trying a mount and it's not working, you should make sure that the block-level device is mounted. You can't directly mount a subdirectory of a partition without first mounting the partition.


[#34737] Tuesday, August 23, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainubt

Total Points: 496
Total Questions: 98
Total Answers: 126

Location: Sao Tome and Principe
Member since Wed, Dec 21, 2022
1 Year ago
;