-1

I refer to the post How do I mount a folder from another partition?. I have /home associated with a partition and this is working.

From the post it seems that my fstab should read:

/whatever    /home    none    bind

Can I have /whatever related to this partition without is being under /home? In scripts I would like to refer to this location as /whatever rather than as /home/whatever

I come from the Windows environment the my reasoning is that Drive D could have any number of folders under it.

Thanks


Clarification note

I have the following in my fstab

UUID=109bff64-xxxx /home ext4 defaults 0 2

I want to add a directory /whatever to resolve to the save device having UUID=109bff64-xxxx.

I do not want /whatever to be under /home.

chribonn
  • 311

1 Answers1

1

While you could do this with a bind mount, that seems like overkill. If all you want is to access the data in /home from the directory /whatever, a symlink is enough:

sudo ln -s /home /whatever

That will create the symlink /whatever and you can use it just as you would /home.

I don't see any advantage to using a bind mount instead if all you want is a different entry point to /home. But then I also don't really understand why you would prefer to use /whatever instead of /home. They are both top level directories under / so there seems to be no benefit in using one over the other.

In any case, if you insist on using a bind mount, then you would first need to create the directory:

sudo mkdir /whatever

And then add this line to the end of your /etc/fstab file:

/home    /whatever   bind  defaults

That means "bind mount /home to /whatever".

terdon
  • 104,119