Hi, I’m running leap 15.6 on my dual-boot laptop. The Windows 10 partition is mounted on boot to a mount point. Can I modify in principle the entry in /etc/fstab such that only my user appears at the mount point?
Sorry, I do not understand what "a user appearing on a mount point means.
And when you want people to comment on, or suggest changes to and fstab entry, then please SHOW that entry.
You question may be that you want the mount to take place when needed (and not already on boot). This is call “auto-mounting” and can be configured using systemd.
See https://wiki.archlinux.org/index.php/fstab#Automount_with_systemd
In fact all I had to do is to add these options to the entry in/etc/fstab:
x-systemd.automount,x-systemd.mount-timeout=10,x-systemd.idle-timeout=5min
My personal entry then reads:
boven.henm.xs4all.nl:/home/wij /home/wij nfs noauto,nofail,x-systemd.automount,x-systemd.mount-timeout=10,x-systemd.idle-timeout=5min 0 0
The noauto and the nofail are for not mounting it on boot (that is not needed, because we mount it on need) and nofail to avoid extra problems when the mounting fails.
You can of course vary in the value of the x-stystemd.idle-timeout, after that many minutes of not being in use the fs will unmounted.
Welcome to the openSUSE Forums!
If you mean “mount only my user files without all the Win* clutter” it depends on where your Win* files are stored.
If they are on a separate partition, you can mount that partition without mounting the Win* system partition of course.
If they are in a directory (“folder” in Win* terms) within the system partition, you can still make that directory appear somewhere else.
Check mount --rbind olddir newdir
or the equivalent fstab line /olddir /newdir none rbind
or look at man mount
and scroll down to the “Bind mount operation” section for details.
Sorry,
for being too vague in the description of my problem. Currently I have the Windows partition mounted at a mount point. It contains the whole Windows - system files and user files.
When going to that mount point I see the whole Windows system, beginning at C:. However, I would like to see only the file system structure beginning at C:Users/MyUser. Can that be done?
In /etc/fstab I have an entry such that the partition is mounted at boot time.
I think Iunderstand you now better. Thus forget my advice above.
Again, saying such things without SHOWING here does not help your helpers.
UUID=12BB405FDA3218AE /home/gerd/Windows ntfs user,uid=1000,gid=1000 0 0
So mount --rbind olddir newdir
should do the trick.
Create a “newdir” where you want your win files to appear, for instance:
mkdir /home/<your username>/newdir
then show cat /etc/fstab
as asked by @hcvv if you want help finding what “olddir” should look like.
So I bet that the following should work:
mount --rbind /home/gerd/Windows/Users/MyUser /home/gerd/newdir
Change “newdir” to your liking and create the directory accordingly, for instance:
mkdir /home/gerd/newdir
So “/home/gerd/newdir” is efffectively the mount point for my Windows user folder, while ‘/home/gerd/Windows’ is the mount point for the whole Windows partition, i.e. ‘C:’?
However that is exactly what I didn’t have in mind. I just wanted my Windows folder, and only that folder, accessible at my mount point '/home/gerd/Windows like I can do with ‘sshfs’ mounting any user on another linux system.
You can unmount the other, i.e. ‘C:’, partition after you did the mount --rbind
since the two mounts are independent. Keep in mind that you still have (part of) the Windows filesystem mounted, so you cannot do odd things like reformatting etc.
I don’t know a way of mounting only a subdir in Linux without mounting the entire filesystem in advance.
Thanks so much! I think this thread can be closed!
Well, then do so. We can’t.
mount -o X-mount.subdir=/Users/MyUser ...
man 8 mount
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.