How to mount a specific directory from a partition(not the entire partition) onto mount point (say /home)?
here is what i want to do:
I used to have only one distro installed, so i had a fstab entry like:
UUID=dccfc257-7039-4dba-9a2f-469f6bbc5fbf /home ext4 nodev,nosuid 0 2
now I installed another distro, and i want to mount a specific directory of that same partition to my /home in the new distro such as:
[that_partition]/CentosHome/username/whatever <--- this kind of thing, for example
[that_partition]/UbuntuHome/username/whatever
How do i achieve this? How to use UUID for this? (since the sdX format names are subject to changes
what commands do i need?
dual-boot mount fstab mountpoint
add a comment |
here is what i want to do:
I used to have only one distro installed, so i had a fstab entry like:
UUID=dccfc257-7039-4dba-9a2f-469f6bbc5fbf /home ext4 nodev,nosuid 0 2
now I installed another distro, and i want to mount a specific directory of that same partition to my /home in the new distro such as:
[that_partition]/CentosHome/username/whatever <--- this kind of thing, for example
[that_partition]/UbuntuHome/username/whatever
How do i achieve this? How to use UUID for this? (since the sdX format names are subject to changes
what commands do i need?
dual-boot mount fstab mountpoint
1
Mount is for filesystems. A directory is only one part of filesystem, so you cannot select just part of a filesystem to mount. But you could mount/CentosHome/username/whatever
at/media/username/centos
and then make a symbolic link to/media/username/centos/username/whatever
inside your home folder. That's what I do with my VirtualBox machines. I've symbolic link to the directory , but filesystem is mounted at/media/myuser/second_hard_drive
– Sergiy Kolodyazhnyy
yesterday
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
Looks alright. Remember that you need same usernames on both systems to have access rights for each respective owner of the directory.
– Sergiy Kolodyazhnyy
5 hours ago
yea, i got that. Thank you, Sergiy.
– Mahmoud Gudarzi
5 hours ago
add a comment |
here is what i want to do:
I used to have only one distro installed, so i had a fstab entry like:
UUID=dccfc257-7039-4dba-9a2f-469f6bbc5fbf /home ext4 nodev,nosuid 0 2
now I installed another distro, and i want to mount a specific directory of that same partition to my /home in the new distro such as:
[that_partition]/CentosHome/username/whatever <--- this kind of thing, for example
[that_partition]/UbuntuHome/username/whatever
How do i achieve this? How to use UUID for this? (since the sdX format names are subject to changes
what commands do i need?
dual-boot mount fstab mountpoint
here is what i want to do:
I used to have only one distro installed, so i had a fstab entry like:
UUID=dccfc257-7039-4dba-9a2f-469f6bbc5fbf /home ext4 nodev,nosuid 0 2
now I installed another distro, and i want to mount a specific directory of that same partition to my /home in the new distro such as:
[that_partition]/CentosHome/username/whatever <--- this kind of thing, for example
[that_partition]/UbuntuHome/username/whatever
How do i achieve this? How to use UUID for this? (since the sdX format names are subject to changes
what commands do i need?
dual-boot mount fstab mountpoint
dual-boot mount fstab mountpoint
edited 3 hours ago
Mahmoud Gudarzi
asked yesterday
Mahmoud GudarziMahmoud Gudarzi
58117
58117
1
Mount is for filesystems. A directory is only one part of filesystem, so you cannot select just part of a filesystem to mount. But you could mount/CentosHome/username/whatever
at/media/username/centos
and then make a symbolic link to/media/username/centos/username/whatever
inside your home folder. That's what I do with my VirtualBox machines. I've symbolic link to the directory , but filesystem is mounted at/media/myuser/second_hard_drive
– Sergiy Kolodyazhnyy
yesterday
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
Looks alright. Remember that you need same usernames on both systems to have access rights for each respective owner of the directory.
– Sergiy Kolodyazhnyy
5 hours ago
yea, i got that. Thank you, Sergiy.
– Mahmoud Gudarzi
5 hours ago
add a comment |
1
Mount is for filesystems. A directory is only one part of filesystem, so you cannot select just part of a filesystem to mount. But you could mount/CentosHome/username/whatever
at/media/username/centos
and then make a symbolic link to/media/username/centos/username/whatever
inside your home folder. That's what I do with my VirtualBox machines. I've symbolic link to the directory , but filesystem is mounted at/media/myuser/second_hard_drive
– Sergiy Kolodyazhnyy
yesterday
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
Looks alright. Remember that you need same usernames on both systems to have access rights for each respective owner of the directory.
– Sergiy Kolodyazhnyy
5 hours ago
yea, i got that. Thank you, Sergiy.
– Mahmoud Gudarzi
5 hours ago
1
1
Mount is for filesystems. A directory is only one part of filesystem, so you cannot select just part of a filesystem to mount. But you could mount
/CentosHome/username/whatever
at /media/username/centos
and then make a symbolic link to /media/username/centos/username/whatever
inside your home folder. That's what I do with my VirtualBox machines. I've symbolic link to the directory , but filesystem is mounted at /media/myuser/second_hard_drive
– Sergiy Kolodyazhnyy
yesterday
Mount is for filesystems. A directory is only one part of filesystem, so you cannot select just part of a filesystem to mount. But you could mount
/CentosHome/username/whatever
at /media/username/centos
and then make a symbolic link to /media/username/centos/username/whatever
inside your home folder. That's what I do with my VirtualBox machines. I've symbolic link to the directory , but filesystem is mounted at /media/myuser/second_hard_drive
– Sergiy Kolodyazhnyy
yesterday
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
Looks alright. Remember that you need same usernames on both systems to have access rights for each respective owner of the directory.
– Sergiy Kolodyazhnyy
5 hours ago
Looks alright. Remember that you need same usernames on both systems to have access rights for each respective owner of the directory.
– Sergiy Kolodyazhnyy
5 hours ago
yea, i got that. Thank you, Sergiy.
– Mahmoud Gudarzi
5 hours ago
yea, i got that. Thank you, Sergiy.
– Mahmoud Gudarzi
5 hours ago
add a comment |
2 Answers
2
active
oldest
votes
You cannot mount directly a specific directory. You have to mount the entire partition then bind the directory. see bind mount
in man mount
First you make an entry in /etc/fstab
to mount your old drive:
[that partition] /mnt/[that partition] auto nosuid,nodev,nofail, 0 0
then you bind the directory you want (in fstab)
/mnt/[that partition][/that dir] /home/user/whatever bind
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
add a comment |
Here's what i did , it seems like i have my home working. attached is a snap of my fstab. Comments are appreciated.
For future reference, it's best not to post images of text, especially scripts or config files. Other users cannot edit the errors easily, plus images can go missing if the host website such as imgur deletes the image or the website itself is down
– Sergiy Kolodyazhnyy
4 hours ago
Thank you for mentioning that Sergiy. I will keep that in mind. Thank you.
– Mahmoud Gudarzi
3 hours ago
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%2f1110684%2fhow-to-mount-a-specific-directory-from-a-partitionnot-the-entire-partition-ont%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You cannot mount directly a specific directory. You have to mount the entire partition then bind the directory. see bind mount
in man mount
First you make an entry in /etc/fstab
to mount your old drive:
[that partition] /mnt/[that partition] auto nosuid,nodev,nofail, 0 0
then you bind the directory you want (in fstab)
/mnt/[that partition][/that dir] /home/user/whatever bind
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
add a comment |
You cannot mount directly a specific directory. You have to mount the entire partition then bind the directory. see bind mount
in man mount
First you make an entry in /etc/fstab
to mount your old drive:
[that partition] /mnt/[that partition] auto nosuid,nodev,nofail, 0 0
then you bind the directory you want (in fstab)
/mnt/[that partition][/that dir] /home/user/whatever bind
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
add a comment |
You cannot mount directly a specific directory. You have to mount the entire partition then bind the directory. see bind mount
in man mount
First you make an entry in /etc/fstab
to mount your old drive:
[that partition] /mnt/[that partition] auto nosuid,nodev,nofail, 0 0
then you bind the directory you want (in fstab)
/mnt/[that partition][/that dir] /home/user/whatever bind
You cannot mount directly a specific directory. You have to mount the entire partition then bind the directory. see bind mount
in man mount
First you make an entry in /etc/fstab
to mount your old drive:
[that partition] /mnt/[that partition] auto nosuid,nodev,nofail, 0 0
then you bind the directory you want (in fstab)
/mnt/[that partition][/that dir] /home/user/whatever bind
edited yesterday
answered yesterday
Jean-MarieJean-Marie
1,074168
1,074168
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
add a comment |
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
add a comment |
Here's what i did , it seems like i have my home working. attached is a snap of my fstab. Comments are appreciated.
For future reference, it's best not to post images of text, especially scripts or config files. Other users cannot edit the errors easily, plus images can go missing if the host website such as imgur deletes the image or the website itself is down
– Sergiy Kolodyazhnyy
4 hours ago
Thank you for mentioning that Sergiy. I will keep that in mind. Thank you.
– Mahmoud Gudarzi
3 hours ago
add a comment |
Here's what i did , it seems like i have my home working. attached is a snap of my fstab. Comments are appreciated.
For future reference, it's best not to post images of text, especially scripts or config files. Other users cannot edit the errors easily, plus images can go missing if the host website such as imgur deletes the image or the website itself is down
– Sergiy Kolodyazhnyy
4 hours ago
Thank you for mentioning that Sergiy. I will keep that in mind. Thank you.
– Mahmoud Gudarzi
3 hours ago
add a comment |
Here's what i did , it seems like i have my home working. attached is a snap of my fstab. Comments are appreciated.
Here's what i did , it seems like i have my home working. attached is a snap of my fstab. Comments are appreciated.
answered 5 hours ago
Mahmoud GudarziMahmoud Gudarzi
58117
58117
For future reference, it's best not to post images of text, especially scripts or config files. Other users cannot edit the errors easily, plus images can go missing if the host website such as imgur deletes the image or the website itself is down
– Sergiy Kolodyazhnyy
4 hours ago
Thank you for mentioning that Sergiy. I will keep that in mind. Thank you.
– Mahmoud Gudarzi
3 hours ago
add a comment |
For future reference, it's best not to post images of text, especially scripts or config files. Other users cannot edit the errors easily, plus images can go missing if the host website such as imgur deletes the image or the website itself is down
– Sergiy Kolodyazhnyy
4 hours ago
Thank you for mentioning that Sergiy. I will keep that in mind. Thank you.
– Mahmoud Gudarzi
3 hours ago
For future reference, it's best not to post images of text, especially scripts or config files. Other users cannot edit the errors easily, plus images can go missing if the host website such as imgur deletes the image or the website itself is down
– Sergiy Kolodyazhnyy
4 hours ago
For future reference, it's best not to post images of text, especially scripts or config files. Other users cannot edit the errors easily, plus images can go missing if the host website such as imgur deletes the image or the website itself is down
– Sergiy Kolodyazhnyy
4 hours ago
Thank you for mentioning that Sergiy. I will keep that in mind. Thank you.
– Mahmoud Gudarzi
3 hours ago
Thank you for mentioning that Sergiy. I will keep that in mind. Thank you.
– Mahmoud Gudarzi
3 hours ago
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%2f1110684%2fhow-to-mount-a-specific-directory-from-a-partitionnot-the-entire-partition-ont%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
Mount is for filesystems. A directory is only one part of filesystem, so you cannot select just part of a filesystem to mount. But you could mount
/CentosHome/username/whatever
at/media/username/centos
and then make a symbolic link to/media/username/centos/username/whatever
inside your home folder. That's what I do with my VirtualBox machines. I've symbolic link to the directory , but filesystem is mounted at/media/myuser/second_hard_drive
– Sergiy Kolodyazhnyy
yesterday
Hello , thank you for you guidance, I think i was able to do it. i'm attaching a snap of my fstab here , would you please check it everything looks alright ?
– Mahmoud Gudarzi
5 hours ago
Looks alright. Remember that you need same usernames on both systems to have access rights for each respective owner of the directory.
– Sergiy Kolodyazhnyy
5 hours ago
yea, i got that. Thank you, Sergiy.
– Mahmoud Gudarzi
5 hours ago