Mounting using alternate fstab file

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















I need to use an alternative fstab file for mounting a folder in another folder, like the command



mount --bind /folder1 /folder2


I tried the command



mount --fstab /pathToFile.fstab


as stated in the man:




-T, --fstab path



Specifies an alternative fstab file. If path is a directory then the files in the directory are sorted by strverscmp(3); files that start with . or without an .fstab extension are ignored. The option can be specified more than once. This option is mostly designed for initramfs or chroot scripts where additional configuration is specified beyond standard system configuration.




I create the file this way:



/folder1 /folder2 auto bind 0 0


but the command



mount --fstab /path


does nothing.



I added the line from the alternative file in /etc/fstab and with the



mount -a


the folder is mounted correctly.



Does anybody have experience with the --fstab option?










share|improve this question



















  • 2





    I guess you should try mount --fstab /path -a or mount --fstab /path /folder1.

    – Bodo
    Feb 13 at 9:53











  • Is your alternate fstab file called path and is it located in the root directory? This is what your mount --fstab /path command implies.

    – Kusalananda
    Feb 13 at 9:54











  • @Kusalananda /path was an example, my fstab file is in /ftp/mountFile.fstab, the file exist, but I didn't use the -a option, that solve my problem

    – Andy
    Feb 13 at 13:54















0















I need to use an alternative fstab file for mounting a folder in another folder, like the command



mount --bind /folder1 /folder2


I tried the command



mount --fstab /pathToFile.fstab


as stated in the man:




-T, --fstab path



Specifies an alternative fstab file. If path is a directory then the files in the directory are sorted by strverscmp(3); files that start with . or without an .fstab extension are ignored. The option can be specified more than once. This option is mostly designed for initramfs or chroot scripts where additional configuration is specified beyond standard system configuration.




I create the file this way:



/folder1 /folder2 auto bind 0 0


but the command



mount --fstab /path


does nothing.



I added the line from the alternative file in /etc/fstab and with the



mount -a


the folder is mounted correctly.



Does anybody have experience with the --fstab option?










share|improve this question



















  • 2





    I guess you should try mount --fstab /path -a or mount --fstab /path /folder1.

    – Bodo
    Feb 13 at 9:53











  • Is your alternate fstab file called path and is it located in the root directory? This is what your mount --fstab /path command implies.

    – Kusalananda
    Feb 13 at 9:54











  • @Kusalananda /path was an example, my fstab file is in /ftp/mountFile.fstab, the file exist, but I didn't use the -a option, that solve my problem

    – Andy
    Feb 13 at 13:54













0












0








0








I need to use an alternative fstab file for mounting a folder in another folder, like the command



mount --bind /folder1 /folder2


I tried the command



mount --fstab /pathToFile.fstab


as stated in the man:




-T, --fstab path



Specifies an alternative fstab file. If path is a directory then the files in the directory are sorted by strverscmp(3); files that start with . or without an .fstab extension are ignored. The option can be specified more than once. This option is mostly designed for initramfs or chroot scripts where additional configuration is specified beyond standard system configuration.




I create the file this way:



/folder1 /folder2 auto bind 0 0


but the command



mount --fstab /path


does nothing.



I added the line from the alternative file in /etc/fstab and with the



mount -a


the folder is mounted correctly.



Does anybody have experience with the --fstab option?










share|improve this question
















I need to use an alternative fstab file for mounting a folder in another folder, like the command



mount --bind /folder1 /folder2


I tried the command



mount --fstab /pathToFile.fstab


as stated in the man:




-T, --fstab path



Specifies an alternative fstab file. If path is a directory then the files in the directory are sorted by strverscmp(3); files that start with . or without an .fstab extension are ignored. The option can be specified more than once. This option is mostly designed for initramfs or chroot scripts where additional configuration is specified beyond standard system configuration.




I create the file this way:



/folder1 /folder2 auto bind 0 0


but the command



mount --fstab /path


does nothing.



I added the line from the alternative file in /etc/fstab and with the



mount -a


the folder is mounted correctly.



Does anybody have experience with the --fstab option?







mount fstab bind-mount






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 13 at 10:44









Stephen Kitt

175k24400477




175k24400477










asked Feb 13 at 9:43









AndyAndy

31




31







  • 2





    I guess you should try mount --fstab /path -a or mount --fstab /path /folder1.

    – Bodo
    Feb 13 at 9:53











  • Is your alternate fstab file called path and is it located in the root directory? This is what your mount --fstab /path command implies.

    – Kusalananda
    Feb 13 at 9:54











  • @Kusalananda /path was an example, my fstab file is in /ftp/mountFile.fstab, the file exist, but I didn't use the -a option, that solve my problem

    – Andy
    Feb 13 at 13:54












  • 2





    I guess you should try mount --fstab /path -a or mount --fstab /path /folder1.

    – Bodo
    Feb 13 at 9:53











  • Is your alternate fstab file called path and is it located in the root directory? This is what your mount --fstab /path command implies.

    – Kusalananda
    Feb 13 at 9:54











  • @Kusalananda /path was an example, my fstab file is in /ftp/mountFile.fstab, the file exist, but I didn't use the -a option, that solve my problem

    – Andy
    Feb 13 at 13:54







2




2





I guess you should try mount --fstab /path -a or mount --fstab /path /folder1.

– Bodo
Feb 13 at 9:53





I guess you should try mount --fstab /path -a or mount --fstab /path /folder1.

– Bodo
Feb 13 at 9:53













Is your alternate fstab file called path and is it located in the root directory? This is what your mount --fstab /path command implies.

– Kusalananda
Feb 13 at 9:54





Is your alternate fstab file called path and is it located in the root directory? This is what your mount --fstab /path command implies.

– Kusalananda
Feb 13 at 9:54













@Kusalananda /path was an example, my fstab file is in /ftp/mountFile.fstab, the file exist, but I didn't use the -a option, that solve my problem

– Andy
Feb 13 at 13:54





@Kusalananda /path was an example, my fstab file is in /ftp/mountFile.fstab, the file exist, but I didn't use the -a option, that solve my problem

– Andy
Feb 13 at 13:54










1 Answer
1






active

oldest

votes


















0














The command



mount --fstab /pathToFile.fstab


is the same as mount with no options when using the standard fstab file, i.e. "list mounted filesystems".



To actually mount all automountable filesystems specified in a custom fstab file similar to using mount -a with the standard fstab files, you'll need to use the --fstab option together with the -a option:



mount --fstab /pathToFile.fstab -a





share|improve this answer























  • Thank you very much, this answer solve my question!

    – Andy
    Feb 13 at 13:50










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500362%2fmounting-using-alternate-fstab-file%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









0














The command



mount --fstab /pathToFile.fstab


is the same as mount with no options when using the standard fstab file, i.e. "list mounted filesystems".



To actually mount all automountable filesystems specified in a custom fstab file similar to using mount -a with the standard fstab files, you'll need to use the --fstab option together with the -a option:



mount --fstab /pathToFile.fstab -a





share|improve this answer























  • Thank you very much, this answer solve my question!

    – Andy
    Feb 13 at 13:50















0














The command



mount --fstab /pathToFile.fstab


is the same as mount with no options when using the standard fstab file, i.e. "list mounted filesystems".



To actually mount all automountable filesystems specified in a custom fstab file similar to using mount -a with the standard fstab files, you'll need to use the --fstab option together with the -a option:



mount --fstab /pathToFile.fstab -a





share|improve this answer























  • Thank you very much, this answer solve my question!

    – Andy
    Feb 13 at 13:50













0












0








0







The command



mount --fstab /pathToFile.fstab


is the same as mount with no options when using the standard fstab file, i.e. "list mounted filesystems".



To actually mount all automountable filesystems specified in a custom fstab file similar to using mount -a with the standard fstab files, you'll need to use the --fstab option together with the -a option:



mount --fstab /pathToFile.fstab -a





share|improve this answer













The command



mount --fstab /pathToFile.fstab


is the same as mount with no options when using the standard fstab file, i.e. "list mounted filesystems".



To actually mount all automountable filesystems specified in a custom fstab file similar to using mount -a with the standard fstab files, you'll need to use the --fstab option together with the -a option:



mount --fstab /pathToFile.fstab -a






share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 13 at 11:15









telcoMtelcoM

18.8k12347




18.8k12347












  • Thank you very much, this answer solve my question!

    – Andy
    Feb 13 at 13:50

















  • Thank you very much, this answer solve my question!

    – Andy
    Feb 13 at 13:50
















Thank you very much, this answer solve my question!

– Andy
Feb 13 at 13:50





Thank you very much, this answer solve my question!

– Andy
Feb 13 at 13:50

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • 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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500362%2fmounting-using-alternate-fstab-file%23new-answer', 'question_page');

);

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






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay