How to bind Windows folders to those in my home directory?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
User avatar
nickname
Level 1
Level 1
Posts: 25
Joined: Sun Feb 17, 2019 11:38 am

How to bind Windows folders to those in my home directory?

Post by nickname »

I just came back to Linux (Mint 19.1 xfce) after a 20-year hiatus in Windows. Lots of things have changed...

Objective:
to mount my OOTB Windows folders (Documents, Downloads, Music, Video, etc.) to those in my ~/ directory (Documents, etc.)

What I have so far:
  • I used the Disks utility (Accessories menu) to set up a mount point for the ntfs partition containing Documents, Downloads, etc.,
  • tested to make sure the partition mounts properly on boot, and
  • researched systemd, but everything I found talks about the theory of how systemd works, but not which config file to use for this type of thing.
I read in the Ubuntu forums that I can use bind to do this, but the example uses rc.local which is, apparently, now out of vogue.

Questions:
  • Which file in /etc/ (or a .xxxx file in ~/) is used for setting up a bind between folders and directories?
  • What syntax would I use?
Because it's been so long and my mind has gone soft (as in: micro-soft) I'd really appreciate a working example.

User avatar
WharfRat
Level 21
Level 21
Posts: 13499
Joined: Thu Apr 07, 2011 8:15 pm

Re: How to bind Windows folders to those in my home directory?

Post by WharfRat »

You should use rbind to include the entire file hierarchy including submounts if any.

Create a mountpoint in your home folder like mkdir winfiles or whatever name you prefer. Just make sure you use the same name in fstab.

In /etc/fstab your line should be /path/to/win_mointpoint /home/yourname/winfiles none rw,user,rbind 0 0

Just to be safe copy your original fstab file to /etc/fstab.bak just in case.

Good luck :wink:
ImageImage

altair4
Level 19
Level 19
Posts: 9804
Joined: Tue Feb 03, 2009 10:27 am

Re: How to bind Windows folders to those in my home directory?

Post by altair4 »

There's a problem with using bind today. It has a bug: https://gitlab.gnome.org/GNOME/glib/issues/1271

The bind itself works it's just that the system sees it as a removable device and shows up on the desktop as such but with the icon labeled as the higher level folder.

So for example if I have something like this in fstab:

Code: Select all

/DataN/Documents /home/tester/Documents auto bind 0 0
The bind will work but I will see an icon on the desktop labeled DataN that points to Documents. Do that for multiple subfolders and it gets annoying.

An alternative is bindfs if you are interested:

Install bindfs: sudo apt install bindfs

Then the lines in /etc/fstab would look like something like this:

Code: Select all

/DataN/Documents /home/tester/Documents fuse.bindfs perms=0777,force-user=tester,x-gvfs-hide,nonempty 0 0
/DataN/Pictures /home/tester/Pictures fuse.bindfs perms=0777,force-user=tester,x-gvfs-hide,nonempty 0 0
Note: Unlike the bug report for bind x-gvfs-hide works for bindfs and stops a deskop icon from being created for each subfolder.

BIGGER NOTE: Anytime you mess with fstab please run the following command after you are done editing:

Code: Select all

sudo mount -a
If you or I did something stupid the above command will spit out an error message. You want to find this out before you reboot not after.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

User avatar
nickname
Level 1
Level 1
Posts: 25
Joined: Sun Feb 17, 2019 11:38 am

Re: How to bind Windows folders to those in my home directory?

Post by nickname »

Thanks, guys, for responding.

I'm so sorry to hear about the bug in bind... Well, actually, as long as I can get it working, I'm good. :)

Anyway, I did the whole bindfs thing and things are sorted. Thanks, altair4.

And WharfRat, thank you, too. I do prefer to keep things split up, but extra knowledge at this point is always good to have.

Post Reply

Return to “Newbie Questions”