Does the command mount -o bind allow mounting a folder from a different file system (vfat, ntfs) to a folder in Linux native partition?
2 Answers
Yes. Well, I've made a quick test on my system, mounting a NTFS partition from Windows onto a directory in a XFS Linux partition, and it worked okay.
You have to do this operation as root.
-
You needn't do it as root if the bind mount is specified in
/etc/fstabfor the user attempting to do it. Like/path/to/source/folder /path/to/target/folder bind noauto,user 0 1.mikeserv– mikeserv2015-01-05 17:35:08 +00:00Commented Jan 5, 2015 at 17:35
Yes it does. The main point is that the source and destination folders have to exist prior to attempting the mount. You also need to be superuser.
Also read up on bind-mounts, as there are options to them too.
-
The target dir can be created as a consequence of the mount action with
mount -o bind,x-mount.mkdir[=mode]which actually does require root auth to do, but bind mounts can be specified in/etc/fstabotherwise. Thex-*options tomountcan be used to signal a monitoring process though which will handle that as well.mikeserv– mikeserv2015-01-05 17:38:16 +00:00Commented Jan 5, 2015 at 17:38 -
1@mikeserv: nice, wasn't aware of the
x-*option. A reminder to sometimes skim overmanpages again after a new installation.0xC0000022L– 0xC0000022L2015-01-05 18:22:48 +00:00Commented Jan 5, 2015 at 18:22 -
Actually, thinking about it, and I'm betting that
x-*stuff could be pretty useful if a monitoring script watched mounts with afindmnt -poll...mikeserv– mikeserv2015-01-05 19:17:56 +00:00Commented Jan 5, 2015 at 19:17